wok view ntop/receipt @ rev 11425

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