wok-next annotate kismet/receipt @ rev 20244
Update bdeps: apache-mod-perl, codeblocks, tacacs+, thunar-archive-plugin, tuxpaint, xpenguins
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Nov 07 10:54:15 2017 +0200 (2017-11-07) |
parents | 9e01bc6321ea |
children | d43bf7aae921 |
rev | line source |
---|---|
domcox@1021 | 1 # SliTaz package receipt. |
domcox@1021 | 2 |
domcox@1021 | 3 PACKAGE="kismet" |
devl547@11306 | 4 VERSION="2011-03-R2" |
domcox@1022 | 5 CATEGORY="network" |
domcox@1021 | 6 SHORT_DESC="Wireless network monitoring tool" |
pascal@13025 | 7 MAINTAINER="domcox@slitaz.org" |
pascal@15065 | 8 LICENSE="GPL2" |
domcox@1021 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
domcox@1021 | 10 WEB_SITE="http://www.kismetwireless.net" |
domcox@1021 | 11 WGET_URL="http://www.kismetwireless.net/code/$TARBALL" |
jozee@4942 | 12 TAGS="wireless network monitor" |
domcox@1021 | 13 |
erjo@9936 | 14 DEPENDS="dbus libnl libpcap ncurses pcre libcap attr" |
pascal@16805 | 15 BUILD_DEPENDS="pkg-config libpcap-dev ncurses-dev libnl-dev" |
erjo@9936 | 16 |
domcox@1021 | 17 # Rules to configure and make the package. |
domcox@1021 | 18 compile_rules() |
domcox@1021 | 19 { |
pascal@15065 | 20 touch -d 197001010000 .depend |
domcox@1898 | 21 ./configure \ |
domcox@1898 | 22 --prefix=/usr \ |
domcox@1898 | 23 --sysconfdir=/etc/kismet \ |
domcox@1898 | 24 $CONFIGURE_ARGS && \ |
domcox@1898 | 25 make && \ |
slaxemulator@9588 | 26 make DESTDIR=$DESTDIR install |
domcox@1021 | 27 } |
domcox@1021 | 28 |
domcox@1021 | 29 # Rules to gen a SliTaz package suitable for Tazpkg. |
domcox@1021 | 30 genpkg_rules() |
domcox@1021 | 31 { |
domcox@1021 | 32 mkdir -p $fs/usr |
pascal@15065 | 33 cp -a $install/usr/bin $fs/usr |
domcox@3626 | 34 cp -a $src/kismet_capture $fs/usr/bin |
domcox@1021 | 35 mkdir -p $fs/etc |
pascal@15065 | 36 cp -a $install/etc/kismet $fs/etc |
domcox@3622 | 37 # do not overwrite existing configuration |
domcox@1898 | 38 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new |
domcox@1898 | 39 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new |
domcox@1021 | 40 } |
domcox@1898 | 41 |
domcox@1898 | 42 post_install() |
domcox@1898 | 43 { |
domcox@3443 | 44 # addgroup kismet if needed |
pascal@18730 | 45 if ! grep -q kismet "$1/etc/group"; then |
domcox@3443 | 46 echo -n "Adding group kismet..." |
pascal@18730 | 47 chroot "$1/" addgroup -g 315 kismet |
domcox@3443 | 48 status |
domcox@3443 | 49 fi |
domcox@3443 | 50 # Add tux to kismet group |
pascal@18730 | 51 chroot "$1/" addgroup tux kismet |
domcox@3443 | 52 # set Kismet as suid-root |
domcox@3443 | 53 echo -n "Set Kismet as suid-root.." |
pascal@18730 | 54 chroot "$1/" chown root:kismet /usr/bin/kismet_capture && \ |
pascal@18730 | 55 chroot "$1/" chmod 4550 /usr/bin/kismet_capture |
domcox@3443 | 56 status |
domcox@3443 | 57 # configuration files update |
domcox@1898 | 58 create=1 |
domcox@1898 | 59 overwrite=2 |
domcox@1898 | 60 keep=3 |
pascal@18730 | 61 cd "$1/etc/kismet" |
domcox@3622 | 62 # kismet_ui.conf doesn't exists anymore |
domcox@3622 | 63 if [ -e kismet_ui.conf ]; then |
domcox@3622 | 64 mv kismet_ui.conf kismet_ui.oldpkg |
domcox@3622 | 65 fi |
domcox@3622 | 66 for file in "kismet" "kismet_drone" |
domcox@1898 | 67 do |
domcox@3443 | 68 # check current files version |
domcox@1898 | 69 if [ ! -e $file.conf ]; then |
domcox@1898 | 70 action=$create |
domcox@1898 | 71 else |
domcox@1898 | 72 current=`grep version= $file.conf` |
domcox@1898 | 73 new=`grep version= $file.conf.new` |
domcox@1898 | 74 if [ "$current" = "$new" ]; then |
domcox@1898 | 75 action=$keep |
domcox@1898 | 76 else |
domcox@1898 | 77 action=$overwrite |
domcox@1898 | 78 fi |
domcox@1898 | 79 fi |
domcox@3443 | 80 # update if needed |
domcox@1898 | 81 case $action in |
domcox@1898 | 82 $create) |
domcox@1898 | 83 mv $file.conf.new $file.conf |
domcox@1898 | 84 ;; |
domcox@1898 | 85 $keep) |
domcox@1898 | 86 rm $file.conf.new |
domcox@3443 | 87 warning="keep" |
domcox@1898 | 88 ;; |
domcox@1898 | 89 $overwrite) |
domcox@3443 | 90 mv $file.conf $file.conf.oldpkg |
domcox@1898 | 91 mv $file.conf.new $file.conf |
domcox@3443 | 92 warning=$overwrite |
domcox@3443 | 93 echo "Warning: /etc/kismet/$file.conf new version from upstream" |
domcox@1898 | 94 ;; |
domcox@1898 | 95 esac |
domcox@1898 | 96 done |
domcox@3443 | 97 if [ "$warning" != "keep" ]; then |
domcox@3443 | 98 echo "-----" |
domcox@3443 | 99 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet" |
domcox@3443 | 100 echo "for your system, or it will NOT run properly!" |
domcox@3443 | 101 fi |
pascal@18707 | 102 true |
domcox@1898 | 103 } |
domcox@3443 | 104 |
domcox@3443 | 105 post_remove() |
domcox@3443 | 106 { |
domcox@3443 | 107 delgroup kismet |
domcox@3443 | 108 rm -rf /etc/kismet |
domcox@3443 | 109 } |