Author Topic: [PACKAGED] QtWeb - Is it OK ?  (Read 597 times)

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
[PACKAGED] QtWeb - Is it OK ?
« on: November 29, 2012, 02:13:07 AM »
SRPM : http://dl.dropbox.com/u/37931428/qtweb/QtWeb-3.7.3-1slingshot2012.src.rpm
RPM : http://dl.dropbox.com/u/37931428/qtweb/QtWeb-3.7.3-1slingshot2012.i586.rpm
SPEC : http://dl.dropbox.com/u/37931428/qtweb/pclos-qtwebbin.spec
LOG : http://dl.dropbox.com/u/37931428/qtweb/pclos-qtwebbin.spec.log

NOTE : Everything that follows is the discussion that went into creating this package.
-------------------

I was finally able to get it to finish. Kindly evaluate.

--------------------------------

I am going crazy being unable to figure out why am not able to successfully package QtWeb.

I have a tar.xz named QtWeb-elf386 containing 2 files:
1. QtWeb (which is the single binary executable)
2. License.txt (Just the license file)

I have created the following .spec file after going through many other .spec files including those for PCLinuxOS Live USB Creator and Apt-Fast. (Basically those which do not do any compiling)

Code: [Select]
Summary: Portable, compact, fast, secure internet browser based on Qt and WebKit.
Name: QtWeb
Version: elf386
Release: %mkrel 1
Group: Networking/WWW
URL: http://qtweb.net
License: GPLv2+
Source0: %{name}-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-buildroot

%description
QtWeb Internet Browser - lightweight, secure and portable browser having unique user interface and privacy features.
QtWeb is an open source project based on Nokia's Qt framework and Apple's WebKit rendering engine (the same as being used in Apple Safari and Google Chrome).

%prep
%setup -q

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}/%{_bindir}
install -m 0755 QtWeb %{buildroot}/%{_bindir}/QtWeb
install -m 0755 License.txt %{buildroot}/%{_bindir}/License.txt

%clean
rm -rf %{buildroot}


%files
%defattr(-, root, root)
%{_bindir}/QtWeb
%{_bindir}/License.txt

%changelog

This generates a proper .src.rpm but the .rpm generated only contains a 208 B sized QtWeb binary while it should have been ~13MB.

What am I doing wrong here?
« Last Edit: December 16, 2012, 10:50:00 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1167
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #1 on: November 29, 2012, 02:25:21 AM »
could you post a link to your srpm please


btw.

you should place the license file in

Code: [Select]
%{_docdir}/%{name}
not in /usr/bin
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #2 on: November 29, 2012, 02:47:26 AM »
Just uploading to DropBox. Will post the link soon as it is done.

---------------

Here is the current .spec.log

Code: [Select]
Executing(%prep): /bin/sh -e /home/testinstall/src/tmp/rpm-tmp.NRnGtz
+ umask 022
+ cd /home/testinstall/src/rpm/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ cd /home/testinstall/src/rpm/BUILD
+ rm -rf QtWeb-elf386
+ /usr/bin/xz -dc /home/testinstall/src/rpm/SOURCES/QtWeb-elf386.tar.xz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd QtWeb-elf386
+ exit 0
Executing(%install): /bin/sh -e /home/testinstall/src/tmp/rpm-tmp.uf0JgU
+ umask 022
+ cd /home/testinstall/src/rpm/BUILD
+ cd QtWeb-elf386
+ '[' 1 -eq 1 ']'
+ rm -rf /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386
+ mkdir -p /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386//usr/bin
+ install -m 0755 QtWeb /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386//usr/bin/QtWeb
+ install -m 0755 License.txt /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386//usr/bin/License.txt
+ '[' -n '' ']'
+ /usr/share/spec-helper/clean_files
+ '[' -n '' ']'
+ /usr/share/spec-helper/compress_files .bz2
+ '[' -n '' ']'
+ /usr/share/spec-helper/relink_symlinks
+ '[' -n '' ']'
+ /usr/share/spec-helper/clean_perl
+ '[' -n '' ']'
+ /usr/share/spec-helper/lib_symlinks
+ '[' -n '' ']'
+ /usr/share/spec-helper/gprintify
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_mo
+ '[' -n '' ']'
+ /usr/share/spec-helper/translate_menu
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_pamd
+ '[' -n '' ']'
+ /usr/share/spec-helper/remove_info_dir
+ '[' -n '' ']'
+ /usr/share/spec-helper/fix_eol
+ DONT_STRIP=
+ /usr/share/spec-helper/check_elf_files
Processing files: QtWeb-elf386-1slingshot2012.i586
Finding  Provides: /usr/lib/rpm/mandriva/filter.sh ' ' ' ' '/home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386' /usr/lib/rpm/mandriva/find-provides
Finding  Requires: /usr/lib/rpm/mandriva/filter.sh ' ' ' ' '/home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386' /usr/lib/rpm/mandriva/find-requires /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386 i586
Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386
Wrote: /home/testinstall/src/rpm/SRPMS/QtWeb-elf386-1slingshot2012.src.rpm
Wrote: /home/testinstall/src/rpm/RPMS/i586/QtWeb-elf386-1slingshot2012.i586.rpm
Executing(%clean): /bin/sh -e /home/testinstall/src/tmp/rpm-tmp.Z6NN5f
+ umask 022
+ cd /home/testinstall/src/rpm/BUILD
+ cd QtWeb-elf386
+ rm -rf /home/testinstall/src/rpm/BUILDROOT/QtWeb-elf386-1slingshot2012.i386
+ exit 0
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #3 on: November 29, 2012, 02:51:03 AM »
THIS IS OUTDATED. FINAL .src.rpm IS LINKED ABOVE.

