wok view kismet/receipt @ rev 6590
Added battery patch to lxpanel to fix 100% battery power bug.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sat Oct 09 04:48:51 2010 +0000 (2010-10-09) |
parents | 22897e7bd5e5 |
children | 7130b9831b50 |
line source
1 # SliTaz package receipt.
3 PACKAGE="kismet"
4 VERSION="2010-07-R1"
5 CATEGORY="network"
6 SHORT_DESC="Wireless network monitoring tool"
7 MAINTAINER="domcox@users.sourceforge.net"
8 DEPENDS="dbus libnl libpcap ncurses pcre libcap attr"
9 BUILD_DEPENDS="dbus-dev libnl-dev libpcap linux-headers ncurses-dev pcre-dev pkg-config"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.kismetwireless.net"
12 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
13 TAGS="wireless network monitor"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 ./configure \
20 --prefix=/usr \
21 --infodir=/usr/share/info \
22 --mandir=/usr/share/man \
23 --sysconfdir=/etc/kismet \
24 $CONFIGURE_ARGS && \
25 make && \
26 make DESTDIR=$PWD/_pkg install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr
33 cp -a $_pkg/usr/bin $fs/usr
34 cp -a $src/kismet_capture $fs/usr/bin
35 mkdir -p $fs/etc
36 cp -a $_pkg/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 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 }
104 post_remove()
105 {
106 delgroup kismet
107 rm -rf /etc/kismet
108 }