wok annotate kismet/receipt @ rev 18319

Up youtube-dl (2015.08.28)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Sat Aug 29 20:33:32 2015 +0200 (2015-08-29)
parents 497a94b577b4
children 1067bb7f1e24
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@17673 20 export LDFLAGS="$LDFLAGS -ltinfo"
pascal@15065 21 touch -d 197001010000 .depend
domcox@1898 22 ./configure \
domcox@1898 23 --prefix=/usr \
domcox@1898 24 --sysconfdir=/etc/kismet \
domcox@1898 25 $CONFIGURE_ARGS && \
domcox@1898 26 make && \
slaxemulator@9588 27 make DESTDIR=$DESTDIR install
domcox@1021 28 }
domcox@1021 29
domcox@1021 30 # Rules to gen a SliTaz package suitable for Tazpkg.
domcox@1021 31 genpkg_rules()
domcox@1021 32 {
domcox@1021 33 mkdir -p $fs/usr
pascal@15065 34 cp -a $install/usr/bin $fs/usr
domcox@3626 35 cp -a $src/kismet_capture $fs/usr/bin
domcox@1021 36 mkdir -p $fs/etc
pascal@15065 37 cp -a $install/etc/kismet $fs/etc
domcox@3622 38 # do not overwrite existing configuration
domcox@1898 39 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
domcox@1898 40 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.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..."
slaxemulator@10872 48 chroot $1/ addgroup -g 315 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@3622 63 # kismet_ui.conf doesn't exists anymore
domcox@3622 64 if [ -e kismet_ui.conf ]; then
domcox@3622 65 mv kismet_ui.conf kismet_ui.oldpkg
domcox@3622 66 fi
domcox@3622 67 for file in "kismet" "kismet_drone"
domcox@1898 68 do
domcox@3443 69 # check current files version
domcox@1898 70 if [ ! -e $file.conf ]; then
domcox@1898 71 action=$create
domcox@1898 72 else
domcox@1898 73 current=`grep version= $file.conf`
domcox@1898 74 new=`grep version= $file.conf.new`
domcox@1898 75 if [ "$current" = "$new" ]; then
domcox@1898 76 action=$keep
domcox@1898 77 else
domcox@1898 78 action=$overwrite
domcox@1898 79 fi
domcox@1898 80 fi
domcox@3443 81 # update if needed
domcox@1898 82 case $action in
domcox@1898 83 $create)
domcox@1898 84 mv $file.conf.new $file.conf
domcox@1898 85 ;;
domcox@1898 86 $keep)
domcox@1898 87 rm $file.conf.new
domcox@3443 88 warning="keep"
domcox@1898 89 ;;
domcox@1898 90 $overwrite)
domcox@3443 91 mv $file.conf $file.conf.oldpkg
domcox@1898 92 mv $file.conf.new $file.conf
domcox@3443 93 warning=$overwrite
domcox@3443 94 echo "Warning: /etc/kismet/$file.conf new version from upstream"
domcox@1898 95 ;;
domcox@1898 96 esac
domcox@1898 97 done
domcox@3443 98 if [ "$warning" != "keep" ]; then
domcox@3443 99 echo "-----"
domcox@3443 100 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
domcox@3443 101 echo "for your system, or it will NOT run properly!"
domcox@3443 102 fi
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 }