wok-next view kismet/receipt @ rev 21016

Small updates; mdocml -> mandoc
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Oct 15 16:44:45 2018 +0300 (2018-10-15)
parents 342b30daff76
children d5aab818505e
line source
1 # SliTaz package receipt v2.
3 PACKAGE="kismet"
4 VERSION="2011-03-R2"
5 CATEGORY="network"
6 SHORT_DESC="Wireless network monitoring tool"
7 MAINTAINER="domcox@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.kismetwireless.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
14 BUILD_DEPENDS="libpcap-dev ncurses-dev libnl-dev"
16 compile_rules() {
17 touch -d 197001010000 .depend
19 ./configure \
20 --sysconfdir=/etc/kismet \
21 $CONFIGURE_ARGS &&
22 make &&
23 make DESTDIR=$DESTDIR install || return 1
25 install -Dm755 $src/kismet_capture $install/usr/bin/kismet_capture
26 }
28 genpkg_rules() {
29 copy @std
30 # do not overwrite existing configuration
31 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
32 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new
33 DEPENDS="libpcap ncurses ncurses-libpanel"
34 TAGS="wireless network monitor"
35 }
37 post_install() {
38 # addgroup kismet if needed
39 if ! grep -q kismet "$1/etc/group"; then
40 chroot "$1/" addgroup -g 315 kismet
41 fi
42 # Add tux to kismet group
43 chroot "$1/" addgroup tux kismet
44 # set Kismet as suid-root
45 chroot "$1/" chown root:kismet /usr/bin/kismet_capture &&
46 chroot "$1/" chmod 4550 /usr/bin/kismet_capture
47 # configuration files update
48 create=1
49 overwrite=2
50 keep=3
51 cd "$1/etc/kismet"
52 # kismet_ui.conf doesn't exists anymore
53 if [ -e kismet_ui.conf ]; then
54 mv kismet_ui.conf kismet_ui.oldpkg
55 fi
56 for file in "kismet" "kismet_drone"; do
57 # check current files version
58 if [ ! -e $file.conf ]; then
59 action=$create
60 else
61 current=$(grep version= $file.conf)
62 new=$(grep version= $file.conf.new)
63 if [ "$current" == "$new" ]; then
64 action=$keep
65 else
66 action=$overwrite
67 fi
68 fi
69 # update if needed
70 case $action in
71 $create)
72 mv $file.conf.new $file.conf
73 ;;
74 $keep)
75 rm $file.conf.new
76 warning="keep"
77 ;;
78 $overwrite)
79 mv $file.conf $file.conf.oldpkg
80 mv $file.conf.new $file.conf
81 warning=$overwrite
82 echo "Warning: /etc/kismet/$file.conf new version from upstream"
83 ;;
84 esac
85 done
86 if [ "$warning" != "keep" ]; then
87 echo "-----"
88 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
89 echo "for your system, or it will NOT run properly!"
90 fi
91 true
92 }
94 post_remove() {
95 chroot "$1/" delgroup kismet
96 rm -rf $1/etc/kismet
97 }