summaryrefslogtreecommitdiffstats
path: root/abs/core/libpcap/PKGBUILD
blob: fe3a122ea0d0c01f706cc1071b7a74ec168ef64b (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
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@mirantis.com>
# Contributor: Thomas Bächler <thomas@archlinux.org>

pkgname=libpcap
pkgver=1.9.1
pkgrel=2
pkgdesc='A system-independent interface for user-level packet capture'
arch=('x86_64')
url='https://www.tcpdump.org/'
license=('BSD')
depends=('glibc' 'libnl' 'sh' 'libusbx' 'dbus')
makedepends=('flex' 'bluez-libs')
source=(https://www.tcpdump.org/release/libpcap-${pkgver}.tar.gz{,.sig}
        mgmt.h)
validpgpkeys=('1F166A5742ABB9E0249A8D30E089DEF1D9C15D0D') # The Tcpdump Group
sha256sums=('635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094'
            'SKIP'
            '7c85da5330ce7ecb6934795c02c652b9e344461302cf74804a4692c3e2e1e7e2')

prepare() {
  mkdir -p include/bluetooth
  cp mgmt.h include/bluetooth/
}

build() {
  cd $pkgname-$pkgver
  CFLAGS="$CFLAGS -I${srcdir}/include $(pkg-config libnl-genl-3.0 --cflags)" \
  ./configure --prefix=/usr \
    --enable-ipv6 \
    --enable-bluetooth \
    --with-libnl
  make
}

package() {
  cd $pkgname-$pkgver
  install -d -m755 "$pkgdir"/usr/bin
  make DESTDIR="$pkgdir" install
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # backwards compatibility, programs often look for net/bpf.h
  mkdir -p "$pkgdir/usr/include/net"
  cd "$pkgdir/usr/include/net"
  ln -s ../pcap-bpf.h bpf.h
}