wok-current annotate connman/receipt @ rev 15644
connman: fail safe post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Dec 10 13:11:40 2013 +0000 (2013-12-10) |
parents | bfdfb5b999b5 |
children | e585bcc8453e |
rev | line source |
---|---|
slaxemulator@9315 | 1 # SliTaz package receipt. |
slaxemulator@9315 | 2 |
slaxemulator@9315 | 3 PACKAGE="connman" |
domcox@15382 | 4 VERSION="1.19" |
slaxemulator@9315 | 5 CATEGORY="network" |
slaxemulator@9315 | 6 SHORT_DESC="Daemon for managing internet connections" |
slaxemulator@9315 | 7 MAINTAINER="slaxemulator@gmail.com" |
domcox@15384 | 8 LICENSE="GPL2" |
domcox@14329 | 9 TARBALL="$PACKAGE-$VERSION.tar.xz" |
domcox@14329 | 10 WEB_SITE="http://connman.net/" |
domcox@14329 | 11 WGET_URL="http://linux-kernel.uio.no/pub/linux/network/$PACKAGE/$TARBALL" |
domcox@14329 | 12 |
domcox@15384 | 13 DEPENDS="glib dbus iptables gnutls libnl libgcrypt udev wpa_supplicant |
domcox@15384 | 14 dbus-helper" |
domcox@15384 | 15 BUILD_DEPENDS="glib-dev dbus-dev iptables-dev iptables gnutls-dev libnl-dev |
domcox@14383 | 16 openconnect udev-dev wpa_supplicant readline-dev ncursesw-dev openvpn |
domcox@14383 | 17 bluez-dev ppp-dev" |
domcox@14383 | 18 SUGGESTED="xl2tpd pptpclient" |
slaxemulator@9315 | 19 |
slaxemulator@9315 | 20 # Rules to configure and make the package. |
slaxemulator@9315 | 21 compile_rules() |
slaxemulator@9315 | 22 { |
domcox@14329 | 23 # add dependency on libncurses.so, |
domcox@14329 | 24 sed -i 's/-lreadline/-lreadline -lncurses/' Makefile.in |
slaxemulator@9315 | 25 cd $src |
slaxemulator@9315 | 26 ./configure \ |
slaxemulator@9315 | 27 --prefix=/usr \ |
slaxemulator@9315 | 28 --sysconfdir=/etc \ |
slaxemulator@9315 | 29 --localstatedir=/var \ |
slaxemulator@9315 | 30 --infodir=/usr/share/info \ |
slaxemulator@9315 | 31 --mandir=/usr/share/man \ |
slaxemulator@9315 | 32 --disable-gtk-doc \ |
domcox@14329 | 33 --disable-neard \ |
domcox@14329 | 34 --enable-threads \ |
domcox@14383 | 35 --enable-polkit \ |
slaxemulator@9315 | 36 --enable-openconnect \ |
domcox@14329 | 37 --enable-vpnc \ |
domcox@14329 | 38 --enable-openvpn \ |
slaxemulator@9315 | 39 --enable-client \ |
domcox@14383 | 40 --enable-test \ |
slaxemulator@9315 | 41 $CONFIGURE_ARGS && |
pascal@12633 | 42 make && make DESTDIR=$DESTDIR install |
slaxemulator@9315 | 43 } |
slaxemulator@9315 | 44 |
slaxemulator@9315 | 45 # Rules to gen a SliTaz package suitable for Tazpkg. |
slaxemulator@9315 | 46 genpkg_rules() |
slaxemulator@9315 | 47 { |
slaxemulator@9315 | 48 # dbus conf |
slaxemulator@9315 | 49 mkdir -p $fs/etc |
domcox@14329 | 50 cp -a $install/etc/dbus-1 $fs/etc |
slaxemulator@9315 | 51 # conman exec |
domcox@14329 | 52 mkdir -p $fs/usr |
domcox@14329 | 53 cp -a $install/usr/sbin $fs/usr |
domcox@14329 | 54 # libs |
domcox@14329 | 55 mkdir -p $fs/usr/lib/connman/plugins-vpn |
domcox@14329 | 56 cp -a $install/usr/lib/connman/plugins-vpn/*.so \ |
domcox@14329 | 57 $fs/usr/lib/connman/plugins-vpn |
domcox@14329 | 58 # vpn scripts |
domcox@14329 | 59 mkdir -p $fs/usr/lib/connman/scripts |
domcox@14329 | 60 cp -a $install/usr/lib/connman/scripts $fs/usr/lib/connman |
domcox@14329 | 61 # init script |
domcox@14329 | 62 cp -a $stuff/etc $fs |
slaxemulator@9315 | 63 } |
slaxemulator@9315 | 64 |
domcox@14329 | 65 # Pre and post remove commands for Tazpkg |
domcox@14329 | 66 post_install() |
domcox@14329 | 67 { |
domcox@14329 | 68 local root=$1 |
pascal@15644 | 69 if ! grep -qs ^CONNMAND_OPTIONS $root/etc/daemons.conf; then |
domcox@14329 | 70 echo '# Connman daemon options.' >> $root/etc/daemons.conf |
domcox@14329 | 71 echo 'CONNMAND_OPTIONS=""' >> $root/etc/daemons.conf |
domcox@14329 | 72 echo '' >> $root/etc/daemons.conf |
domcox@14329 | 73 fi |
pascal@15644 | 74 if [ -z "$root" -a -s /etc/network.conf ]; then |
domcox@14383 | 75 /etc/init.d/connman start || /etc/init.d/connman restart |
domcox@14329 | 76 fi |
domcox@14329 | 77 } |
domcox@14329 | 78 |
domcox@14329 | 79 pre_remove() |
domcox@14329 | 80 { |
domcox@14329 | 81 if [ -z "$1" ]; then |
domcox@14383 | 82 /etc/init.d/connman stop |
domcox@14329 | 83 fi |
domcox@14329 | 84 } |