summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18a99e8cd1f61375ac2fe2e7d748df02d55db64a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Maintainer: Alexander Paetzelt <techge+arch [ät] posteo [do] net>
# parts are based on [extra] packet 'kismet' -> https://www.archlinux.org/packages/extra/x86_64/kismet/

pkgname=kismet-git
pkgver=r9339.de354712
pkgrel=1
pkgdesc="802.11 layer2 wireless network detector, sniffer, and intrusion detection system"
url="https://www.kismetwireless.net/"
arch=('x86_64')
license=('GPL')
depends=('libmicrohttpd'
         'libnm'
         'libusb'
         'libusb-1.0.so'
         'lm_sensors'
         'protobuf-c'
         'python')
makedepends=('git' 'python-setuptools')
optdepends=('festival: text-to-speech support'
            'flite:  alternative/lightweight text-to-speech support'
            'gpsd: log coordinates of detected networks'
            'hackrf: use with HackRF compatible software defined radio (SDR)'
            'python-numpy: needed by some captures/plugins'
            'python-protobuf: needed by some captures/plugins'
            'python-pyserial: needed by some captures/plugins'
            'sox: provide the default kismet sound playback binary'
            'wireshark-cli: provide OUI files used to determine device manufacturer'
            'wireshark-cli: mergecap, to merge multiple capture files')
backup=(etc/kismet/kismet.conf
        etc/kismet/kismet_80211.conf
        etc/kismet/kismet_alerts.conf
        etc/kismet/kismet_filter.conf
        etc/kismet/kismet_httpd.conf
        etc/kismet/kismet_logging.conf
        etc/kismet/kismet_memory.conf
        etc/kismet/kismet_storage.conf
        etc/kismet/kismet_uav.conf)
conflicts=('kismet')
install=${pkgname}.install
source=("git+https://github.com/kismetwireless/kismet"
        "${pkgname}-sysusers.conf"
        "python-install-flags.patch")
sha256sums=('SKIP'
            'fbc444b9973795c105eff41e914c3fcc24ba07e4f309838828622d7a65201d2f'
            '3155f457bdc762202f28f56f55c61352332a639cddd5948c0879ed4ba79a7ed5')

pkgver() {
  cd "$srcdir/kismet"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/kismet"
    patch -Np0 < ../python-install-flags.patch
    autoreconf -fiv
    # include submodule for docs
    git submodule update --init docs
}

build() {
    cd "$srcdir/kismet"
    ./configure --prefix=/usr \
                --localstatedir=/var \
                --sysconfdir=/etc/kismet
    make all plugins
}

package() {
    cd "$srcdir/kismet"
    make DESTDIR="$pkgdir/" install
    
    # Makepkg strip bug #43600
    chmod u+w "${pkgdir}"/usr/bin/kismet*
    chmod o-x "${pkgdir}"/usr/bin/kismet_cap*
    chown 0:315 "${pkgdir}"/usr/bin/kismet_cap*

    # include docs in /usr/share/doc/
    mkdir -p ${pkgdir}/usr/share/doc/$pkgname
    cp -r docs/* "$pkgdir/usr/share/doc/$pkgname/"

    # create group kismet via sysusers
    cd "$srcdir"
    install -vDm 644 "${pkgname}-sysusers.conf" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
}