wok-next view kismet/receipt @ rev 19990
lighttpd: add missing SPLIT
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Oct 20 08:05:51 2017 +0200 (2017-10-20) |
parents | 9e01bc6321ea |
children | d43bf7aae921 |
line source
1 # SliTaz package receipt.
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.kismetwireless.net"
11 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
12 TAGS="wireless network monitor"
14 DEPENDS="dbus libnl libpcap ncurses pcre libcap attr"
15 BUILD_DEPENDS="pkg-config libpcap-dev ncurses-dev libnl-dev"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 touch -d 197001010000 .depend
21 ./configure \
22 --prefix=/usr \
23 --sysconfdir=/etc/kismet \
24 $CONFIGURE_ARGS && \
25 make && \
26 make DESTDIR=$DESTDIR install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr
33 cp -a $install/usr/bin $fs/usr
34 cp -a $src/kismet_capture $fs/usr/bin
35 mkdir -p $fs/etc
36 cp -a $install/etc/kismet $fs/etc
37 # do not overwrite existing configuration
38 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
39 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new
40 }
42 post_install()
43 {
44 # addgroup kismet if needed
45 if ! grep -q kismet "$1/etc/group"; then
46 echo -n "Adding group kismet..."
47 chroot "$1/" addgroup -g 315 kismet
48 status
49 fi
50 # Add tux to kismet group
51 chroot "$1/" addgroup tux kismet
52 # set Kismet as suid-root
53 echo -n "Set Kismet as suid-root.."
54 chroot "$1/" chown root:kismet /usr/bin/kismet_capture && \
55 chroot "$1/" chmod 4550 /usr/bin/kismet_capture
56 status
57 # configuration files update
58 create=1
59 overwrite=2
60 keep=3
61 cd "$1/etc/kismet"
62 # kismet_ui.conf doesn't exists anymore
63 if [ -e kismet_ui.conf ]; then
64 mv kismet_ui.conf kismet_ui.oldpkg
65 fi
66 for file in "kismet" "kismet_drone"
67 do
68 # check current files version
69 if [ ! -e $file.conf ]; then
70 action=$create
71 else
72 current=`grep version= $file.conf`
73 new=`grep version= $file.conf.new`
74 if [ "$current" = "$new" ]; then
75 action=$keep
76 else
77 action=$overwrite
78 fi
79 fi
80 # update if needed
81 case $action in
82 $create)
83 mv $file.conf.new $file.conf
84 ;;
85 $keep)
86 rm $file.conf.new
87 warning="keep"
88 ;;
89 $overwrite)
90 mv $file.conf $file.conf.oldpkg
91 mv $file.conf.new $file.conf
92 warning=$overwrite
93 echo "Warning: /etc/kismet/$file.conf new version from upstream"
94 ;;
95 esac
96 done
97 if [ "$warning" != "keep" ]; then
98 echo "-----"
99 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
100 echo "for your system, or it will NOT run properly!"
101 fi
102 true
103 }
105 post_remove()
106 {
107 delgroup kismet
108 rm -rf /etc/kismet
109 }