wok-4.x annotate ntop/receipt @ rev 11457
libvalhalla: fix build
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sat Dec 17 11:42:21 2011 +0100 (2011-12-17) |
parents | 956ac96b4a1b |
children | 53e9551e9325 |
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 |
erjo@10889 | 14 DEPENDS="zlib openssl libpng libpcap glibc gdbm rrdtool perl pcre geoip" |
erjo@10889 | 15 BUILD_DEPENDS="zlib-dev openssl-dev libpng-dev libpcap-dev libtool glibc-dev gdbm-dev rrdtool \ |
erjo@10889 | 16 autoconf automake rrdtool-dev wget geoip-dev " |
erjo@10889 | 17 |
erjo@1463 | 18 # Rules to configure and make the package. |
erjo@1463 | 19 compile_rules() |
erjo@1463 | 20 { |
erjo@1463 | 21 cd $src |
erjo@10889 | 22 ./autogen.sh --prefix=/usr \ |
erjo@10889 | 23 --sysconfdir=/etc \ |
erjo@10890 | 24 --localstatedir=/var/lib $CONFIGURE_ARGS && |
erjo@1463 | 25 make && |
erjo@10889 | 26 make DESTDIR=$PWD/_pkg install |
erjo@10889 | 27 #~ && make install-data-as |
erjo@1463 | 28 } |
erjo@1463 | 29 |
erjo@1463 | 30 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@1463 | 31 genpkg_rules() |
erjo@1463 | 32 { |
erjo@10890 | 33 mkdir -p $fs/usr/lib/plugins \ |
erjo@10890 | 34 $fs/usr/share \ |
erjo@10890 | 35 $fs/var/log/ntop |
erjo@10890 | 36 |
erjo@1463 | 37 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib |
erjo@1463 | 38 cp -a $_pkg/usr/lib/ntop $fs/usr/lib |
erjo@1463 | 39 cp -a $_pkg/usr/bin $fs/usr |
erjo@1463 | 40 cp -a $_pkg/usr/share/ntop $fs/usr/share |
erjo@10890 | 41 chown -R www.www $fs/usr/share/ntop |
erjo@1463 | 42 cp -a $_pkg/usr/bin $fs |
erjo@1463 | 43 cp -a $_pkg/etc $fs |
erjo@1463 | 44 cp -a $_pkg/var $fs |
erjo@1463 | 45 |
erjo@1463 | 46 # Copy startup script and fix perms |
erjo@1463 | 47 cp -a stuff/etc $fs |
erjo@1463 | 48 chown root.root $fs/etc/init.d/ntop |
erjo@10889 | 49 |
gokhlayeh@11426 | 50 # Package all ntop pkgs (cookutils only) |
gokhlayeh@11426 | 51 if [ -x /usr/bin/cook ]; then |
gokhlayeh@11426 | 52 for i in $(cd $WOK; ls -d ntop-*) |
gokhlayeh@11426 | 53 do |
gokhlayeh@11426 | 54 cook $i |
gokhlayeh@11426 | 55 done |
gokhlayeh@11426 | 56 fi |
erjo@1463 | 57 } |
erjo@1463 | 58 |
erjo@10889 | 59 post_install() |
erjo@10889 | 60 { |
erjo@10890 | 61 user=ntop |
erjo@10890 | 62 group=ntop |
erjo@10889 | 63 |
erjo@10889 | 64 if ! grep -q $user: $1/etc/passwd; then |
erjo@10889 | 65 echo -n "Adding user/group $user..." |
erjo@10889 | 66 chroot $1/ addgroup -S $user |
erjo@10889 | 67 chroot $1/ adduser -S -D -H -G $group $user |
erjo@10889 | 68 status |
erjo@10889 | 69 fi |
erjo@10889 | 70 |
erjo@10889 | 71 # Fix perms for files and directories |
erjo@10890 | 72 chroot $1/ chown -R ${user}.${group} /var/lib/ntop /var/log/ntop |
erjo@10889 | 73 |
erjo@10890 | 74 # Start package daemon if we are on running system |
erjo@10889 | 75 [ -z $1 ] && /etc/init.d/$PACKAGE start |
erjo@10889 | 76 |
erjo@10889 | 77 # post_install messges |
erjo@10889 | 78 echo -e "\nTo starts $PACKAGE server you can run :\n" |
erjo@10889 | 79 echo "/etc/init.d/$PACKAGE start" |
erjo@10889 | 80 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
erjo@10889 | 81 } |
erjo@10888 | 82 |
erjo@10890 | 83 pre_remove() |
erjo@10890 | 84 { |
erjo@10890 | 85 [ -z $1 ] && /etc/init.d/$PACKAGE stop |
erjo@10890 | 86 } |
erjo@10889 | 87 |
erjo@10890 | 88 post_remove() |
erjo@10890 | 89 { |
erjo@10890 | 90 user=ntop |
erjo@10890 | 91 group=ntop |
erjo@10889 | 92 |
erjo@10890 | 93 if ! grep -q $user: $1/etc/passwd; then |
erjo@10890 | 94 echo -n "Removing user/group $user..." |
erjo@10890 | 95 chroot $1/ delgroup $user |
erjo@10890 | 96 chroot $1/ deluser $user |
erjo@10890 | 97 status |
erjo@10890 | 98 fi |
erjo@10890 | 99 } |