summaryrefslogtreecommitdiffstats
path: root/abs/core/libpcap/PKGBUILD
blob: ddafe528e8fe209652f05def2a9b9757dd8b5c0c (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
# $Id: PKGBUILD 162746 2012-06-29 11:46:18Z thomas $
# Maintainer: Thomas Bächler <thomas@archlinux.org>

pkgname=libpcap
pkgver=1.3.0
pkgrel=1
pkgdesc="A system-independent interface for user-level packet capture"
arch=('i686' 'x86_64')
url="http://www.tcpdump.org/"
license=('BSD')
depends=('glibc' 'libnl' 'sh' 'libusbx')
makedepends=('flex')
source=(http://www.tcpdump.org/release/libpcap-${pkgver}.tar.gz{,.sig}
        libnl32.patch)

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -Np1 -i "${srcdir}/libnl32.patch"
  autoreconf -f -i
  ./configure --prefix=/usr --enable-ipv6 --with-libnl
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  install -d -m755 ${pkgdir}/usr/bin
  make DESTDIR=${pkgdir} install
  # remove static library
  rm -rf ${pkgdir}/usr/lib/libpcap.a
  
  # 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

  #install the license
  install -D -m644 ${srcdir}/$pkgname-$pkgver/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
}
md5sums=('f78455a92622b7a3c05c58b6ad1cec7e'
         'acf4f6ed8c7839dc935e807a2731316e'
         'd2c8c21d69d90d6370022583bfb29cf2')