maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Optifying problem (https://talk.maemo.org/showthread.php?t=40124)

timperi 2010-01-11 20:48

Optifying problem
 
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:

Code:

#!/bin/sh
# postinst script for boulderdash
#
# 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)
        ln -s /opt/maemo/usr/bin/boulderdash /usr/bin/
        ln -s /opt/maemo/usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png /usr/share/icons/hicolor/64x64/apps/
        chmod a+x /opt/maemo/usr/bin/boulderdash
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        rm /usr/bin/boulderdash
        rm /usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png
    ;;

    *)
        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#

exit 0


VDVsx 2010-01-11 22:23

Re: Optifying problem
 
Quote:

Originally Posted by timperi (Post 465082)
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:

Code:

#!/bin/sh
# postinst script for boulderdash
#
# 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)
        ln -s /opt/maemo/usr/bin/boulderdash /usr/bin/
        ln -s /opt/maemo/usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png /usr/share/icons/hicolor/64x64/apps/
        chmod a+x /opt/maemo/usr/bin/boulderdash
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        rm /usr/bin/boulderdash
        rm /usr/share/icons/hicolor/64x64/apps/boulderdash_64x64.png
    ;;

    *)
        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#

exit 0


Why are you doing the symbolics links in the postinst script instead of in the rules script ?

timperi 2010-01-12 17:40

Re: Optifying problem
 
Quote:

Originally Posted by VDVsx (Post 465285)
Why are you doing the symbolics links in the postinst script instead of in the rules script ?

Because i don't know any better. Thanks for the tip, I'll look into that rules-script :D

VDVsx 2010-01-12 19:06

Re: Optifying problem
 
Quote:

Originally Posted by timperi (Post 466734)
Because i don't know any better. Thanks for the tip, I'll look into that rules-script :D

If you put the same code in the rules script, it will solve your problem.

If you want to learn a bit more about these scripts, you can find some info here: http://www.debian.org/doc/debian-pol...erscripts.html

egoshin 2010-01-12 19:47

Re: Optifying problem
 
Quote:

Originally Posted by VDVsx (Post 466895)
If you put the same code in the rules script, it will solve your problem.

If you want to learn a bit more about these scripts, you can find some info here: http://www.debian.org/doc/debian-pol...erscripts.html

Which rules script - the reference actually describes only build time rules but not installation?

(Sorry for bother you).

mikkov 2010-01-12 19:52

Re: Optifying problem
 
Quote:

Originally Posted by timperi (Post 465082)
I optified my project, but when i uninstall it with dpkg -r, it leaves behind the symbolic links that i made in the postinst.

how can i remove these automatically during uninstallation?

this is what i have in postinst now:

Sorry, but you're doing it all wrong.

Use maemo-optify. Simplest is to make debian/optify file with "auto" in it. Then run maemo-optify-deb for debs produced with dpkg-buildpackage.

Other option is to install directly to /opt/boulderdash directory

Sasler 2010-01-12 20:10

Re: Optifying problem
 
Quote:

Originally Posted by mikkov (Post 466997)
Sorry, but you're doing it all wrong.

Use maemo-optify. Simplest is to make debian/optify file with "auto" in it. Then run maemo-optify-deb for debs produced with dpkg-buildpackage.

Other option is to install directly to /opt/boulderdash directory

Does maemo-optify work in Windows using MADDE? If not, what would be the best way to optify in Windwos?

mikkov 2010-01-12 20:16

Re: Optifying problem
 
Quote:

Originally Posted by Sasler (Post 467032)
Does maemo-optify work in Windows using MADDE? If not, what would be the best way to optify in Windwos?

I don't know. But if you're sending packages to autobuilder, maemo-optify works there. Testing before uploading hard, if it doesn't work.

Installing directly to /opt is always possible, I assume.

Sasler 2010-01-12 20:20

Re: Optifying problem
 
Quote:

Originally Posted by mikkov (Post 467045)
I don't know. But if you're sending packages to autobuilder, maemo-optify works there. Testing before uploading hard, if it doesn't work.

Yes, I am sending them to autobuilder, but I'm using Maemo Extras Assistant. Do I need to somehow to tell it to optify and how?

Quote:

Originally Posted by mikkov (Post 467045)
Installing directly to /opt is always possible, I assume.

I tried that, but I must have done something wrong, because nothing worked. ;)

mikkov 2010-01-12 20:24

Re: Optifying problem
 
Quote:

Originally Posted by Sasler (Post 467055)
Yes, I am sending them to autobuilder, but I'm using Maemo Extras Assistant. Do I need to somehow to tell it to optify and how?

auto in debian/optify file is the hint for autobuilder.


All times are GMT. The time now is 08:35.

vBulletin® Version 3.8.8