summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5288588a7d70a4ddf096c24efe30da08e7917a69 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=libpcap-git
pkgver=1.10.4.r782.g6c6198ad
pkgrel=1
pkgdesc="A portable C/C++ library for network traffic capture"
arch=('i686' 'x86_64')
url="https://www.tcpdump.org/"
license=('BSD')
depends=('glibc' 'dbus' 'libnl')
makedepends=('git' 'bluez-libs')
provides=("libpcap=$pkgver" 'libpcap.so')
conflicts=('libpcap')
options=('staticlibs')
source=("git+https://github.com/the-tcpdump-group/libpcap.git")
sha256sums=('SKIP')


pkgver() {
  cd "libpcap"

  _tag=$(git tag -l --sort -creatordate | grep -E '^libpcap-[0-9\.]+$' | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^libpcap-//'
}

build() {
  cd "libpcap"

  autoreconf -fi
  ./configure \
    --prefix="/usr"
  make
}

check() {
  cd "libpcap"

  make tests
}

package() {
  cd "libpcap"

  make DESTDIR="$pkgdir" install
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/libpcap"
}