wok-current annotate kismet/receipt @ rev 4520
Up: transmission (1.76) and --disable-libnotify
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Nov 27 17:13:04 2009 +0100 (2009-11-27) |
parents | c2a82e984d39 |
children | 9bac91257596 |
rev | line source |
---|---|
domcox@1021 | 1 # SliTaz package receipt. |
domcox@1021 | 2 |
domcox@1021 | 3 PACKAGE="kismet" |
domcox@3622 | 4 VERSION="2009-06-R1" |
domcox@1022 | 5 CATEGORY="network" |
domcox@1021 | 6 SHORT_DESC="Wireless network monitoring tool" |
domcox@1021 | 7 MAINTAINER="domcox@users.sourceforge.net" |
domcox@3622 | 8 DEPENDS="dbus libnl libpcap ncurses pcre" |
domcox@3622 | 9 BUILD_DEPENDS="dbus-dev libnl-dev libpcap linux-headers ncurses-dev pcre-dev pkg-config" |
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@3626 | 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@3626 | 33 cp -a $src/kismet_capture $fs/usr/bin |
domcox@1021 | 34 mkdir -p $fs/etc |
domcox@1021 | 35 cp -a $_pkg/etc/kismet $fs/etc |
domcox@3622 | 36 # do not overwrite existing configuration |
domcox@1898 | 37 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new |
domcox@1898 | 38 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new |
domcox@1021 | 39 } |
domcox@1898 | 40 |
domcox@1898 | 41 post_install() |
domcox@1898 | 42 { |
domcox@3443 | 43 # addgroup kismet if needed |
domcox@3443 | 44 if ! grep -q kismet $1/etc/group; then |
domcox@3443 | 45 echo -n "Adding group kismet..." |
domcox@3443 | 46 chroot $1/ addgroup kismet |
domcox@3443 | 47 status |
domcox@3443 | 48 fi |
domcox@3443 | 49 # Add tux to kismet group |
domcox@3443 | 50 chroot $1/ addgroup tux kismet |
domcox@3443 | 51 # set Kismet as suid-root |
domcox@3443 | 52 echo -n "Set Kismet as suid-root.." |
domcox@3443 | 53 chroot $1/ chown root:kismet /usr/bin/kismet_capture && \ |
domcox@3443 | 54 chroot $1/ chmod 4550 /usr/bin/kismet_capture |
domcox@3443 | 55 status |
domcox@3443 | 56 # configuration files update |
domcox@1898 | 57 create=1 |
domcox@1898 | 58 overwrite=2 |
domcox@1898 | 59 keep=3 |
domcox@3443 | 60 cd $1/etc/kismet |
domcox@3622 | 61 # kismet_ui.conf doesn't exists anymore |
domcox@3622 | 62 if [ -e kismet_ui.conf ]; then |
domcox@3622 | 63 mv kismet_ui.conf kismet_ui.oldpkg |
domcox@3622 | 64 fi |
domcox@3622 | 65 for file in "kismet" "kismet_drone" |
domcox@1898 | 66 do |
domcox@3443 | 67 # check current files version |
domcox@1898 | 68 if [ ! -e $file.conf ]; then |
domcox@1898 | 69 action=$create |
domcox@1898 | 70 else |
domcox@1898 | 71 current=`grep version= $file.conf` |
domcox@1898 | 72 new=`grep version= $file.conf.new` |
domcox@1898 | 73 if [ "$current" = "$new" ]; then |
domcox@1898 | 74 action=$keep |
domcox@1898 | 75 else |
domcox@1898 | 76 action=$overwrite |
domcox@1898 | 77 fi |
domcox@1898 | 78 fi |
domcox@3443 | 79 # update if needed |
domcox@1898 | 80 case $action in |
domcox@1898 | 81 $create) |
domcox@1898 | 82 mv $file.conf.new $file.conf |
domcox@1898 | 83 ;; |
domcox@1898 | 84 $keep) |
domcox@1898 | 85 rm $file.conf.new |
domcox@3443 | 86 warning="keep" |
domcox@1898 | 87 ;; |
domcox@1898 | 88 $overwrite) |
domcox@3443 | 89 mv $file.conf $file.conf.oldpkg |
domcox@1898 | 90 mv $file.conf.new $file.conf |
domcox@3443 | 91 warning=$overwrite |
domcox@3443 | 92 echo "Warning: /etc/kismet/$file.conf new version from upstream" |
domcox@1898 | 93 ;; |
domcox@1898 | 94 esac |
domcox@1898 | 95 done |
domcox@3443 | 96 if [ "$warning" != "keep" ]; then |
domcox@3443 | 97 echo "-----" |
domcox@3443 | 98 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet" |
domcox@3443 | 99 echo "for your system, or it will NOT run properly!" |
domcox@3443 | 100 fi |
domcox@1898 | 101 } |
domcox@3443 | 102 |
domcox@3443 | 103 post_remove() |
domcox@3443 | 104 { |
domcox@3443 | 105 delgroup kismet |
domcox@3443 | 106 rm -rf /etc/kismet |
domcox@3443 | 107 } |