wok-current annotate ntop/receipt @ rev 12798
ntop: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri May 18 10:52:43 2012 +0200 (2012-05-18) |
parents | bf6520485b0b |
children | 2b9f96603415 |
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" |
erjo@11453 | 8 TARBALL="$PACKAGE-$VERSION.tar.gz" |
erjo@1463 | 9 WEB_SITE="http://www.ntop.org/" |
erjo@1463 | 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
erjo@1463 | 11 CONFIG_FILES="/etc/ntop" |
jozee@4969 | 12 TAGS="network" |
erjo@1463 | 13 |
pankso@12546 | 14 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl pcre geoip\ |
pankso@12546 | 15 libwrap" |
pankso@12546 | 16 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool \ |
pankso@12546 | 17 glibc-dev gdbm-dev rrdtool autoconf automake rrdtool-dev wget geoip-dev \ |
pankso@12546 | 18 libwrap libtool" |
erjo@10889 | 19 |
erjo@1463 | 20 # Rules to configure and make the package. |
erjo@1463 | 21 compile_rules() |
erjo@1463 | 22 { |
erjo@1463 | 23 cd $src |
erjo@10889 | 24 ./autogen.sh --prefix=/usr \ |
erjo@10889 | 25 --sysconfdir=/etc \ |
pankso@12546 | 26 --localstatedir=/var/lib \ |
pankso@12546 | 27 $CONFIGURE_ARGS && |
pascal@12798 | 28 make && make install |
pankso@12546 | 29 #~ && make install-data-as |
erjo@1463 | 30 } |
erjo@1463 | 31 |
erjo@1463 | 32 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@1463 | 33 genpkg_rules() |
erjo@1463 | 34 { |
erjo@10890 | 35 mkdir -p $fs/usr/lib/plugins \ |
erjo@10890 | 36 $fs/usr/share \ |
erjo@10890 | 37 $fs/var/log/ntop |
erjo@10890 | 38 |
pankso@12546 | 39 cp -a $install/usr/lib/*.so* $fs/usr/lib |
pankso@12546 | 40 cp -a $install/usr/lib/ntop $fs/usr/lib |
pankso@12546 | 41 cp -a $install/usr/bin $fs/usr |
pankso@12546 | 42 cp -a $install/usr/share/ntop $fs/usr/share |
erjo@10890 | 43 chown -R www.www $fs/usr/share/ntop |
pankso@12546 | 44 cp -a $install/usr/bin $fs |
pankso@12546 | 45 cp -a $install/etc $fs |
pankso@12546 | 46 cp -a $install/var $fs |
pankso@12546 | 47 |
erjo@1463 | 48 # Copy startup script and fix perms |
erjo@1463 | 49 cp -a stuff/etc $fs |
erjo@1463 | 50 chown root.root $fs/etc/init.d/ntop |
erjo@1463 | 51 } |
erjo@1463 | 52 |
erjo@10889 | 53 post_install() |
erjo@10889 | 54 { |
erjo@10890 | 55 user=ntop |
erjo@10890 | 56 group=ntop |
pankso@12546 | 57 |
erjo@10889 | 58 if ! grep -q $user: $1/etc/passwd; then |
erjo@10889 | 59 echo -n "Adding user/group $user..." |
erjo@10889 | 60 chroot $1/ addgroup -S $user |
erjo@10889 | 61 chroot $1/ adduser -S -D -H -G $group $user |
erjo@10889 | 62 status |
erjo@10889 | 63 fi |
pankso@12546 | 64 |
erjo@10889 | 65 # Fix perms for files and directories |
erjo@10890 | 66 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop |
pankso@12546 | 67 |
erjo@10890 | 68 # Start package daemon if we are on running system |
erjo@10889 | 69 [ -z $1 ] && /etc/init.d/$PACKAGE start |
pankso@12546 | 70 |
erjo@10889 | 71 # post_install messges |
erjo@10889 | 72 echo -e "\nTo starts $PACKAGE server you can run :\n" |
erjo@10889 | 73 echo "/etc/init.d/$PACKAGE start" |
erjo@10889 | 74 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
erjo@10889 | 75 } |
erjo@10888 | 76 |
erjo@10890 | 77 pre_remove() |
erjo@10890 | 78 { |
erjo@10890 | 79 [ -z $1 ] && /etc/init.d/$PACKAGE stop |
erjo@10890 | 80 } |
erjo@10889 | 81 |
erjo@10890 | 82 post_remove() |
erjo@10890 | 83 { |
erjo@10890 | 84 user=ntop |
erjo@10890 | 85 group=ntop |
erjo@10889 | 86 |
erjo@10890 | 87 if ! grep -q $user: $1/etc/passwd; then |
erjo@10890 | 88 echo -n "Removing user/group $user..." |
erjo@10890 | 89 chroot $1/ delgroup $user |
erjo@10890 | 90 chroot $1/ deluser $user |
erjo@10890 | 91 status |
erjo@10890 | 92 fi |
erjo@10890 | 93 } |