wok diff ntop/receipt @ rev 11084
cloudvpn: Fixed WEB_SITE and WGET_URL.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Mon Oct 17 02:11:40 2011 +0000 (2011-10-17) |
parents | f8f2b572363d |
children | 956ac96b4a1b |
line diff
1.1 --- a/ntop/receipt Tue Jul 05 01:19:06 2011 +0200 1.2 +++ b/ntop/receipt Mon Oct 17 02:11:40 2011 +0000 1.3 @@ -21,7 +21,7 @@ 1.4 cd $src 1.5 ./autogen.sh --prefix=/usr \ 1.6 --sysconfdir=/etc \ 1.7 - --localstatedir=/var $CONFIGURE_ARGS && 1.8 + --localstatedir=/var/lib $CONFIGURE_ARGS && 1.9 make && 1.10 make DESTDIR=$PWD/_pkg install 1.11 #~ && make install-data-as 1.12 @@ -30,19 +30,19 @@ 1.13 # Rules to gen a SliTaz package suitable for Tazpkg. 1.14 genpkg_rules() 1.15 { 1.16 - mkdir -p $fs/usr/lib/plugins $fs/usr/share 1.17 + mkdir -p $fs/usr/lib/plugins \ 1.18 + $fs/usr/share \ 1.19 + $fs/var/log/ntop 1.20 + 1.21 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib 1.22 cp -a $_pkg/usr/lib/ntop $fs/usr/lib 1.23 cp -a $_pkg/usr/bin $fs/usr 1.24 cp -a $_pkg/usr/share/ntop $fs/usr/share 1.25 - chown -R 80.80 $fs/usr/share/ntop 1.26 + chown -R www.www $fs/usr/share/ntop 1.27 cp -a $_pkg/usr/bin $fs 1.28 cp -a $_pkg/etc $fs 1.29 cp -a $_pkg/var $fs 1.30 1.31 - # fix perms for /var/ntop 1.32 - chown nobody.nogroup $fs/var/ntop 1.33 - 1.34 # Copy startup script and fix perms 1.35 cp -a stuff/etc $fs 1.36 chown root.root $fs/etc/init.d/ntop 1.37 @@ -56,8 +56,8 @@ 1.38 1.39 post_install() 1.40 { 1.41 - $user=ntop 1.42 - $group=ntop 1.43 + user=ntop 1.44 + group=ntop 1.45 1.46 if ! grep -q $user: $1/etc/passwd; then 1.47 echo -n "Adding user/group $user..." 1.48 @@ -67,9 +67,9 @@ 1.49 fi 1.50 1.51 # Fix perms for files and directories 1.52 - chroot $1/ chown -R ${user}.${group} /var/ntop 1.53 + chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop 1.54 1.55 - # Start Nagios daemon if we are on running system 1.56 + # Start package daemon if we are on running system 1.57 [ -z $1 ] && /etc/init.d/$PACKAGE start 1.58 1.59 # post_install messges 1.60 @@ -78,5 +78,20 @@ 1.61 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" 1.62 } 1.63 1.64 +pre_remove() 1.65 +{ 1.66 + [ -z $1 ] && /etc/init.d/$PACKAGE stop 1.67 +} 1.68 1.69 +post_remove() 1.70 +{ 1.71 + user=ntop 1.72 + group=ntop 1.73 1.74 + if ! grep -q $user: $1/etc/passwd; then 1.75 + echo -n "Removing user/group $user..." 1.76 + chroot $1/ delgroup $user 1.77 + chroot $1/ deluser $user 1.78 + status 1.79 + fi 1.80 +}