Error on build package *.deb on Qt Creator



  • Hello guys, I have a problem when you build a deb package..

    This is the error:
    [CODE]
    dh_clean -k
    dh_installdirs

    Add here commands to install the package into debian/unlockpass.

    /usr/bin/make INSTALL_ROOT="/Users/steebono/UnlockPass/unlockpass-harmattan"/debian/unlockpass install
    cp -f -r /Users/steebono/UnlockPass/unlockpass/qml/unlockpass /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/opt/unlockpass/qml/
    install -m 644 -p /Users/steebono/UnlockPass/unlockpass/unlockpass80.png /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/usr/share/icons/hicolor/80x80/apps/
    install -m 644 -p /Users/steebono/UnlockPass/unlockpass/unlockpass_harmattan.desktop /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/usr/share/applications/
    install -m 755 -p "unlockpass" "/Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/opt/unlockpass/bin/unlockpass"
    install -m 755 -p /Users/steebono/UnlockPass/unlockpass/unlockpass.conf /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/etc/init/apps/
    dh_testdir
    dh_testroot
    dh_installchangelogs
    dh_installdocs
    dh_installexamples
    dh_installman
    dh_link
    dh_strip
    dh_compress
    dh_fixperms
    dh_installdeb
    find: -printf: unknown option
    dh_installdeb: command returned error code
    make: *** [binary-arch] Error 1
    dpkg-buildpackage: failure: debian/rules binary gave error exit status 2
    Packaging Error: Command '/Users/steebono/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us' failed.Exit code: 2
    Error while building project unlockpass (target: Harmattan)
    When executing build step 'Create Debian Package'
    [/CODE]

    It only happens when the *. Pro ​​file add these lines of code:
    [CODE]
    daemonconf.path = /etc/init/apps/
    daemonconf.files = unlockpass.conf
    INSTALLS += daemonconf
    [/CODE]
    while if I put for example it do not give me no error:
    [CODE]
    daemonconf.path = /opt/unlockpass/bin/
    daemonconf.files = unlockpass.conf
    INSTALLS += daemonconf
    [/CODE]


  • Lifetime Qt Champion

    Hi,

    /etc/init/apps is a "system" path that cannot be written by users.

    To create your deb package, you have to create the complete tree in a dedicated folder and use that folder to build your deb archive.

    Hope it helps



  • Thanks to reply :)
    if I write this code:
    [CODE]
    daemonconf.path = / (in the first folder of N9)
    daemonconf.files = unlockpass.conf
    INSTALLS += daemonconf
    [/CODE]
    I can build.. and the "/" folder is a “system” path that cannot be written by users.
    Also /opt/ is a "system" path.. but only with /etc/ not work :)


  • Lifetime Qt Champion

    You shouldn't write in either, the idea is that you build the tree in a custom folder something like:
    myapplication/etc/init/apps
    myapplication/usr/bin
    etc...
    And add the appropriate files to create the archive.

    Then the tools from debian will build the archive to install everything in the right place (etc usr etc...). Otherwise you could be overwriting files in your own system.

    Hope I've been clearer :)



  • Not so much :)
    I do not know how to create a tree in a custom folder something like:
    myapplication/etc/init/apps
    myapplication/usr/bin
    And add the appropriate files to create the archive.


  • Lifetime Qt Champion

    Personally, I use a bash script that creates the folder structure (you can find it the debian documentation) and copy the files at the right place. Then use debian's tool to build the archive.



  • Ok, but you run the script when you run the application, or when you install the *deb file? :)

    EDIT:

    In a bash script for example: how do I copy / paste a file to be put into a system folder?
    Because I need to have root privileges .. and for have them, on the N9, I have to put:
    devel-su
    pass: rootme

    sorry for my english :)

    EDIT 2:
    I tried:
    [CODE]
    #!/bin/bash
    devel-su
    echo "rootme"
    mv /opt/unlockpass/bin/unlockpass.conf /etc/init/apps/
    [/CODE]

    but not work..


  • Lifetime Qt Champion

    You are mixing several separate things. I use a script to automate the various parts to build the deb file.

    As I said before, you have to create a folder to act as a "fake root" and put your various file in there like the would be on your target system.

    For more information search for "create deb package", you'll find several guides and the official debian documentation to help you



  • Thanks for your help.. I tried but do not think I have succeeded, because I did not understand much from the debian documentation..

    I tried all day..

    You could not give me an example where you copy a file in a folder, in the way that would serve to me?
    Maybe with a Qt project, which you could give me via a private message?

    I would be really grateful :)


  • Lifetime Qt Champion

    Something like

    @
    #!/bin/bash
    DEBFILES_DIR=./debfiles <- Folder containing the configuration files for myapp and for building the deb package
    BASE_DIR=../debian
    DEBIAN_DIR=$BASE_DIR/DEBIAN
    BIN_DIR=$BASE_DIR/usr/local/bin
    ETC_DIR=$BASE_DIR/etc

    rm -rf $BASE_DIR

    mkdir -p $DEBIAN_DIR
    mkdir -p $BIN_DIR
    mkdir -p $ETC_DIR/init.d

    cp -a ../myapp_shadow_build/bin/myapp $BIN_DIR/

    cp $DEBFILES_DIR/myapp.init $ETC_DIR/init.d/myapp

    cp $DEBFILES_DIR/control $DEBIAN_DIR/ <- package configuration file
    cp $DEBFILES_DIR/postinst $DEBIAN_DIR/ <- package configuration file
    cp $DEBFILES_DIR/prerm $DEBIAN_DIR/ <- package configuration file

    chmod 0775 $DEBIAN_DIR/control
    chmod 0775 $DEBIAN_DIR/postinst
    chmod 0775 $DEBIAN_DIR/prerm
    dpkg-deb --build ../debian ../mypackage_0.1-amd64.deb <- change the architecture accordingly
    @

    Hope it helps


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.