summaryrefslogtreecommitdiff
path: root/community/ntop/PKGBUILD
blob: 4274b6ac5e52363a65db951d2e568f88451d1927 (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
# $Id: PKGBUILD 99930 2013-10-31 02:32:10Z allan $
# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=ntop
pkgver=5.0.1
pkgrel=4
pkgdesc='A network traffic probe that shows the network usage.'
arch=('i686' 'x86_64')
url='http://www.ntop.org/'
license=('GPL')
depends=('libevent' 'libpcap' 'gd' 'glibc' 'libxml2' 'openssl' 'rrdtool' 'pcre' 'geoip' 'lua' 'python2')
makedepends=('subversion' 'wget' 'ca-certificates')
options=('!makeflags')
install='ntop.install'
source=("http://sourceforge.net/projects/${pkgname}/files/${pkgname}/Stable/${pkgname}-${pkgver}.tar.gz"
        'ntop.service')
md5sums=('01710b6925a8a5ffe1a41b8b512ebd69'
         '0e149d20f881600e8387d850ac268483')

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

  # Python2 fix
  find . -type f | xargs sed -i 's@^#!.*python$@#!/usr/bin/python2@'
  sed -i 's/python-config/python2-config/' configure.in
}

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

  ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --disable-snmp
  make
}

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

  make DESTDIR="${pkgdir}" install-recursive

  install -dm0755 -o nobody -g nobody "${pkgdir}/var/lib/ntop"
  install -dm0755 -o nobody -g nobody "${pkgdir}/var/lib/ntop/rrd"

  for _f in "${pkgdir}/usr/lib/ntop/plugins/"*.so; do
    _plug="$(basename ${_f})"
    ln -sf "../../lib${_plug}" "${_f}"
  done

  install -Dm0644 "${srcdir}/ntop.service" "${pkgdir}/usr/lib/systemd/system/ntop.service"
}