wok-current annotate ntop/receipt @ rev 25700

Patch glibc CVE-2024-2961 again (wrong encode char on patch)
author Stanislas Leduc <shann@slitaz.org>
date Thu Apr 18 21:24:55 2024 +0000 (7 months ago)
parents a78610b2eb47
children
rev   line source
erjo@1463 1 # SliTaz package receipt.
erjo@1463 2
erjo@1463 3 PACKAGE="ntop"
erjo@11453 4 VERSION="4.1.0"
erjo@1463 5 CATEGORY="network"
erjo@1463 6 SHORT_DESC="Network traffic probe."
erjo@1463 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14999 8 LICENSE="GPL3"
erjo@11453 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@20669 10 WEB_SITE="https://www.ntop.org/"
erjo@1463 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
erjo@1463 12 CONFIG_FILES="/etc/ntop"
jozee@4969 13 TAGS="network"
erjo@1463 14
pascal@17482 15 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl pcre geoip \
pankso@12546 16 libwrap"
pankso@12546 17 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool \
pankso@12546 18 glibc-dev gdbm-dev rrdtool autoconf automake rrdtool-dev wget geoip-dev \
pankso@12546 19 libwrap libtool"
erjo@10889 20
pascal@24082 21 current_version()
pascal@24082 22 {
pascal@24082 23 wget -O - https://sourceforge.net/projects/$PACKAGE/files/$PACKAGE 2>/dev/null | \
pascal@24082 24 sed "/$PACKAGE-/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
pascal@24082 25 }
pascal@24082 26
erjo@1463 27 # Rules to configure and make the package.
erjo@1463 28 compile_rules()
erjo@1463 29 {
erjo@1463 30 cd $src
erjo@10889 31 ./autogen.sh --prefix=/usr \
erjo@10889 32 --sysconfdir=/etc \
pankso@12546 33 --localstatedir=/var/lib \
pascal@15272 34 $CONFIGURE_ARGS 2>&1 | grep -v 'grep: libtool:' &&
pascal@12798 35 make && make install
pankso@12546 36 #~ && make install-data-as
erjo@1463 37 }
erjo@1463 38
erjo@1463 39 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@1463 40 genpkg_rules()
erjo@1463 41 {
erjo@10890 42 mkdir -p $fs/usr/lib/plugins \
erjo@10890 43 $fs/usr/share \
erjo@10890 44 $fs/var/log/ntop
erjo@10890 45
pankso@12546 46 cp -a $install/usr/lib/*.so* $fs/usr/lib
pankso@12546 47 cp -a $install/usr/lib/ntop $fs/usr/lib
pankso@12546 48 cp -a $install/usr/bin $fs/usr
pankso@12546 49 cp -a $install/usr/share/ntop $fs/usr/share
erjo@10890 50 chown -R www.www $fs/usr/share/ntop
pankso@12546 51 cp -a $install/usr/bin $fs
pankso@12546 52 cp -a $install/etc $fs
pankso@12546 53 cp -a $install/var $fs
pankso@12546 54
erjo@1463 55 # Copy startup script and fix perms
erjo@1463 56 cp -a stuff/etc $fs
erjo@1463 57 chown root.root $fs/etc/init.d/ntop
erjo@1463 58 }
erjo@1463 59
erjo@10889 60 post_install()
erjo@10889 61 {
erjo@10890 62 user=ntop
erjo@10890 63 group=ntop
pankso@12546 64
pascal@18730 65 if ! grep -q $user: "$1/etc/passwd"; then
erjo@10889 66 echo -n "Adding user/group $user..."
pascal@18730 67 chroot "$1/" addgroup -S $user
pascal@18730 68 chroot "$1/" adduser -S -D -H -G $group $user
erjo@10889 69 status
erjo@10889 70 fi
pankso@12546 71
erjo@10889 72 # Fix perms for files and directories
pascal@18730 73 chroot "$1/" chown -R ${user}.${group} /var/lib/ntop /var/log/ntop
pankso@12546 74
erjo@10890 75 # Start package daemon if we are on running system
pascal@18730 76 [ "$1" ] || /etc/init.d/$PACKAGE start
pankso@12546 77
erjo@10889 78 # post_install messges
erjo@10889 79 echo -e "\nTo starts $PACKAGE server you can run :\n"
erjo@10889 80 echo "/etc/init.d/$PACKAGE start"
erjo@10889 81 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
erjo@10889 82 }
erjo@10888 83
erjo@10890 84 pre_remove()
erjo@10890 85 {
pascal@18730 86 [ "$1" ] || /etc/init.d/$PACKAGE stop
erjo@10890 87 }
erjo@10889 88
erjo@10890 89 post_remove()
erjo@10890 90 {
erjo@10890 91 user=ntop
erjo@10890 92 group=ntop
erjo@10889 93
pascal@18730 94 if ! grep -q $user: "$1/etc/passwd"; then
erjo@10890 95 echo -n "Removing user/group $user..."
pascal@18730 96 chroot "$1/" delgroup $user
pascal@18730 97 chroot "$1/" deluser $user
erjo@10890 98 status
erjo@10890 99 fi
erjo@10890 100 }