summaryrefslogtreecommitdiff
path: root/community/arpwatch/PKGBUILD
blob: 9187b0b504e366e69f7697568158f37a2e37a25a (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
49
50
51
52
# $Id: PKGBUILD 102230 2013-12-07 00:44:42Z seblu $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sébastien Luttringer

pkgname=arpwatch
pkgver=2.1a15
pkgrel=13
pkgdesc='Ethernet/FDDI station activity monitor'
arch=('i686' 'x86_64')
url='ftp://ftp.ee.lbl.gov/'
license=('BSD')
depends=('libpcap' 'smtp-forwarder')
source=("ftp://ftp.ee.lbl.gov/$pkgname-$pkgver.tar.gz"
        'ethercodes.dat.xz'
        'LICENSE'
        "$pkgname.service")
md5sums=('cebfeb99c4a7c2a6cee2564770415fe7'
         'c5abd91d8852f68bf5bf49ed9e80dba0'
         '9359518c500562281e76cdb0b2fa9062'
         '43e2358ba0532da38e5296250a7fcfd8')

prepare() {
  cd $pkgname-$pkgver
  # move arp database in /var/lib/arpwatch
  # /var is used because arpwatch write its learned mac into this folder
  sed -i 's|ARPDIR = $(prefix)/arpwatch|ARPDIR = /var/lib/arpwatch|' Makefile.in
  # binary ownership to root
  sed -i 's/-\(o\|g\) bin/-\1 root/g' Makefile.in
  # Update ethercodes with recent OUI. See gen_ethercodes.sh
  cp -f "$srcdir/ethercodes.dat" ethercodes.dat
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --mandir=/usr/share/man --sbindir=/usr/bin
  make SENDMAIL=/usr/bin/sendmail
}

package() {
  cd $pkgname-$pkgver
  install -d -m 0755 "$pkgdir"/usr/{bin,share/man/man8}
  make DESTDIR="$pkgdir" install install-man
  # install ether prefix database
  install -Dm644 ethercodes.dat "$pkgdir/var/lib/$pkgname/ethercodes.dat"
  cd "$srcdir"
  # license
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # systemd
  install -Dm644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname@.service"
}

# vim:set ts=2 sw=2 et: