wok-next annotate ntop/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 0ed3f456a542
children
rev   line source
pascal@20179 1 # SliTaz package receipt v2.
erjo@1463 2
erjo@1463 3 PACKAGE="ntop"
al@20879 4 VERSION="5.0.1"
erjo@1463 5 CATEGORY="network"
al@20513 6 SHORT_DESC="Network traffic probe"
erjo@1463 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14999 8 LICENSE="GPL3"
al@20879 9 WEB_SITE="https://www.ntop.org/"
al@20513 10
erjo@11453 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@1463 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
al@21121 13 TARBALL_SHA1="bbb8de893b1d0bb3c20785445ff62c7dbf398d0b"
erjo@1463 14
al@20879 15 BUILD_DEPENDS="libtool automake autoconf wget subversion libpcap-dev gdbm-dev \
al@20879 16 pcre-dev rrdtool-dev openssl-dev zlib-dev python-dev geoip-dev"
al@21020 17 SPLIT="$PACKAGE-dev"
al@21121 18
al@21121 19 CONFIG_FILES_std="/etc/ntop/"
al@21121 20 DEPENDS_std="gdbm geoip libpcap openssl python rrdtool zlib" # ? libpng perl pcre libwrap
al@21121 21 TAGS_std="network"
al@21121 22
al@20879 23 COOKOPTS="skip-log-errors"
erjo@10889 24
al@20513 25 compile_rules() {
al@21121 26 # config nDPI
al@21121 27 cd nDPI
al@21121 28 ./configure --with-pic $CONFIGURE_ARGS
al@21121 29 cd ..
al@21121 30
al@21121 31 export DISTRO="SliTaz"
al@21121 32 export DISTRO_VERSION="Next"
al@20513 33 ./autogen.sh \
al@20879 34 --disable-snmp \
al@20513 35 $CONFIGURE_ARGS &&
al@21121 36 fix libtool &&
al@20534 37 make &&
al@20879 38 make install-recursive || return 1
al@20513 39
al@20879 40 mkdir -p $install/var/lib/ntop $install/var/lib/ntop/rrd
al@20513 41
al@20879 42 for i in $install/usr/lib/ntop/plugins/*.so; do
al@21121 43 cmp -s "../../lib$(basename $i)" $i &&
al@20879 44 ln -sf "../../lib$(basename $i)" $i
al@20879 45 done
al@20879 46
al@21121 47 install -Dm755 $stuff/ntop $install/etc/init.d/ntop
al@21121 48 install -Dm644 $stuff/ntop.conf $install/etc/daemons.conf.d/ntop.conf
al@21121 49
al@20513 50 mkdir -p $install/var/log/ntop/
al@20879 51 chown -R root:root $install
al@21121 52 find $install -type f -exec chmod g-w '{}' \; # 664->644, 775->755
erjo@1463 53 }
erjo@1463 54
al@20513 55 post_install_ntop() {
erjo@10890 56 user=ntop
erjo@10890 57 group=ntop
pankso@12546 58
pascal@18730 59 if ! grep -q $user: "$1/etc/passwd"; then
pascal@18730 60 chroot "$1/" addgroup -S $user
pascal@18730 61 chroot "$1/" adduser -S -D -H -G $group $user
erjo@10889 62 fi
pankso@12546 63
erjo@10889 64 # Fix perms for files and directories
al@20513 65 chroot "$1/" chown -R $user.$group /var/lib/ntop /var/log/ntop
pankso@12546 66
al@20513 67 # Start package daemon if we are on running system
al@21121 68 [ "$1" ] || /etc/init.d/ntop start
pankso@12546 69
al@20513 70 # post_install message
al@20513 71 [ -n "$quiet" ] || cat <<EOT
al@20513 72
al@20513 73 .---------------------------------------------.
al@20513 74 | To start ntop server you can run: |
al@20513 75 | /etc/init.d/ntop start |
al@20513 76 | |
al@20513 77 | Or add ntop to RUN_DAEMONS in /etc/rcS.conf |
al@20513 78 '---------------------------------------------'
al@20513 79 EOT
erjo@10889 80 }
erjo@10888 81
al@20513 82 pre_remove_ntop() {
al@21121 83 [ "$1" ] || /etc/init.d/ntop stop
erjo@10890 84 }
erjo@10889 85
al@20513 86 post_remove_ntop() {
al@20513 87 user=ntop
al@20513 88 group=ntop
erjo@10889 89
pascal@18730 90 if ! grep -q $user: "$1/etc/passwd"; then
al@20513 91 chroot "$1/" delgroup $user
al@20513 92 chroot "$1/" deluser $user
al@20513 93 fi
erjo@10890 94 }