maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Alternative ways of creating a debian source package in Qt Creator (https://talk.maemo.org/showthread.php?t=81649)

Copernicus 2012-01-16 19:23

Alternative ways of creating a debian source package in Qt Creator
 
I've been fighting with Qt Creator for two weeks now, trying to make the "publishing wizard" construct a debian source package for me. I've tried using the SDK on both OS X and Linux, and used both my own projects and some of the example projects, and every time I get the same error:

Code:

debian/rules clean
Can't exec "debian/rules": Permission denied at /Users/john/QtSDK/Maemo/4.6.2/madbin/dpkg-buildpackage line 474.
dpkg-buildpackage: failure: debian/rules clean failed with unknown exit code -1

Error: dpkg-buildpackage did not succeed.
Package creation failed.

I give up. I'm guessing I should be able to do it all by hand, using something like the process described in the Packaging Qt Creator Apps wiki page. However, I can see that the wizard in Qt Creator 2.4 is making a lot of different choices than those made in the wiki page; the paths are all different, it doesn't look like optification is needed at all (no binaries or links appear to be going into the /usr directory so far as I can see, everything is instead under /opt already), and the debian rules file is fairly different.

I guess what I'd really like to ask is whether there are folks out there packaging products using the current Qt SDK. Does the wizard work for you, and if not, what practices do you use for packaging up apps for submission to extras?

Thanks in advance!

marxian 2012-01-16 19:42

Re: Alternative ways of creating a debian source package in Qt Creator
 
I added a build step by following the instructions from here: http://qt-funk.blogspot.com/2011/02/...le-source.html

You also need to make some changes to the rules file, else it will fail in the autobuilder.

Add these two lines using a text editor (make sure tabs are used for the indents, not spaces).

Code:

# Add here commands to compile the package.
qmake
$(MAKE)

Comment out the $(MAKE) clean here:

Code:


# Add here commands to clean up after the build process.
#$(MAKE) clean

Once you have done this, just build the project using CTRL+B and submit the resulting source tarball and .changes/.dsc files to the autobuilder.

P.S. I get the same permissions problem when using the wizard.

Copernicus 2012-01-16 19:53

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by marxian (Post 1151467)
I added a build step by following the instructions from here: http://qt-funk.blogspot.com/2011/02/...le-source.html

Thanks! I gave that a shot, and it did generate files for me; however, I poked around inside the .tar.gz file, and it only contained the object files, not the actual source code... That can't be right. I'll have to try again and make sure I didn't mess something up. :)

I'll go ahead and make the changes to my rules file, too.

Thanks again!

Copernicus 2012-01-16 21:03

Re: Alternative ways of creating a debian source package in Qt Creator
 
Ok, I've messed around a bit, and I just can't figure out how to get qt-funk's build command to actually place source code into the tarball; it apparently has to run in the "build" directory, and only object files exist there. I'm pretty sure the Extras system wants the actual source code, right? It looks like I'll have to do something quite different to create a source package...

Update: Ok, blew away my build directory and started completely fresh build. Now, the tarball just has a .deb file inside it, none of the object files from before. I still don't understand fully what is going on here, but I'm guessing I just needed to clean things up from my previous failed attempts.

Anyway, I'll push this into Extras-devel, and start on the next level of error messages. :)

Mike Fila 2012-01-16 21:54

Re: Alternative ways of creating a debian source package in Qt Creator
 
As I am not a developer this may or may not help. The auto builder needs 3 files tar.gz (executable file(s), icons in the folder structure it needs to be installed in), .changes and .dsc file.

It is simple enough to go into another package that is similar to yours to see what has actually been submitted to the auto builder.

package search
http://maemo.org/packages/

example of cute tube qml package "source files"
http://maemo.org/packages/source/vie...qmltube/1.1.1/

btw it took me a month to figure out how to package icons soo... If your interested I used py to deb in the end on my n900

Copernicus 2012-01-16 22:34

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by Copernicus (Post 1151517)
I still don't understand fully what is going on here, but I'm guessing I just needed to clean things up from my previous failed attempts.

Nope, that didn't do it. I uploaded that package to the extras-devel autobuilder, and yeah, there was nothing in it to build.

So, I tried this: I made a full copy of the project source directory into <projectname>-0.1.0, then copied the debian directory from the build directory into that, and ran dpkg-buildpackage on that directory. And that seems to have worked! It created a humongous tarball with tons of unnecessary stuff in it, but I went ahead and uploaded it, and for goodness sakes it seems to have built correctly!

Amazingly enough, I now have an app on its way to extras-devel... :)

incrys 2012-02-03 22:47

Re: Alternative ways of creating a debian source package in Qt Creator
 
Hi, i have a problem...
I'm wrote a application for maemo5 with qt creator 2.4.1, sdk 1.2, but when i used a wizard to upload packages to extras-testing (Build→publish project), the output is:
Code:

debian/rules clean
Can't exec "debian/rules": Permission denied at /home/utente/QtSDK/Maemo/4.6.2/madbin/dpkg-buildpackage line 474.
dpkg-buildpackage: failure: debian/rules clean failed with unknown exit code -1

Error: dpkg-buildpackage did not succeed.

My rules file have:
-rwxr-xr-x 1 utente utente 1969 2012-01-28 18:28 rules
so it has execute permission...

I followed the directions of Marxian, but the output don't change...
Can someone help me?
Thanks to anyone who wants to give me a hand, sorry for my bad english, but I'm italian :D

P.s. this is the structure of my source folder:

-/home/user/Source_folder
|
|- qt_packages/
| |
| |- debian_frematle/
| |
| |- changelog
| compat
| control
| copyright
| postinst
| README
| rules
|
|- script/ (created by me)
|
|- icon64.png
deployment.pri
icon80.png
img.qrc
icon.desktop
main.cpp
icon_harmattan.desktop
mainwindow.cpp
app.pro
mainwindow.h
app.pro.user
mainwindow.ui
icon.svg

Copernicus 2012-02-03 23:17

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by incrys (Post 1160166)
when i used a wizard to upload packages to extras-testing (Build→publish project), the output is:
Code:

debian/rules clean
Can't exec "debian/rules": Permission denied at /home/utente/QtSDK/Maemo/4.6.2/madbin/dpkg-buildpackage line 474.
dpkg-buildpackage: failure: debian/rules clean failed with unknown exit code -1

Error: dpkg-buildpackage did not succeed.


Yup, that is exactly the problem I was having. I've gotten some info from another sufferer on the Qt discussion boards (Michael Zanetti) -- it turns out that Qt places a copy of the code it is going to package in the directory "/tmp/qtc_packaging", but somehow forgets to set the permissions appropriately when it does so. He filed a bug report, and it is working its way through the Qt system; here's a link to it:

https://bugreports.qt-project.org/br...REATORBUG-6866

There are a couple of work-arounds for now; you can use the system I've described above (which I'm still using for my app), or you can try Michael's approach -- he slips in and changes the permission on the file while the build is running, by starting the following script right before he starts the wizard:

Code:

while [ true ]; do chmod +x /tmp/qtc_packaging/projectname/debian/rules; done
(Here's a link to the Qt discussion thread for more info.)

incrys 2012-02-04 10:04

Re: Alternative ways of creating a debian source package in Qt Creator
 
But the /tmp/ directory is created on source directory (or in the build directory) by wizard and after is remove?
Sorry but I don't understand when I run
Code:

while [ true ]; do chmod +x /tmp/qtc_packaging/projectname/debian/rules; done
P.s. Also I would use the method described above, but does not work for me :( :confused:

Copernicus 2012-02-04 17:44

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by incrys (Post 1160312)
But the /tmp/ directory is created on source directory (or in the build directory) by wizard and after is remove?

Yeah, exactly; what Michael's script does is attempt to make the "rules" file executable over and over and over and over again. He starts running the script in a shell, before the file is created, so it ends up failing to even find the file over and over and over, and while that is going on, he then starts the wizard running. At some point, the wizard actually creates the /tmp/qtc_packaging directory and copies the files over to it, at which point Michael's script can now find the file and makes it executable over and over and over and over again. After a while, the wizard gets around to running the rules script, creates the debian package, and deletes the directory. And after that, Michael's script once again fails to find the rules file over and over and over and over again. After that, he kills the script.

It's a brute-force kind of method, but it works.


What I'm doing is I'm trying to mimic what the wizard does by hand:

Step one: I build my app and use the SDK's "Build Debian Package and Install to Maemo5 Device" option to install it onto my phone.

Step two: I make a copy of my source directory.

Step three: I put a copy of the "debian" directory that was created in step one (which I find in "projectname-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release") into my copied source directory.

Step four: I make the two changes to the debian/rules file that Marxian described above (uncommenting qmake and $(MAKE) under the "build-stamp:" target, and commenting out the $(MAKE) clean line under the "clean:" target).

Step five: I use the technique described in this web page to have the Qt SDK set up a call to "dpkg-buildpackage" against my copied source directory. (The web page runs dpkg-buildpackage directly against the build directory, but that didn't work for me -- I put the name of my copied source directory in where he's using "$BUILDDIR".)

Step six: I have Qt do another build of my project, including the new custom step.

And poof, the desired debian package emerges! :)

Ok, yeah, that's not an easy process at all, and probably isn't the most efficient way to do it, but it works for now. Ultimately, the Qt guys should eventually fix this bug, and the wizard will go back to making life easier for everybody. :)

incrys 2012-02-05 00:19

Re: Alternative ways of creating a debian source package in Qt Creator
 
First of all thanks for the help.
I spent a pair of hours working on the project, following your pattern I could (I honestly do not know how) to get the three files needed to upload (.tar.gz, .changes and .dsc), but I can not try because extras assistant is offline.
For the moment I can say that I was not able to use the wizard to complete the upload .. If you will go wrong, go back to the old version.
I will try tomorrow, Wish me good luck :D

Copernicus 2012-02-05 01:21

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by incrys (Post 1160636)
I will try tomorrow, Wish me good luck :D

Good luck! :)

It's true, this Debian packaging system seems more complex than it really needs to be (or, perhaps, it just isn't described well enough anywhere). Honestly, you can get it to work with enough effort, it just takes a lot of time invested to figure out what it is trying to do...

incrys 2012-02-06 00:27

Re: Alternative ways of creating a debian source package in Qt Creator
 
Ok, now my new package is on extras...
The problem is, when I install my package by repository, the output is:
E: handler silently failed
Why? :confused:

Thanks for everything really :D
P.s. I have upload the 3 file with maemo extras assistant

Copernicus 2012-02-06 01:55

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by incrys (Post 1161045)
Ok, now my new package is on extras...

Cool! Good to hear that!

Quote:

The problem is, when I install my package by repository, the output is:
E: handler silently failed
Ah, there's always something more to do, otherwise coding wouldn't be any fun. :) I haven't heard of this particular error before, so I won't be of much help here. Give us an update when you solve it!

sixwheeledbeast 2012-10-04 09:32

Re: Alternative ways of creating a debian source package in Qt Creator
 
Quote:

Originally Posted by Copernicus (Post 1151474)
Thanks! I gave that a shot, and it did generate files for me; however, I poked around inside the .tar.gz file, and it only contained the object files, not the actual source code...

Same issue here.

I copied the debian file created by the debug build to the main directory, then pointed the working directory of the "Qt Funk Custom Step" to this directory.

The tar.gz now contains the full source and amazingly I have a appilcation execpted by autobuilder. :)

Thanks for the help Copernicus.


All times are GMT. The time now is 16:17.

vBulletin® Version 3.8.8