===========================================

OK. Here is the link:
<snip>Outdated link removed</snip>

-----------------

I will correct the .spec regarding the License file.
« Last Edit: December 16, 2012, 10:51:09 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #4 on: November 29, 2012, 03:57:35 AM »
This generates a proper .src.rpm but the .rpm generated only contains a 208 B sized QtWeb binary while it should have been ~13MB.
What am I doing wrong here?

HINT:  man strip

If you didn't build the binary you need to preserve it by adding:

Code: [Select]
%define dont_strip=1
to the SPEC.

Terry.
« Last Edit: November 29, 2012, 04:16:40 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1167
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #5 on: November 29, 2012, 04:24:36 AM »
further note

you used

Code: [Select]
%{buildroot}/%{_bindir}...
this expands to


/home/<you>/src/rpm/BUILDROOT/<buildroot name>//usr/bin


don't know exactly whether this affects the build - doesn't seem so - but for me it would be strange path.


Edit:

One more elf386 is not the version it is note about that it is a binary for x86 architecture the version in this case is 3.7.3 see also the download page but it is very small written.
« Last Edit: November 29, 2012, 04:30:52 AM by ghostbunny »
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1167
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #6 on: November 29, 2012, 04:33:11 AM »
This generates a proper .src.rpm but the .rpm generated only contains a 208 B sized QtWeb binary while it should have been ~13MB.
What am I doing wrong here?

HINT:  man strip

If you didn't build the binary you need to preserve it by adding:

Code: [Select]
%define dont_strip=1
to the SPEC.

Terry.

Learning every day a bit more. Thanks for teaching zenmaster Terry ;D
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #7 on: November 29, 2012, 06:27:29 AM »

HINT:  man strip

If you didn't build the binary you need to preserve it by adding:

Code: [Select]
%define dont_strip=1
to the SPEC.

Terry.

Never thought of it. Thank you very much.
The other .spec files I used for reference did not have that line. Probably because they were just scripts.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #8 on: November 29, 2012, 06:36:12 AM »
further note

you used

Code: [Select]
%{buildroot}/%{_bindir}...
this expands to


/home/<you>/src/rpm/BUILDROOT/<buildroot name>//usr/bin


don't know exactly whether this affects the build - doesn't seem so - but for me it would be strange path.


Edit:

One more elf386 is not the version it is note about that it is a binary for x86 architecture the version in this case is 3.7.3 see also the download page but it is very small written.

The double // thing did bother me. But to avoid that I had to change what was there in other reference .spec files I used. And there was no difference after that either. Of course at that time I just did not know what Terry just explained above.

