Active Topics

 


Reply
Thread Tools
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#1
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!
 

The Following User Says Thank You to Copernicus For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
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.
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2012-01-16 at 19:46.
 

The Following 2 Users Say Thank You to marxian For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#3
Originally Posted by marxian View Post
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!
 

The Following User Says Thank You to Copernicus For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#4
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.

Last edited by Copernicus; 2012-01-16 at 21:47. Reason: Maybe just needed to clean up my build directory
 
Mike Fila's Avatar
Posts: 412 | Thanked: 480 times | Joined on Feb 2011 @ Bronx, NY
#5
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

Last edited by Mike Fila; 2012-01-16 at 22:00.
 

The Following User Says Thank You to Mike Fila For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#6
Originally Posted by Copernicus View Post
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...
 

The Following 3 Users Say Thank You to Copernicus For This Useful Post:
Posts: 57 | Thanked: 90 times | Joined on Nov 2010 @ Bologna
#7
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

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

Last edited by incrys; 2012-02-03 at 23:04.
 
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#8
Originally Posted by incrys View Post
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.)
 
Posts: 57 | Thanked: 90 times | Joined on Nov 2010 @ Bologna
#9
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
 
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#10
Originally Posted by incrys View Post
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.
 

The Following User Says Thank You to Copernicus For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:25.