Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error on build package *.deb on Qt Creator
Qt 6.11 is out! See what's new in the release blog

Error on build package *.deb on Qt Creator

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 2 Posters 5.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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]

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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 :)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                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..

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    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 :)

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      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

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved