wok-6.x annotate ntop/receipt @ rev 11689

ntop: update bdep
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 18 17:18:01 2012 +0100 (2012-02-18)
parents 53e9551e9325
children 38169ce50380
rev   line source
erjo@1463 1 # SliTaz package receipt.
erjo@1463 2
erjo@1463 3 PACKAGE="ntop"
erjo@11453 4 VERSION="4.1.0"
erjo@1463 5 CATEGORY="network"
erjo@1463 6 SHORT_DESC="Network traffic probe."
erjo@1463 7 MAINTAINER="pascal.bellard@slitaz.org"
erjo@11453 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
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 \
pascal@11689 16 autoconf automake rrdtool-dev wget geoip-dev libwrap"
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@1463 49 }
erjo@1463 50
erjo@10889 51 post_install()
erjo@10889 52 {
erjo@10890 53 user=ntop
erjo@10890 54 group=ntop
erjo@10889 55
erjo@10889 56 if ! grep -q $user: $1/etc/passwd; then
erjo@10889 57 echo -n "Adding user/group $user..."
erjo@10889 58 chroot $1/ addgroup -S $user
erjo@10889 59 chroot $1/ adduser -S -D -H -G $group $user
erjo@10889 60 status
erjo@10889 61 fi
erjo@10889 62
erjo@10889 63 # Fix perms for files and directories
erjo@10890 64 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
erjo@10889 65
erjo@10890 66 # Start package daemon if we are on running system
erjo@10889 67 [ -z $1 ] && /etc/init.d/$PACKAGE start
erjo@10889 68
erjo@10889 69 # post_install messges
erjo@10889 70 echo -e "\nTo starts $PACKAGE server you can run :\n"
erjo@10889 71 echo "/etc/init.d/$PACKAGE start"
erjo@10889 72 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
erjo@10889 73 }
erjo@10888 74
erjo@10890 75 pre_remove()
erjo@10890 76 {
erjo@10890 77 [ -z $1 ] && /etc/init.d/$PACKAGE stop
erjo@10890 78 }
erjo@10889 79
erjo@10890 80 post_remove()
erjo@10890 81 {
erjo@10890 82 user=ntop
erjo@10890 83 group=ntop
erjo@10889 84
erjo@10890 85 if ! grep -q $user: $1/etc/passwd; then
erjo@10890 86 echo -n "Removing user/group $user..."
erjo@10890 87 chroot $1/ delgroup $user
erjo@10890 88 chroot $1/ deluser $user
erjo@10890 89 status
erjo@10890 90 fi
erjo@10890 91 }