rrpmbuild bug under Linux: problem and fixing

rrpmbuild bug under Linux: problem and fixing

Hello! Three weeks I tried to make the RPM-package for MeeGo. I used QtCreator MeeGo IDE for Linux. And I can not create normal RPM-package. The deep study showed: this IDE generated broken RPM-package. To be precise, the problem in the program rrpmbuild. The MeeGo compliance contains the following two rules: Compliance Spec 3.1.1 Naming An application package name shall begin with one of the owners' fully qualified domain names in lower case, in reverse order, and end with the application name (such as, com.companyname.appname). Compliance Spec 3.1.4 Layout in Filesystem An application shall be installed to /opt/packagename/ and, if necessary to the /etc/opt/packagename/ and /var/opt/packagename/ directories... For example, under these rules, the binary program file must be put in /opt/com.companyname.appname/bin directory. The QtCreator MeeGo IDE for Linux used utility rrpmbuild for generate RPM file. And this utility can not work with /opt directory. Full path to this utility: /usr/lib/madde/linux-i686/madbin/rrpmbuild Example: At directory with spec-file and all building file running next command: $ /usr/lib/madde/linux-i686/madbin/rrpmbuild -bb mytetra.spec Output: ----- 8< ----- Executing: %build + make make: Цель `first' не требует выполнения команд. Executing: %install + make install INSTALL_ROOT=rrpmbuild/instroot install -m 755 -p /home/xi/work/mytetra/misc/mytetra-build-meego/bin/mytetra rrpmbuild/instroot/opt/ru.webhamster.mytetra/bin/ install -m 755 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.desktop rrpmbuild/instroot/usr/share/applications/ install -m 644 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.svg rrpmbuild/instroot/usr/share/icons/hicolor/scalable/apps/ install -m 644 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.png rrpmbuild/instroot/usr/share/icons/hicolor/48x48/apps/ Adding directory usr/share Adding directory usr/share/applications Adding file usr/share/applications/mytetra.desktop Adding directory usr/share/icons Adding directory usr/share/icons/hicolor Adding directory usr/share/icons/hicolor/scalable Adding directory usr/share/icons/hicolor/scalable/apps Adding file usr/share/icons/hicolor/scalable/apps/mytetra.svg Adding directory usr/share/icons/hicolor/48x48 Adding directory usr/share/icons/hicolor/48x48/apps Adding file usr/share/icons/hicolor/48x48/apps/mytetra.png Pushing data "C" Pushing data "ru.webhamster.mytetra" Pushing data "1.28.5" Pushing data "1" Pushing data "# Add here description of the package." Pushing data "GPL v.3.0" Pushing data "Utility" Pushing data "Linux" Pushing data "i686" Pushing data "cpio" Pushing data "gzip" Pushing data "ru.webhamster.mytetra-1.28.5-src.rpm" ----- 8< ----- Look: in this log presented file /home/xi/work/mytetra/misc/mytetra-build-meego/bin/mytetra, and copying to rrpmbuild/instroot/opt/ru.webhamster.mytetra/bin/ directory. But at RPM package create time (see "Adding" strings) this file can not processing. This is rrpmbuild problem. The rrpmbuild can working with file from /usr directory only. For fix it, I used next step. 1. Open file /usr/lib/madde/linux-i686/madbin/rrpmbuild 2. Find string: my ($prefix, $exec_prefix, $lib) = ( '/usr', '/usr', 'lib' ); and replace it to my ($prefix, $exec_prefix, $lib) = ( '/', '/', 'lib' ); After fixing, rrpmbuild generate right RPM-package. Example (after fixing): ----- 8< ----- Executing: %build + make make: Цель `first' не требует выполнения команд. Executing: %install + make install INSTALL_ROOT=rrpmbuild/instroot install -m 755 -p /home/xi/work/mytetra/misc/mytetra-build-meego/bin/mytetra rrpmbuild/instroot/opt/ru.webhamster.mytetra/bin/ install -m 755 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.desktop rrpmbuild/instroot/usr/share/applications/ install -m 644 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.svg rrpmbuild/instroot/usr/share/icons/hicolor/scalable/apps/ install -m 644 -p /home/xi/work/mytetra/misc/meego/desktop/mytetra.png rrpmbuild/instroot/usr/share/icons/hicolor/48x48/apps/ Adding directory opt Adding directory opt/ru.webhamster.mytetra Adding directory opt/ru.webhamster.mytetra/bin Adding file opt/ru.webhamster.mytetra/bin/mytetra Adding directory usr Adding directory usr/share Adding directory usr/share/applications Adding file usr/share/applications/mytetra.desktop Adding directory usr/share/icons Adding directory usr/share/icons/hicolor Adding directory usr/share/icons/hicolor/scalable Adding directory usr/share/icons/hicolor/scalable/apps Adding file usr/share/icons/hicolor/scalable/apps/mytetra.svg Adding directory usr/share/icons/hicolor/48x48 Adding directory usr/share/icons/hicolor/48x48/apps Adding file usr/share/icons/hicolor/48x48/apps/mytetra.png Pushing data "C" Pushing data "ru.webhamster.mytetra" Pushing data "1.28.5" Pushing data "1" Pushing data "# Add here description of the package." Pushing data "GPL v.3.0" Pushing data "Utility" Pushing data "Linux" Pushing data "i686" Pushing data "cpio" Pushing data "gzip" Pushing data "ru.webhamster.mytetra-1.28.5-src.rpm" ----- 8< ----- Look to "Adding" strings: in package putting binary file opt/ru.webhamster.mytetra/bin/mytetra. I hope someone can help this information.
3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi xintrea,
I will take a look at this and get back to you.

Thanks
Meghana

> I will take a look at this and get back to you.

I further experimented with configuration *.pro and *.spec file, and realized that solve in start topic message is dirty hack.

True way for solved this problem:

- Don't fix rrpmbuild script.

- Open your *.spec file, and find line at the end of file: %{_prefix}/*

- Remove part "%{_prefix}".

- After remove, the line would look as: /*

After this correction the building procedure is normal include files from /opt directory.

Leave a Comment

Please sign in to add a comment. Not a member? Join today