Reply
Thread Tools
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#1
Hello,

I have a Qt application which i want to port on maemo.
I tested it on scrachbox and it works decent but i want to install it on N900.

The application contains 2 modules.
-1 GUI created in Qt.
- from the GUI another process is started. This process is doing the background work. About this process, it is quite big around 10M and I have it compiled for ARMEL.

When I'm creating the package using this command:
dpkg-buildpackage -sa -rfakeroot
my background process is not included.

How should i add this process to the package and where should it be installed?

Thanks
Problem solved by calvin_42.
One more question:

The background process is installed now in the /opt/my-app/backgroundp.

Mainly at one point it is started and it must create a text file.
The file is read after that by the Qt GUI when the background process is finished.

I think my process does not have the rights to create a new file in /opt/my-app/ directory.

How can i change this from the installation package?

Thanks
Problem solved by krk969:

One more question about packing
in the data folder i have a subdirectory with a lot of files inside?

They should all be copied on the phone.
Is it possible to make one install tag in the src.pro and copy everything from data/subdir/ in one go or i have to make a tag for every file i want to be copied on the phone?

Last edited by flgor; 2010-02-25 at 15:05.
 
calvin_42's Avatar
Posts: 286 | Thanked: 219 times | Joined on Feb 2010 @ France
#2
Hello.

Originally Posted by flgor View Post
How should i add this process to the package
I has to be set in your .pro file.

Section INSTALLS

ex :

Code:
INSTALLS += backgroundprocess

backgroundprocess.path = $$PREFIX/opt/yourprog/
backgroundprocess.files += data/scripts/yourprog
You'll find more information using the search function or google.

Originally Posted by flgor View Post
and where should it be installed?
For example in the same directory that your GUI app, ie /opt/yourprog/.
 

The Following 2 Users Say Thank You to calvin_42 For This Useful Post:
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#3
Thanks for the help.

One more question.

The background process is installed now in the /opt/my-app/backgroundp.

Mainly at one point it is started and it must create a text file.
The file is read after that by the Qt GUI when the background process is finished.

I think my process does not have the rights to create a new file in /opt/my-app/ directory.

How can i change this from the installation package?


Thanks, Flgor.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#4
Originally Posted by flgor View Post
....
I think my process does not have the rights to create a new file in /opt/my-app/ directory.
How can i change this from the installation package?
there are post installation scripts ( postinst ) in the debian folder. They will exist as postinst.ex, make sure you remove the extension .ex.
insert a command like this in it

chown -R user <package_path>

that should give the ownership of the package folder to the "user" user that will be exectuing the process.
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 

The Following User Says Thank You to krk969 For This Useful Post:
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#5
Originally Posted by krk969 View Post
there are post installation scripts ( postinst ) in the debian folder. They will exist as postinst.ex, make sure you remove the extension .ex.
insert a command like this in it

chown -R user <package_path>

that should give the ownership of the package folder to the "user" user that will be exectuing the process.
Can you explain a little more clear how to create the postinstall file.
I removed the .ex and i added just before the end of the file your command:
Code:
#DEBHELPER#
chown -R user /home/opt/myapp

exit 0
if i run the command on the phone using sudo gain root and run again my process everything works fine

but when i install the package i still have the same problem.

should i add in the install rules the postinstall directory?


Thanks, flgor.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#6
Originally Posted by flgor View Post
Can you explain a little more clear how to create the postinstall file.
I removed the .ex and i added just before the end of the file your command:
Thanks, flgor.
can you attach your source/postinstall script please.
Did you modify the postinst file in your debian folder ?
Did you then install the package on your phone
using dpkg -i <package>
and then run your app and it didnt work ?
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 
calvin_42's Avatar
Posts: 286 | Thanked: 219 times | Joined on Feb 2010 @ France
#7
Originally Posted by flgor View Post
Code:
#DEBHELPER#
chown -R user /home/opt/myapp

exit 0
Why /home/opt/myapp ? Shouldn't it be /opt/myapp instead ?

See :

Originally Posted by flgor View Post
I think my process does not have the rights to create a new file in /opt/my-app/ directory.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#8
Originally Posted by calvin_42 View Post
Why /home/opt/myapp ? Shouldn't it be /opt/myapp instead ?
See :
/opt is a link to /home/opt
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 
calvin_42's Avatar
Posts: 286 | Thanked: 219 times | Joined on Feb 2010 @ France
#9
That's right, my bad!
 
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#10
This is the postinst file from debian folder


Code:
#!/bin/sh
# postinst script for myapp
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    configure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

chown -R user /home/opt/myapp

exit 0
It does not work.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:36.