wok annotate kismet/receipt @ rev 3443

Kismet: up to 2009-05-RC2
author Dominique Corbex <domcox@users.sourceforge.net>
date Sun Jun 14 12:22:17 2009 +0200 (2009-06-14)
parents 09747329b5d0
children c2a82e984d39
rev   line source
domcox@1021 1 # SliTaz package receipt.
domcox@1021 2
domcox@1021 3 PACKAGE="kismet"
domcox@3443 4 VERSION="2009-05-RC2"
domcox@1022 5 CATEGORY="network"
domcox@1021 6 SHORT_DESC="Wireless network monitoring tool"
domcox@1021 7 MAINTAINER="domcox@users.sourceforge.net"
domcox@3443 8 DEPENDS="dbus libnl libpcap ncurses"
domcox@3443 9 BUILD_DEPENDS="dbus-dev libnl-dev ncurses-dev"
domcox@1021 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
domcox@1021 11 WEB_SITE="http://www.kismetwireless.net"
domcox@1021 12 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
domcox@1021 13
domcox@1021 14 # Rules to configure and make the package.
domcox@1021 15 compile_rules()
domcox@1021 16 {
domcox@1021 17 cd $src
domcox@1898 18 ./configure \
domcox@1898 19 --prefix=/usr \
domcox@1898 20 --infodir=/usr/share/info \
domcox@1898 21 --mandir=/usr/share/man \
domcox@1898 22 --sysconfdir=/etc/kismet \
domcox@1898 23 $CONFIGURE_ARGS && \
domcox@1898 24 make && \
domcox@1021 25 make DESTDIR=$PWD/_pkg install
domcox@1021 26 }
domcox@1021 27
domcox@1021 28 # Rules to gen a SliTaz package suitable for Tazpkg.
domcox@1021 29 genpkg_rules()
domcox@1021 30 {
domcox@1021 31 mkdir -p $fs/usr
domcox@1021 32 cp -a $_pkg/usr/bin $fs/usr
domcox@1021 33 mkdir -p $fs/etc
domcox@1021 34 cp -a $_pkg/etc/kismet $fs/etc
domcox@1898 35 # not overwrite existing configuration
domcox@1898 36 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
domcox@1898 37 mv $fs/etc/kismet/kismet_ui.conf $fs/etc/kismet/kismet_ui.conf.new
domcox@1898 38 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new
domcox@1898 39 # disable sound
domcox@1898 40 sed -i 's/sound=true/sound=false/' $fs/etc/kismet/kismet_ui.conf.new
domcox@1021 41 }
domcox@1898 42
domcox@1898 43 post_install()
domcox@1898 44 {
domcox@3443 45 # addgroup kismet if needed
domcox@3443 46 if ! grep -q kismet $1/etc/group; then
domcox@3443 47 echo -n "Adding group kismet..."
domcox@3443 48 chroot $1/ addgroup kismet
domcox@3443 49 status
domcox@3443 50 fi
domcox@3443 51 # Add tux to kismet group
domcox@3443 52 chroot $1/ addgroup tux kismet
domcox@3443 53 # set Kismet as suid-root
domcox@3443 54 echo -n "Set Kismet as suid-root.."
domcox@3443 55 chroot $1/ chown root:kismet /usr/bin/kismet_capture && \
domcox@3443 56 chroot $1/ chmod 4550 /usr/bin/kismet_capture
domcox@3443 57 status
domcox@3443 58 # configuration files update
domcox@1898 59 create=1
domcox@1898 60 overwrite=2
domcox@1898 61 keep=3
domcox@3443 62 cd $1/etc/kismet
domcox@1898 63 for file in "kismet" "kismet_ui" "kismet_drone"
domcox@1898 64 do
domcox@3443 65 # check current files version
domcox@1898 66 if [ ! -e $file.conf ]; then
domcox@1898 67 action=$create
domcox@1898 68 else
domcox@1898 69 current=`grep version= $file.conf`
domcox@1898 70 new=`grep version= $file.conf.new`
domcox@1898 71 if [ "$current" = "$new" ]; then
domcox@1898 72 action=$keep
domcox@1898 73 else
domcox@1898 74 action=$overwrite
domcox@1898 75 fi
domcox@1898 76 fi
domcox@3443 77 # update if needed
domcox@1898 78 case $action in
domcox@1898 79 $create)
domcox@1898 80 mv $file.conf.new $file.conf
domcox@1898 81 ;;
domcox@1898 82 $keep)
domcox@1898 83 rm $file.conf.new
domcox@3443 84 warning="keep"
domcox@1898 85 ;;
domcox@1898 86 $overwrite)
domcox@3443 87 mv $file.conf $file.conf.oldpkg
domcox@1898 88 mv $file.conf.new $file.conf
domcox@3443 89 warning=$overwrite
domcox@3443 90 echo "Warning: /etc/kismet/$file.conf new version from upstream"
domcox@1898 91 ;;
domcox@1898 92 esac
domcox@1898 93 done
domcox@3443 94 if [ "$warning" != "keep" ]; then
domcox@3443 95 echo "-----"
domcox@3443 96 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
domcox@3443 97 echo "for your system, or it will NOT run properly!"
domcox@3443 98 fi
domcox@1898 99 }
domcox@3443 100
domcox@3443 101 post_remove()
domcox@3443 102 {
domcox@3443 103 delgroup kismet
domcox@3443 104 rm -rf /etc/kismet
domcox@3443 105 }