wok-4.x annotate ntop/receipt @ rev 11377

nfs-utils: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Dec 09 12:31:03 2011 +0100 (2011-12-09)
parents f8f2b572363d
children 956ac96b4a1b
rev   line source
erjo@1463 1 # SliTaz package receipt.
erjo@1463 2
erjo@1463 3 PACKAGE="ntop"
erjo@10889 4 VERSION="4.0.3"
erjo@1463 5 CATEGORY="network"
erjo@1463 6 SHORT_DESC="Network traffic probe."
erjo@1463 7 MAINTAINER="pascal.bellard@slitaz.org"
erjo@10889 8 TARBALL="$PACKAGE-$VERSION.tgz"
erjo@1463 9 WEB_SITE="http://www.ntop.org/"
erjo@1463 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
erjo@1463 11 CONFIG_FILES="/etc/ntop"
jozee@4969 12 TAGS="network"
erjo@1463 13
erjo@10889 14 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl pcre geoip"
erjo@10889 15 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool glibc-dev gdbm-dev rrdtool \
erjo@10889 16 autoconf automake rrdtool-dev wget geoip-dev "
erjo@10889 17
erjo@1463 18 # Rules to configure and make the package.
erjo@1463 19 compile_rules()
erjo@1463 20 {
erjo@1463 21 cd $src
erjo@10889 22 ./autogen.sh --prefix=/usr \
erjo@10889 23 --sysconfdir=/etc \
erjo@10890 24 --localstatedir=/var/lib $CONFIGURE_ARGS &&
erjo@1463 25 make &&
erjo@10889 26 make DESTDIR=$PWD/_pkg install
erjo@10889 27 #~ && make install-data-as
erjo@1463 28 }
erjo@1463 29
erjo@1463 30 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@1463 31 genpkg_rules()
erjo@1463 32 {
erjo@10890 33 mkdir -p $fs/usr/lib/plugins \
erjo@10890 34 $fs/usr/share \
erjo@10890 35 $fs/var/log/ntop
erjo@10890 36
erjo@1463 37 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
erjo@1463 38 cp -a $_pkg/usr/lib/ntop $fs/usr/lib
erjo@1463 39 cp -a $_pkg/usr/bin $fs/usr
erjo@1463 40 cp -a $_pkg/usr/share/ntop $fs/usr/share
erjo@10890 41 chown -R www.www $fs/usr/share/ntop
erjo@1463 42 cp -a $_pkg/usr/bin $fs
erjo@1463 43 cp -a $_pkg/etc $fs
erjo@1463 44 cp -a $_pkg/var $fs
erjo@1463 45
erjo@1463 46 # Copy startup script and fix perms
erjo@1463 47 cp -a stuff/etc $fs
erjo@1463 48 chown root.root $fs/etc/init.d/ntop
erjo@10889 49
erjo@1463 50 # Package all ntop pkgs
erjo@1463 51 for i in $(cd $WOK; ls -d ntop-*)
erjo@1463 52 do
erjo@10889 53 cook $i
erjo@1463 54 done
erjo@1463 55 }
erjo@1463 56
erjo@10889 57 post_install()
erjo@10889 58 {
erjo@10890 59 user=ntop
erjo@10890 60 group=ntop
erjo@10889 61
erjo@10889 62 if ! grep -q $user: $1/etc/passwd; then
erjo@10889 63 echo -n "Adding user/group $user..."
erjo@10889 64 chroot $1/ addgroup -S $user
erjo@10889 65 chroot $1/ adduser -S -D -H -G $group $user
erjo@10889 66 status
erjo@10889 67 fi
erjo@10889 68
erjo@10889 69 # Fix perms for files and directories
erjo@10890 70 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
erjo@10889 71
erjo@10890 72 # Start package daemon if we are on running system
erjo@10889 73 [ -z $1 ] && /etc/init.d/$PACKAGE start
erjo@10889 74
erjo@10889 75 # post_install messges
erjo@10889 76 echo -e "\nTo starts $PACKAGE server you can run :\n"
erjo@10889 77 echo "/etc/init.d/$PACKAGE start"
erjo@10889 78 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
erjo@10889 79 }
erjo@10888 80
erjo@10890 81 pre_remove()
erjo@10890 82 {
erjo@10890 83 [ -z $1 ] && /etc/init.d/$PACKAGE stop
erjo@10890 84 }
erjo@10889 85
erjo@10890 86 post_remove()
erjo@10890 87 {
erjo@10890 88 user=ntop
erjo@10890 89 group=ntop
erjo@10889 90
erjo@10890 91 if ! grep -q $user: $1/etc/passwd; then
erjo@10890 92 echo -n "Removing user/group $user..."
erjo@10890 93 chroot $1/ delgroup $user
erjo@10890 94 chroot $1/ deluser $user
erjo@10890 95 status
erjo@10890 96 fi
erjo@10890 97 }