wok view ntop/receipt @ rev 11480
libgnome: add openssl to depends; add intltool to build_depends
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sun Dec 18 03:01:59 2011 +0100 (2011-12-18) |
parents | 956ac96b4a1b |
children | 53e9551e9325 |
line source
1 # SliTaz package receipt.
3 PACKAGE="ntop"
4 VERSION="4.1.0"
5 CATEGORY="network"
6 SHORT_DESC="Network traffic probe."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
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 (cookutils only)
51 if [ -x /usr/bin/cook ]; then
52 for i in $(cd $WOK; ls -d ntop-*)
53 do
54 cook $i
55 done
56 fi
57 }
59 post_install()
60 {
61 user=ntop
62 group=ntop
64 if ! grep -q $user: $1/etc/passwd; then
65 echo -n "Adding user/group $user..."
66 chroot $1/ addgroup -S $user
67 chroot $1/ adduser -S -D -H -G $group $user
68 status
69 fi
71 # Fix perms for files and directories
72 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
74 # Start package daemon if we are on running system
75 [ -z $1 ] && /etc/init.d/$PACKAGE start
77 # post_install messges
78 echo -e "\nTo starts $PACKAGE server you can run :\n"
79 echo "/etc/init.d/$PACKAGE start"
80 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
81 }
83 pre_remove()
84 {
85 [ -z $1 ] && /etc/init.d/$PACKAGE stop
86 }
88 post_remove()
89 {
90 user=ntop
91 group=ntop
93 if ! grep -q $user: $1/etc/passwd; then
94 echo -n "Removing user/group $user..."
95 chroot $1/ delgroup $user
96 chroot $1/ deluser $user
97 status
98 fi
99 }