wok view kismet/receipt @ rev 3626

kismet: build fix
author Dominique Corbex <domcox@users.sourceforge.net>
date Wed Jul 01 09:13:57 2009 +0200 (2009-07-01)
parents c2a82e984d39
children 9bac91257596
line source
1 # SliTaz package receipt.
3 PACKAGE="kismet"
4 VERSION="2009-06-R1"
5 CATEGORY="network"
6 SHORT_DESC="Wireless network monitoring tool"
7 MAINTAINER="domcox@users.sourceforge.net"
8 DEPENDS="dbus libnl libpcap ncurses pcre"
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"
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 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 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 }