p0f 3 rc3

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
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Michal Zalewski <lcamtuf[at]coredump[dot]cx>
# Contributor: cbreaker <cbreaker[at]tlen[dot]pl>]

_p0ftools=n	# additional tools: p0f-client & p0f-sendsyn, write y if you want them to be added
_p0ftools6=n	# additional tool: p0f-sendsyn6 (ipv6 p0f-sendsyn), write y if you want to add it into package

pkgname=p0f
pkgver=3.00_rc3
pkgrel=2
pkgdesc="Purely passive TCP/IP traffic fingerprinting tool "
url="http://lcamtuf.coredump.cx/p0f3/"
arch=('x86_64' 'i686')
license=('GPLv3')
depends=('libpcap')
source=("http://lcamtuf.coredump.cx/p0f3/p0f-3.00-rc3.tgz")
md5sums=('ec4fe47f484c7e03670d4370f174bfb3')

build() {
  cd "${srcdir}"
  mv p0f-3.00-rc3 "${pkgname}-${pkgver}"
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -e 's/"p0f.fp"/"\/etc\/p0f\/p0f.fp"/g' -i config.h
  make

  ## additional tools
  if [ $_p0ftools = "y" ]; then
   cd "${srcdir}/${pkgname}-${pkgver}/tools"
   make p0f-client
   make p0f-sendsyn
  fi
  if [ $_p0ftools6 = "y" ]; then
   cd "${srcdir}/${pkgname}-${pkgver}/tools"
   make p0f-sendsyn6
  fi
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -d -Dm755 ${pkgdir}/usr/sbin
  install -d -Dm755 ${pkgdir}/etc/p0f
  install -d -Dm755 ${pkgdir}/usr/share/licenses/${pkgname}
  install -d -Dm755 ${pkgdir}/usr/share/doc/${pkgname}

  install -m744 p0f ${pkgdir}/usr/sbin
  install -m755 p0f.fp ${pkgdir}/etc/p0f
  install -D -m644 docs/COPYING ${pkgdir}/usr/share/licenses/${pkgname}
  install -D -m644 docs/README ${pkgdir}/usr/share/doc/${pkgname}

  ## additional tools
  if [ $_p0ftools = "y" ]; then
   install -m744 ${srcdir}/${pkgname}-${pkgver}/tools/p0f-client ${pkgdir}/usr/sbin
   install -m744 ${srcdir}/${pkgname}-${pkgver}/tools/p0f-sendsyn ${pkgdir}/usr/sbin
  fi
  if [ $_p0ftools6 = "y" ]; then
   install -m744 ${srcdir}/${pkgname}-${pkgver}/tools/p0f-sendsyn6 ${pkgdir}/usr/sbin
  fi

  warning "no man page available, README is at /usr/share/doc/${pkgname}/README"
}