I understand the version thing. Did some research today about elf386 and got to know it refers to the type of binary. In this particular case I just got so mad trying to figure out what was wrong that I just wanted to try all permutations. Actually right now I have about 23 versions for that .spec file ;)
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #9 on: November 29, 2012, 09:44:54 AM »
OK. That worked. Here is the current .spec with which the build completes successfully. Also the resulting package can be installed and uninstalled through Synaptic cleanly. The binary works but can only be launched from the command prompt at present. There are a lot error messages running there though and the browsing too feels a bit disconnected.

I have fixed that double slash "//" issue. It was an error generated from my oversight.

Code: [Select]
# This line is needed as we are only packaging a pre-compiled binary
%define dont_strip 1

Name: QtWeb
# There is also a build number which is 087 not included here else would be 3.7.3.087
Version: 3.7.3
Release: %mkrel 1
Summary: Portable, compact, fast, secure internet browser based on Qt and WebKit.
Group: Networking/WWW
URL: http://qtweb.net
License: GPLv2+
Source0: %{name}-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-buildroot
# Adding this line so that this will not get attached to any other package
AutoReqProv: no

%description
QtWeb Internet Browser - lightweight, secure and portable browser having unique user interface and privacy features.
QtWeb is an open source project based on Nokia's Qt framework and Apple's WebKit rendering engine (the same as being used in Apple Safari and Google Chrome).
This is the pre-built binary from http://qtweb.net.

%prep
%setup -q

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_docdir}/%{name}

install -m 0755 QtWeb %{buildroot}%{_bindir}/QtWeb
install -m 0755 License.txt %{buildroot}%{_docdir}/%{name}/License.txt

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%{_bindir}/QtWeb
%{_docdir}/%{name}/License.txt

%changelog
* Thu Nov 29 2012 Sling Shot <sling-shot at lycos.com> 3.7.3-1slingshot2012
- 3.7.3

Now I need to hunt down the process of creating a desktop file.

Also how to associate an icon with this binary?
« Last Edit: November 29, 2012, 09:47:47 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #10 on: December 03, 2012, 11:13:10 AM »
Further improved the .spec file to include a .desktop file and add an icon to it.
However still there is no icon in the Smooth Tasks area of panel.

Code: [Select]

# This line is needed as we are only packaging a pre-compiled binary
%define dont_strip 1

Name: QtWeb
# There is also a build number which is 087 not included here else would be 3.7.3.087
Version: 3.7.3
Release: %mkrel 2
Summary: Portable, compact, fast, secure internet browser based on Qt and WebKit.
Group: Networking/WWW
URL: http://qtweb.net
License: GPLv2+
Source0: %{name}-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-buildroot
# Adding this line so that this will not get attached to any other package
AutoReqProv: no

%description
QtWeb Internet Browser - lightweight, secure and portable browser having unique user interface and privacy features.
QtWeb is an open source project based on Nokia's Qt framework and Apple's WebKit rendering engine (the same as being used in Apple Safari and Google Chrome).
This is the pre-built binary from http://qtweb.net.

%prep
%setup -q

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_docdir}/%{name}

install -m 0755 QtWeb %{buildroot}%{_bindir}/QtWeb
install -m 0755 License.txt %{buildroot}%{_docdir}/%{name}/License.txt

mkdir -p %{buildroot}%{_datadir}/applications
%__cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=QtWeb Browser
Icon=/usr/share/icons/QtWeb.png
Comment=QtWeb Internet Browser.
Exec=QtWeb
Terminal=false
Type=Application
StartupNotify=true
Categories=Network;WebBrowser;
GenericName=Web Browser
MimeType=text/html;application/xhtml+xml;
EOF

mkdir -p %{buildroot}%{_datadir}/icons
install -m 644 QtWeb.png %{buildroot}%{_datadir}/icons/QtWeb.png

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%{_bindir}/QtWeb
%{_docdir}/%{name}/License.txt
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/QtWeb.png

%changelog
* Thu Nov 29 2012 Sling Shot <sling-shot at lycos.com> 3.7.3-1slingshot2012
- 3.7.3

Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: Request help packaging 1 binary and 1 license file of QtWeb
« Reply #11 on: December 04, 2012, 08:18:45 AM »
<snip>Outdated links removed</snip>
« Last Edit: December 16, 2012, 10:52:58 AM by sling-shot »
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: [PACKAGED] QtWeb - Is it OK ?
« Reply #12 on: December 16, 2012, 10:52:10 AM »
Looks like this is ready to go. Thanks everyone.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6