wok-current view ntop/receipt @ rev 25786
Bump gvfs to fix issue with open files on android device, patch udev to fix mtp issue on pcmanfm
| author | Stanislas Leduc <shann@slitaz.org> | 
|---|---|
| date | Tue Jul 29 18:05:13 2025 +0000 (3 months ago) | 
| parents | a78610b2eb47 | 
| children | 
 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 LICENSE="GPL3"
     9 TARBALL="$PACKAGE-$VERSION.tar.gz"
    10 WEB_SITE="https://www.ntop.org/"
    11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    12 CONFIG_FILES="/etc/ntop"
    13 TAGS="network"
    15 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl pcre geoip \
    16 libwrap"
    17 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool \
    18 glibc-dev gdbm-dev rrdtool autoconf automake rrdtool-dev wget geoip-dev \
    19 libwrap libtool"
    21 current_version()
    22 {
    23 	wget -O - https://sourceforge.net/projects/$PACKAGE/files/$PACKAGE 2>/dev/null | \
    24 	sed "/$PACKAGE-/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
    25 }
    27 # Rules to configure and make the package.
    28 compile_rules()
    29 {
    30 	cd $src
    31 	./autogen.sh --prefix=/usr	\
    32 		--sysconfdir=/etc \
    33 		--localstatedir=/var/lib \
    34 		$CONFIGURE_ARGS 2>&1 | grep -v 'grep: libtool:' &&
    35 	make && make install
    36 	#~ && make install-data-as
    37 }
    39 # Rules to gen a SliTaz package suitable for Tazpkg.
    40 genpkg_rules()
    41 {
    42 	mkdir -p $fs/usr/lib/plugins \
    43 		$fs/usr/share \
    44 		$fs/var/log/ntop
    46 	cp -a $install/usr/lib/*.so* $fs/usr/lib
    47 	cp -a $install/usr/lib/ntop $fs/usr/lib
    48 	cp -a $install/usr/bin $fs/usr
    49 	cp -a $install/usr/share/ntop $fs/usr/share
    50 	chown -R www.www $fs/usr/share/ntop
    51 	cp -a $install/usr/bin $fs
    52 	cp -a $install/etc $fs
    53 	cp -a $install/var $fs
    55 	# Copy startup script and fix perms
    56 	cp -a stuff/etc $fs
    57 	chown root.root $fs/etc/init.d/ntop
    58 }
    60 post_install()
    61 {
    62 	user=ntop
    63 	group=ntop
    65 	if ! grep -q $user: "$1/etc/passwd"; then
    66 		echo -n "Adding user/group $user..."
    67 		chroot "$1/" addgroup -S $user
    68 		chroot "$1/" adduser -S -D -H -G $group $user
    69 		status
    70 	fi
    72 	# Fix perms for files and directories
    73 	chroot "$1/" chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
    75 	# Start package daemon if we are  on running system
    76 	[ "$1" ] || /etc/init.d/$PACKAGE start
    78 	# post_install messges
    79 	echo -e "\nTo starts $PACKAGE server you can run :\n"
    80 	echo "/etc/init.d/$PACKAGE start"
    81 	echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
    82 }
    84 pre_remove()
    85 {
    86 	[ "$1" ] || /etc/init.d/$PACKAGE stop
    87 }
    89 post_remove()
    90 {
    91         user=ntop
    92         group=ntop
    94 	if ! grep -q $user: "$1/etc/passwd"; then
    95         	echo -n "Removing user/group $user..."
    96                 chroot "$1/" delgroup $user
    97                 chroot "$1/" deluser  $user
    98                 status
    99        	fi
   100 }