wok view kismet/receipt @ rev 3514
mv linuxqq to get-linuxqq (non-free) (genpkg_rules need improvement)
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Sat Jun 20 00:06:41 2009 +0000 (2009-06-20) |
parents | 09747329b5d0 |
children | c2a82e984d39 |
line source
1 # SliTaz package receipt.
3 PACKAGE="kismet"
4 VERSION="2009-05-RC2"
5 CATEGORY="network"
6 SHORT_DESC="Wireless network monitoring tool"
7 MAINTAINER="domcox@users.sourceforge.net"
8 DEPENDS="dbus libnl libpcap ncurses"
9 BUILD_DEPENDS="dbus-dev libnl-dev ncurses-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.kismetwireless.net"
12 WGET_URL="http://www.kismetwireless.net/code/$TARBALL"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 cd $src
18 ./configure \
19 --prefix=/usr \
20 --infodir=/usr/share/info \
21 --mandir=/usr/share/man \
22 --sysconfdir=/etc/kismet \
23 $CONFIGURE_ARGS && \
24 make && \
25 make DESTDIR=$PWD/_pkg 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 mkdir -p $fs/etc
34 cp -a $_pkg/etc/kismet $fs/etc
35 # not overwrite existing configuration
36 mv $fs/etc/kismet/kismet.conf $fs/etc/kismet/kismet.conf.new
37 mv $fs/etc/kismet/kismet_ui.conf $fs/etc/kismet/kismet_ui.conf.new
38 mv $fs/etc/kismet/kismet_drone.conf $fs/etc/kismet/kismet_drone.conf.new
39 # disable sound
40 sed -i 's/sound=true/sound=false/' $fs/etc/kismet/kismet_ui.conf.new
41 }
43 post_install()
44 {
45 # addgroup kismet if needed
46 if ! grep -q kismet $1/etc/group; then
47 echo -n "Adding group kismet..."
48 chroot $1/ addgroup kismet
49 status
50 fi
51 # Add tux to kismet group
52 chroot $1/ addgroup tux kismet
53 # set Kismet as suid-root
54 echo -n "Set Kismet as suid-root.."
55 chroot $1/ chown root:kismet /usr/bin/kismet_capture && \
56 chroot $1/ chmod 4550 /usr/bin/kismet_capture
57 status
58 # configuration files update
59 create=1
60 overwrite=2
61 keep=3
62 cd $1/etc/kismet
63 for file in "kismet" "kismet_ui" "kismet_drone"
64 do
65 # check current files version
66 if [ ! -e $file.conf ]; then
67 action=$create
68 else
69 current=`grep version= $file.conf`
70 new=`grep version= $file.conf.new`
71 if [ "$current" = "$new" ]; then
72 action=$keep
73 else
74 action=$overwrite
75 fi
76 fi
77 # update if needed
78 case $action in
79 $create)
80 mv $file.conf.new $file.conf
81 ;;
82 $keep)
83 rm $file.conf.new
84 warning="keep"
85 ;;
86 $overwrite)
87 mv $file.conf $file.conf.oldpkg
88 mv $file.conf.new $file.conf
89 warning=$overwrite
90 echo "Warning: /etc/kismet/$file.conf new version from upstream"
91 ;;
92 esac
93 done
94 if [ "$warning" != "keep" ]; then
95 echo "-----"
96 echo "You MUST edit etc/kismet/kismet.conf and configure Kismet"
97 echo "for your system, or it will NOT run properly!"
98 fi
99 }
101 post_remove()
102 {
103 delgroup kismet
104 rm -rf /etc/kismet
105 }