PKGBUILD 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Maintainer (Arch): Bartłomiej Piotrowski <bpiotrowski@mirantis.com>
  2. # Contributor (Arch): Thomas Bächler <thomas@archlinux.org>
  3. # Maintainer: André Silva <emulatorman@hyperbola.info>
  4. # Contributor: Márcio Silva <coadde@hyperbola.info>
  5. # Contributor: Tobias Dausend <throgh@hyperbola.info>
  6. pkgname=libpcap
  7. pkgver=1.10.3
  8. _debver=$pkgver
  9. _debrel=1
  10. pkgrel=1
  11. pkgdesc="A system-independent interface for user-level packet capture"
  12. arch=('i686' 'x86_64')
  13. url='https://www.tcpdump.org/'
  14. license=('Modified-BSD')
  15. depends=('sh')
  16. makedepends=('flex' 'quilt')
  17. source=("https://www.tcpdump.org/release/${pkgname}-${pkgver}.tar.gz"
  18. "https://deb.debian.org/debian/pool/main/libp/libpcap/libpcap_${_debver}-${_debrel}.debian.tar.xz"
  19. "CVE-2024-8006.patch")
  20. sha512sums=('57bc07cbc8c326e203ce10ce1eb9f55760fc33320718d8643c65a68949334291877dffcf19af5f61eb9b4eda2d8ffe7bacee38363d2d6536cc85ae81c851684d'
  21. 'bd8fb0c2a801d38dc7e1a1581eb2721750d13dff3352939ebe6c0665834f38f6c8d0782d8b42305904bceeaf72d7d6297fa70d110ebb6b3ab4adbe72e6733103'
  22. '3c9d35142724e03a6bd3a5df33854df6e19a91c16e0c10d6cd41bbf54598cffd2ea282f035c1b47cc7547822350089d1f2515afa728464816f7e70a90310afc9')
  23. prepare() {
  24. cd $pkgname-$pkgver
  25. if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
  26. # Debian patches
  27. export QUILT_PATCHES=debian/patches
  28. export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  29. export QUILT_DIFF_ARGS='--no-timestamps'
  30. mv "$srcdir"/debian .
  31. # Doesn't apply
  32. rm -v debian/patches/hurd.diff || true
  33. rm -v debian/patches/kfreebsd.diff || true
  34. rm -v debian/patches/shared-lib.diff || true
  35. quilt push -av
  36. fi
  37. patch -Np1 -i ${srcdir}/CVE-2024-8006.patch
  38. }
  39. build() {
  40. cd $pkgname-$pkgver
  41. ./configure --prefix=/usr \
  42. --enable-ipv6 \
  43. --disable-bluetooth \
  44. --disable-usb \
  45. --disable-dbus \
  46. --without-libnl
  47. make
  48. }
  49. package() {
  50. cd $pkgname-$pkgver
  51. install -d -m755 "$pkgdir"/usr/bin
  52. make DESTDIR="$pkgdir" install
  53. install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
  54. # backwards compatibility, programs often look for net/bpf.h
  55. mkdir -p "$pkgdir/usr/include/net"
  56. cd "$pkgdir/usr/include/net"
  57. ln -s ../pcap-bpf.h bpf.h
  58. }