wok-next view ntop/receipt @ rev 20200
libgnomeprint: add bison 3 patch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 03 17:38:15 2017 +0100 (2017-11-03) |
parents | 9e01bc6321ea |
children | dd145c435e4b |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="ntop"
4 VERSION="4.1.0"
5 CATEGORY="network"
6 SHORT_DESC="Network traffic probe."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.ntop.org/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 TAGS="network"
14 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool \
15 glibc-dev gdbm-dev rrdtool autoconf automake rrdtool-dev wget geoip-dev \
16 libwrap libtool"
17 SPLIT="ntop ntop-dev ntop-man"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 ./autogen.sh --prefix=/usr \
23 --sysconfdir=/etc \
24 --localstatedir=/var/lib \
25 $CONFIGURE_ARGS 2>&1 | grep -v 'grep: libtool:' &&
26 make && make install
27 #~ && make install-data-as
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 case $PACKAGE in
34 ntop)
35 CONFIG_FILES="/etc/ntop"
36 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl \
37 pcre geoip libwrap"
38 mkdir -p $fs/usr/lib/plugins \
39 $fs/usr/share \
40 $fs/var/log/ntop
42 cp -a $install/usr/lib/*.so* $fs/usr/lib
43 cp -a $install/usr/lib/ntop $fs/usr/lib
44 cp -a $install/usr/bin $fs/usr
45 cp -a $install/usr/share/ntop $fs/usr/share
46 chown -R www.www $fs/usr/share/ntop
47 cp -a $install/usr/bin $fs
48 cp -a $install/etc $fs
49 cp -a $install/var $fs
51 # Copy startup script and fix perms
52 cp -a stuff/etc $fs
53 chown root.root $fs/etc/init.d/ntop
54 ;;
55 ntop-dev)
56 CAT="development|Network traffic probe development files."
57 mkdir -p $fs/usr/lib
58 cp -a $install/usr/lib/*.a $fs/usr/lib
59 ;;
60 ntop-man)
61 CAT="development|Network traffic probe man page."
62 mkdir -p $fs/usr/share
63 cp -a $install/usr/share/man $fs/usr/share
64 ;;
65 esac
66 }
68 post_install_ntop()
69 {
70 user=ntop
71 group=ntop
73 if ! grep -q $user: "$1/etc/passwd"; then
74 echo -n "Adding user/group $user..."
75 chroot "$1/" addgroup -S $user
76 chroot "$1/" adduser -S -D -H -G $group $user
77 status
78 fi
80 # Fix perms for files and directories
81 chroot "$1/" chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
83 # Start package daemon if we are on running system
84 [ "$1" ] || /etc/init.d/$PACKAGE start
86 # post_install messges
87 echo -e "\nTo starts $PACKAGE server you can run :\n"
88 echo "/etc/init.d/$PACKAGE start"
89 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
90 }
92 pre_remove_ntop()
93 {
94 [ "$1" ] || /etc/init.d/$PACKAGE stop
95 }
97 post_remove_ntop()
98 {
99 user=ntop
100 group=ntop
102 if ! grep -q $user: "$1/etc/passwd"; then
103 echo -n "Removing user/group $user..."
104 chroot "$1/" delgroup $user
105 chroot "$1/" deluser $user
106 status
107 fi
108 }