×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Debian package question with Qt 4.6 and Maemo PR1.2

    I have an application that I have completely developed, tested it on the device and have working by copying the complied ARM binary copied. I can't seem to find a clean solution though for packaging. I can generate the deb package using scratchbox dpgk -b to build the binary package. This works however when trying to install the package every time it comes up with an error saying the PostInst script exited with an error. This script file is empty except for a simply statement the exits with a return code of 0 indicating success. Is there clear documentation on how this should be done? It appears that Qt 4.6 uses the sh_ commands to build a .deb package, so if there's a way to simply update the folder that it's using to include the icon and .desktop file that would be ideal, but if it has to be done manually I can do that as well.

    I've followed multiple walk throughs on Maemo.org but none of them are successful. Any help is greatly appreciated. The development itself isn't bad but this packaging is really difficult. I've packaged things for linux on the desktop before and never had this level of difficulty.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Maemo is basically using plain Debian packages with couple of additinal features.
    So documentation you should read is Debian New Maintainers' Guide
    http://www.debian.org/doc/maint-guide/
    and Debian Policy Manual:
    http://www.debian.org/doc/debian-policy/
    Post install script is not mandatory for Debian package, just remove it, if you cannot make it working.

    P.S. Qt has nothing to do with Debian packaging.

  3. #3
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Hi,
    if postinst doesn't do anything you can remove it, since it's not mandatory.. Anyway from what you said I don't understand how can it fails..

    There are some debian helper commands to manage desktop files. Putting those file in the right place it's a job that belong to the app developer than the package maintainer..
    You can do it simply adding a couple of lines in the Qt .pro file. A "make install" will install all those things in the correct place (debian/tmp/package-name/paths)

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    I tried removing the POSTINST and it still failed. I will post up the entire directory structure I currently have and also my control file see if maybe that can shed some light on this.

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Sorry. Does it complain about the postinst even if you don't have it?? O_o

  6. #6
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Yes it doe complain even if I remove the file. Here are the contents of the .desktop file which if something is wrong in here, that shouldn't come into play until after the package is installed but I thought I would include it anyway.

    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Name=TipCalculator
    Exec=/usr/local/bin/TipCalculator
    Icon=tip_calculator
    X-Maemo-Category=Office
    X-Window-Icon=tip_calculator
    X-Window-Icon-Dimmed=tip_calculator

    Then here is the contents of the debian control file I removed all but one dependency just to try and narrow it down.
    Package: TipCalculator
    Version: 1.0
    Architecture: armel
    Maintainer: kdesolutions <support@kdesolutions.com>
    Installed-Size: 68
    Depends: libc6 (>= 2.5.0-1)
    Section: unknown
    Priority: extra
    Description: <insert up to 60 chars description>
    <insert long description, indented with spaces>

    Then here is the folder structure
    +Tip Calculator
    + data
    + 64x64
    - tip_calculator.png
    tipcalculator.desktop
    + DEBIAN
    - control
    + usr
    + bin
    + local
    + bin
    - TipCalculator (ARM Compiled binary)
    + sbin

    I'm using the dpkg -b to create the debian package from binary.

    Any help is greatly appreciated

  7. #7
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    This doesn't tell anything about your problem.

  8. #8
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Quote Originally Posted by teamkde View Post
    Yes it doe complain even if I remove the file. Here are the contents of the .desktop file which if something is wrong in here, that shouldn't come into play until after the package is installed but I thought I would include it anyway.

    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    Name=TipCalculator
    Exec=/usr/local/bin/TipCalculator
    Icon=tip_calculator
    X-Maemo-Category=Office
    X-Window-Icon=tip_calculator
    X-Window-Icon-Dimmed=tip_calculator

    Then here is the contents of the debian control file I removed all but one dependency just to try and narrow it down.
    Package: TipCalculator
    Version: 1.0
    Architecture: armel
    Maintainer: kdesolutions <support@kdesolutions.com>
    Installed-Size: 68
    Depends: libc6 (>= 2.5.0-1)
    Section: unknown
    Priority: extra
    Description: <insert up to 60 chars description>
    <insert long description, indented with spaces>

    Then here is the folder structure
    +Tip Calculator
    + data
    + 64x64
    - tip_calculator.png
    tipcalculator.desktop
    + DEBIAN
    - control
    + usr
    + bin
    + local
    + bin
    - TipCalculator (ARM Compiled binary)
    + sbin

    I'm using the dpkg -b to create the debian package from binary.

    Any help is greatly appreciated
    Could you paste here the error message you have exactly? Moreover I don't understand if the folder tree is the source folder or it's the content of the debian package... since in both cases they look strange to me...
    Last edited by gnuton; 2010-06-15 at 13:33.

  9. #9
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    The folder structure is the contents of the debian package before it's made into a .deb file. If you already have a binary there is no need to do a "make" it's already compiled. Qt 4.6 is doing this part for me, so if I do a build in release mode with maemo it compiles my code into an ARM binary file automatically. I would like to make the packaging and deployment easier by simply using the compiled binary in a deb structured folder then bundling it. I've done this before on linux desktops with java applications and all you have to do is create the packaging folder structure correctly and it does the rest. So you have the folder with your application, you have data directory with a 64x64 folder indicating a "64x64" version of the application icon and in the root of the data folder you put the ".desktop" file. A "DEBIAN" folder with the control file Pre and Post scripts that you want debian to use then the remaining folders are just what gets copied where exactly like the directory structure on the destination system. So in this example I have a /usr/local/bin directory which is where debian packaging tool will place the binary executable. Now I know if I were going to leave it in this directory that I would need to put a chmod 755 in post install script to allow the user to execute it from that directory but I'm trying to take it a step at a time. If someone can simply outline a better way of packaging I am definitely open to that, but I'm trying to smooth the process of developing and deploying, and since the Qt IDE is already creating the ARM binary for me I would like to use that instead of using qmake from within scratchbox.

    Anyway the error that I receive when I try to isntall the .deb package that gets created, this is the error that I receive.

    (Reading database ... 27703 files and directories currently installed.)
    Preparing to replace tipcalculator 0.1 (using tip-calculator-1.0.deb) ...
    dpkg: error processing tip-calculator-1.0.deb (--install):
    dpkg: warning - old pre-removal script killed by signal (Segmentation fault), core dumped

    dpkg (subprocess): unable to execute post-installation script: Exec format error
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 2
    Errors were encountered while processing:

    ** NOTE THERE WAS NO POST SCRIPT INCLUDED IN THIS PACKAGE.

  10. #10
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Quote Originally Posted by teamkde View Post
    I would like to make the packaging and deployment easier by simply using the compiled binary in a deb structured folder then bundling it.
    If you want to make it easier, why did you choose wrong way with dpkg -b instead of proper way with dpkg-buildpackage?
    http://wiki.forum.nokia.com/index.ph...plication_menu

    Quote Originally Posted by teamkde View Post
    A "DEBIAN" folder with the control file Pre and Post scripts that you want debian to use then the remaining folders are just what gets copied where exactly like the directory structure on the destination system.
    So you do have postinst.

    Quote Originally Posted by teamkde View Post
    Now I know if I were going to leave it in this directory that I would need to put a chmod 755 in post install script to allow the user to execute it from that directory but I'm trying to take it a step at a time.
    It's not needed unless you are doing something really weird.

    Quote Originally Posted by teamkde View Post
    If someone can simply outline a better way of packaging I am definitely open to that, but I'm trying to smooth the process of developing and deploying, and since the Qt IDE is already creating the ARM binary for me I would like to use that instead of using qmake from within scratchbox.
    You don't need to use qmake directly, when building package and it's done just with one command: dpkg-buildpackage.

    Quote Originally Posted by teamkde View Post
    (Reading database ... 27703 files and directories currently installed.)
    Preparing to replace tipcalculator 0.1 (using tip-calculator-1.0.deb) ...
    dpkg: error processing tip-calculator-1.0.deb (--install):
    dpkg: warning - old pre-removal script killed by signal (Segmentation fault), core dumped

    dpkg (subprocess): unable to execute post-installation script: Exec format error
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 2
    Errors were encountered while processing:
    You have a problem with prerm script as well. Can you show output of tree command for your package directory.

  11. #11
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Doesn't dpkg-buildpackage build from source? The whole point of what I'm trying to do is to take the already compiled binary that Qt Creator outputs, add to it the correct software category, vendor, and application icon, then package that. If there is an easier way to accomplish this just let me know. If I can edit the maemo release profile in Qt and update that to add this information to the .deb that it creates, that would be ideal but I'm new to Qt. So really what I'm looking for is how to do it correctly more than just troubleshooting this particular package. I have code written, I have the binary file compiled correctly for the ARM processor, it runs on the device, now all I want to do is add an icon and make it "installable".

  12. #12
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Debian package question with Qt 4.6 and Maemo PR1.2

    Quote Originally Posted by teamkde View Post
    Doesn't dpkg-buildpackage build from source? The whole point of what I'm trying to do is to take the already compiled binary that Qt Creator outputs, add to it the correct software category, vendor, and application icon, then package that. If there is an easier way to accomplish this just let me know.
    The problem you running in are result of using dpkg -b. You can use dpkg-buildpackage -nc -b to skip cleanup. However, for most of the applications there is no point to skip cleanup as build process doesn't take that much time.

Similar Threads

  1. Replies: 10
    Last Post: 2010-06-04, 10:05
  2. Replies: 0
    Last Post: 2009-11-18, 12:18
  3. Qt for maemo presentation in Qt dev days
    By Jack Torrance in forum Nokia N9
    Replies: 1
    Last Post: 2009-10-17, 08:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •