Reply
Thread Tools
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1
Hello
Guy's, can someone share the examples of this two files:
post-install and pre-uninstall ? For the simple .deb file..
Thanks
 
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#2
You mean one of those files:
preinst
postinst
prerm
postrm

They have to have exactly this name, else they will not be executed.
They are simply shel scripts, meraning you can do in them what ever you do in the terminal.
I.e.
Code:
#!/bin/sh
chmod +x /usr/bin/myapp
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
 

The Following User Says Thank You to caco3 For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#3
Originally Posted by caco3 View Post
You mean one of those files:
preinst
postinst
prerm
postrm

They have to have exactly this name, else they will not be executed.
They are simply shel scripts, meraning you can do in them what ever you do in the terminal.
I.e.
Code:
#!/bin/sh
chmod +x /usr/bin/myapp
Hi
Thanks, it's work.. but I have a little problem..
I created postinst file with this stuff for automatic backup:

Code:
#!/bin/sh

mkdir -p /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch && cd /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch
mkdir -p call-ui/style libclockalarm/style libclockwidgets/style liblocationpicker/style libmeego-handwriting-zh/style libmeego-keyboard/style libmeegotouchcore/style libmeegotouchviews/style libswype-keyboard/style meegotouchhome/style sysuid/style
mkdir -p /home/user/MyDocs/.N9QTBackup/usr/share/themes/blanco/meegotouch/sysuid/style
cp -r /usr/share/themes/base/meegotouch/call-ui/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/call-ui
cp -r /usr/share/themes/base/meegotouch/libclockalarm/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libclockalarm
cp -r /usr/share/themes/base/meegotouch/libclockwidgets/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libclockwidgets
cp -r /usr/share/themes/base/meegotouch/liblocationpicker/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/liblocationpicker
cp -r /usr/share/themes/base/meegotouch/libmeego-handwriting-zh/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libmeego-handwriting-zh
cp -r /usr/share/themes/base/meegotouch/libmeego-keyboard/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libmeego-keyboard
cp -r /usr/share/themes/base/meegotouch/libmeegotouchcore/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libmeegotouchcore
cp -r /usr/share/themes/base/meegotouch/libmeegotouchviews/style/*.* /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libmeegotouchviews/style
cp -r /usr/share/themes/base/meegotouch/libswype-keyboard/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/libswype-keyboard
cp -r /usr/share/themes/base/meegotouch/meegotouchhome/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/meegotouchhome
cp -r /usr/share/themes/base/meegotouch/sysuid/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/base/meegotouch/sysuid
cp -r /usr/share/themes/blanco/meegotouch/sysuid/style /home/user/MyDocs/.N9QTBackup/usr/share/themes/blanco/meegotouch/sysuid
mkdir -p /home/user/MyDocs/.N9QTBackup/NoLand
cp -r /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css /home/user/MyDocs/.N9QTBackup/NoLand
cp -r /usr/share/themes/base/meegotouch/meegotouchhome/style/meegotouchhome.css /home/user/MyDocs/.N9QTBackup/NoLand
mkdir -p /home/user/MyDocs/.N9QTBackup/YesLand
cp -r /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css /home/user/MyDocs/.N9QTBackup/YesLand
cd /home/user/MyDocs/.N9QTBackup/YesLand && sed -i -e 's/locked-orientation: "portrait";/locked-orientation: "";/g' sysuid.css
cp -r /usr/share/themes/base/meegotouch/meegotouchhome/style/meegotouchhome.css /home/user/MyDocs/.N9QTBackup/YesLand"
cd /home/user/MyDocs/.N9QTBackup/YesLand && sed -i -e 's/locked-orientation: "portrait";/locked-orientation: "";/g' meegotouchhome.css
mkdir -p /home/user/MyDocs/.N9QTBackup/usr/share/applications
cd /usr/share/applications && cp -r twitter-qml.desktop userguide.desktop morpheus.desktop facebookqml.desktop search.desktop /home/user/MyDocs/.N9QTBackup/usr/share/applications
but something wrong here.. Maybe some command of copy or I don't know.. but with this file I can install my .deb I get "Installation corrupted" or something...
But when I check this folders, I see it's yes copied some files...

Any idea ?
 
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#4
First of all, keep in mind, that those scripts are run as root, so the files also will belong to root. No file in /home/user/ should belong to root, since the user will not be able to remove/modify it!
To correct this, you will have to change the owner and group property of each file:
Code:
chown "user" MYFILE
chgrp "users" MYFILE
Also, since you are creating folders with a relative path, you have to make sure you are in the right directory! Its usually better to use absolute paths.

If you install your pp in the terminal, you should get an error message:
Code:
dpkg -i /path/to/my/app.deb
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
 

The Following User Says Thank You to caco3 For This Useful Post:
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#5
Originally Posted by Schturman View Post
Hi
Thanks, it's work.. but I have a little problem..
I created postinst file with this stuff for automatic backup:

Code:
#!/bin/sh

...

cp -r /usr/share/themes/base/meegotouch/meegotouchhome/style/meegotouchhome.css /home/user/MyDocs/.N9QTBackup/YesLand"

...
but something wrong here.. Maybe some command of copy or I don't know.. but with this file I can install my .deb I get "Installation corrupted" or something...
But when I check this folders, I see it's yes copied some files...

Any idea ?
Seems like you have an extra " in there..
In any case, you need to clean it and add some comments maybe.
 

The Following User Says Thank You to Saturn For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#6
thanks..
It's work, i changed this file with other stuff..
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:47.