summaryrefslogtreecommitdiff
path: root/community/ngrep/PKGBUILD
blob: 16cd1ab75171edea878cd49ff5bd336e59fef89f (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
# $Id: PKGBUILD 66459 2012-02-25 02:54:09Z lfleischer $
# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=ngrep
pkgver=1.45
pkgrel=9.1
pkgdesc='A grep-like utility that allows you to search for network packets on an interface.'
arch=('i686' 'x86_64' 'mips64el')
url='http://ngrep.sourceforge.net/'
license=('custom')
depends=('libpcap>=1.0.0' 'pcre')
# Fix build failure when using "-j" (FS#27091).
options=(!makeflags)
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
        'ngrep-1.45-fix-ipv6.patch'
        'ngrep-1.45-use-system-pcre.patch')
md5sums=('bc8150331601f3b869549c94866b4f1c'
         '524ee2e0d9ff3c6a262eca836ddf63ed'
         'c546da1e47d3e8bddc7678c81a22a6b7')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # add patch for broken ipv6 support (FS#27225)
  patch -Np1 -i "$srcdir/ngrep-1.45-fix-ipv6.patch"

  # use system PCRE (FS#27225)
  patch -Np1 -i "$srcdir/ngrep-1.45-use-system-pcre.patch"
  autoreconf

  export EXTRA_INCLUDES=$(pcre-config --cflags)
  export EXTRA_LIBS=$(pcre-config --libs)
  ./configure --prefix=/usr --with-pcap-includes=/usr/include/pcap --enable-ipv6 --enable-pcre
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
  install -Dm0644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}