wok-next view ntop/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents 642c924029f7
children 5669e8b3be70
line source
1 # SliTaz package receipt v2.
3 PACKAGE="ntop"
4 VERSION="5.0.1"
5 CATEGORY="network"
6 SHORT_DESC="Network traffic probe"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://www.ntop.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 BUILD_DEPENDS="libtool automake autoconf wget subversion libpcap-dev gdbm-dev \
15 pcre-dev rrdtool-dev openssl-dev zlib-dev python-dev geoip-dev"
16 SPLIT="$PACKAGE-dev"
17 COOKOPTS="skip-log-errors"
19 compile_rules() {
20 ./autogen.sh \
21 --prefix=/usr \
22 --sysconfdir=/usr/share \
23 --localstatedir=/var/lib \
24 --disable-snmp \
25 $CONFIGURE_ARGS &&
26 make &&
27 make install-recursive || return 1
29 mkdir -p $install/var/lib/ntop $install/var/lib/ntop/rrd
31 for i in $install/usr/lib/ntop/plugins/*.so; do
32 ln -sf "../../lib$(basename $i)" $i
33 done
35 install -Dm755 $stuff/ntop $install/etc/init.d/ntop
36 mkdir -p $install/var/log/ntop/
37 chown -R root:root $install
38 }
40 genpkg_rules() {
41 case $PACKAGE in
42 ntop)
43 copy @std
44 chown -R www:www $fs/usr/share/ntop/
45 CONFIG_FILES="/etc/ntop/"
46 DEPENDS="gdbm geoip libpcap openssl python rrdtool zlib" # ? libpng16 perl pcre libwrap
47 TAGS="network"
48 ;;
49 ntop-dev)
50 copy @dev
51 ;;
52 esac
53 }
55 post_install_ntop() {
56 user=ntop
57 group=ntop
59 if ! grep -q $user: "$1/etc/passwd"; then
60 chroot "$1/" addgroup -S $user
61 chroot "$1/" adduser -S -D -H -G $group $user
62 fi
64 # Fix perms for files and directories
65 chroot "$1/" chown -R $user.$group /var/lib/ntop /var/log/ntop
67 # Start package daemon if we are on running system
68 [ "$1" ] || /etc/init.d/$PACKAGE start
70 # post_install message
71 [ -n "$quiet" ] || cat <<EOT
73 .---------------------------------------------.
74 | To start ntop server you can run: |
75 | /etc/init.d/ntop start |
76 | |
77 | Or add ntop to RUN_DAEMONS in /etc/rcS.conf |
78 '---------------------------------------------'
79 EOT
80 }
82 pre_remove_ntop() {
83 [ "$1" ] || /etc/init.d/$PACKAGE stop
84 }
86 post_remove_ntop() {
87 user=ntop
88 group=ntop
90 if ! grep -q $user: "$1/etc/passwd"; then
91 chroot "$1/" delgroup $user
92 chroot "$1/" deluser $user
93 fi
94 }