wok-6.x annotate ntop/receipt @ rev 17824
Up: slitaz-boot-scripts(5.6.7)
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Sun Mar 22 19:56:52 2015 +0100 (2015-03-22) |
parents | b3adb464f82d |
children | 9e01bc6321ea |
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" |
erjo@1463 | 10 WEB_SITE="http://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 |
erjo@1463 | 21 # Rules to configure and make the package. |
erjo@1463 | 22 compile_rules() |
erjo@1463 | 23 { |
erjo@1463 | 24 cd $src |
erjo@10889 | 25 ./autogen.sh --prefix=/usr \ |
erjo@10889 | 26 --sysconfdir=/etc \ |
pankso@12546 | 27 --localstatedir=/var/lib \ |
pascal@15272 | 28 $CONFIGURE_ARGS 2>&1 | grep -v 'grep: libtool:' && |
pascal@12798 | 29 make && make install |
pankso@12546 | 30 #~ && make install-data-as |
erjo@1463 | 31 } |
erjo@1463 | 32 |
erjo@1463 | 33 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@1463 | 34 genpkg_rules() |
erjo@1463 | 35 { |
erjo@10890 | 36 mkdir -p $fs/usr/lib/plugins \ |
erjo@10890 | 37 $fs/usr/share \ |
erjo@10890 | 38 $fs/var/log/ntop |
erjo@10890 | 39 |
pankso@12546 | 40 cp -a $install/usr/lib/*.so* $fs/usr/lib |
pankso@12546 | 41 cp -a $install/usr/lib/ntop $fs/usr/lib |
pankso@12546 | 42 cp -a $install/usr/bin $fs/usr |
pankso@12546 | 43 cp -a $install/usr/share/ntop $fs/usr/share |
erjo@10890 | 44 chown -R www.www $fs/usr/share/ntop |
pankso@12546 | 45 cp -a $install/usr/bin $fs |
pankso@12546 | 46 cp -a $install/etc $fs |
pankso@12546 | 47 cp -a $install/var $fs |
pankso@12546 | 48 |
erjo@1463 | 49 # Copy startup script and fix perms |
erjo@1463 | 50 cp -a stuff/etc $fs |
erjo@1463 | 51 chown root.root $fs/etc/init.d/ntop |
erjo@1463 | 52 } |
erjo@1463 | 53 |
erjo@10889 | 54 post_install() |
erjo@10889 | 55 { |
erjo@10890 | 56 user=ntop |
erjo@10890 | 57 group=ntop |
pankso@12546 | 58 |
erjo@10889 | 59 if ! grep -q $user: $1/etc/passwd; then |
erjo@10889 | 60 echo -n "Adding user/group $user..." |
erjo@10889 | 61 chroot $1/ addgroup -S $user |
erjo@10889 | 62 chroot $1/ adduser -S -D -H -G $group $user |
erjo@10889 | 63 status |
erjo@10889 | 64 fi |
pankso@12546 | 65 |
erjo@10889 | 66 # Fix perms for files and directories |
erjo@10890 | 67 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop |
pankso@12546 | 68 |
erjo@10890 | 69 # Start package daemon if we are on running system |
erjo@10889 | 70 [ -z $1 ] && /etc/init.d/$PACKAGE start |
pankso@12546 | 71 |
erjo@10889 | 72 # post_install messges |
erjo@10889 | 73 echo -e "\nTo starts $PACKAGE server you can run :\n" |
erjo@10889 | 74 echo "/etc/init.d/$PACKAGE start" |
erjo@10889 | 75 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
erjo@10889 | 76 } |
erjo@10888 | 77 |
erjo@10890 | 78 pre_remove() |
erjo@10890 | 79 { |
erjo@10890 | 80 [ -z $1 ] && /etc/init.d/$PACKAGE stop |
erjo@10890 | 81 } |
erjo@10889 | 82 |
erjo@10890 | 83 post_remove() |
erjo@10890 | 84 { |
erjo@10890 | 85 user=ntop |
erjo@10890 | 86 group=ntop |
erjo@10889 | 87 |
erjo@10890 | 88 if ! grep -q $user: $1/etc/passwd; then |
erjo@10890 | 89 echo -n "Removing user/group $user..." |
erjo@10890 | 90 chroot $1/ delgroup $user |
erjo@10890 | 91 chroot $1/ deluser $user |
erjo@10890 | 92 status |
erjo@10890 | 93 fi |
erjo@10890 | 94 } |