wok view kismet/receipt @ rev 13025
clucene-dev, clucene, drupal, fcitx-skin-default, fcitx-zm, gejengel, hd2u, input-utils, jdk6-jaf, jdk6-jaxp, jdk6-jaxws, kismet, libedit-dev, libedit, linux-module-headers, linux-ocfs2, linux-staging, linux64-ocfs2, linux64-staging, menu-railroad, nfs-utils, ode-dev, openjdk-6-src, runcom, talloc-python, vlc-plugin, xorg-xf86-video-neomagic: fix maintainer
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jun 11 17:36:31 2012 +0200 (2012-06-11) |
parents | 30062b4789f2 |
children | 3fe2c569088e |
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.kismetwireless.net"
10 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
11 TAGS="wireless network monitor"
13 DEPENDS="dbus libnl libpcap ncurses pcre libcap attr"
14 BUILD_DEPENDS="pkg-config libpcap-dev ncurses-dev"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 ./configure \
21 --prefix=/usr \
22 --sysconfdir=/etc/kismet \
23 $CONFIGURE_ARGS && \
24 make && \
25 make DESTDIR=$DESTDIR install
26 }
28 # Rules to gen a SliTaz package suitable for Tazpkg.
29 genpkg_rules()
30 {
31 mkdir -p $fs/usr
32 cp -a $_pkg/usr/bin $fs/usr
33 cp -a $src/kismet_capture $fs/usr/bin
34 mkdir -p $fs/etc
35 cp -a $_pkg/etc/kismet $fs/etc
36 # do not overwrite existing configuration
37 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
38 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new
39 }
41 post_install()
42 {
43 # addgroup kismet if needed
44 if ! grep -q kismet $1/etc/group; then
45 echo -n "Adding group kismet..."
46 chroot $1/ addgroup -g 315 kismet
47 status
48 fi
49 # Add tux to kismet group
50 chroot $1/ addgroup tux kismet
51 # set Kismet as suid-root
52 echo -n "Set Kismet as suid-root.."
53 chroot $1/ chown root:kismet /usr/bin/kismet_capture && \
54 chroot $1/ chmod 4550 /usr/bin/kismet_capture
55 status
56 # configuration files update
57 create=1
58 overwrite=2
59 keep=3
60 cd $1/etc/kismet
61 # kismet_ui.conf doesn't exists anymore
62 if [ -e kismet_ui.conf ]; then
63 mv kismet_ui.conf kismet_ui.oldpkg
64 fi
65 for file in "kismet" "kismet_drone"
66 do
67 # check current files version
68 if [ ! -e $file.conf ]; then
69 action=$create
70 else
71 current=`grep version= $file.conf`
72 new=`grep version= $file.conf.new`
73 if [ "$current" = "$new" ]; then
74 action=$keep
75 else
76 action=$overwrite
77 fi
78 fi
79 # update if needed
80 case $action in
81 $create)
82 mv $file.conf.new $file.conf
83 ;;
84 $keep)
85 rm $file.conf.new
86 warning="keep"
87 ;;
88 $overwrite)
89 mv $file.conf $file.conf.oldpkg
90 mv $file.conf.new $file.conf
91 warning=$overwrite
92 echo "Warning: /etc/kismet/$file.conf new version from upstream"
93 ;;
94 esac
95 done
96 if [ "$warning" != "keep" ]; then
97 echo "-----"
98 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
99 echo "for your system, or it will NOT run properly!"
100 fi
101 }
103 post_remove()
104 {
105 delgroup kismet
106 rm -rf /etc/kismet
107 }