summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2fa6ea2e03d5ab9db25840950c364521c4e4108a (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
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Alexandr B <4le34n at gmail dot com>

pkgname=nfsen
pkgver=1.3.8
pkgrel=3
pkgdesc="Netflow visualisation and investigation tool"
arch=('i686' 'x86_64')
url="https://sourceforge.net/projects/nfsen"
license=('BSD')
depends=('nfdump>=1.6.1'
         'perl>=5.10.1'
         'perl-mailtools'
         'perl-socket6'
         'php>4.1' 
         'rrdtool')
optdepends=('apache' 'nginx' 'php-apache' 'php-fpm')
backup=('etc/nfsen.conf')
source=("$url/files/stable/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz"
        'nfsen.conf'
        'nginx'
        'service'
        'tmpfiles')
install='install'

prepare() {
	cd "$pkgname-$pkgver"
        sed -i 's|%%PERL%%|/usr/bin/perl|' bin/* libexec/* plugins/backend/*.pm plugins/*.pm
        sed -i 's|%%LIBEXECDIR%%|/opt/nfsen/libexec|' bin/* plugins/backend/*.pm plugins/*.pm
        sed -i 's|%%CONFDIR%%|/etc|' libexec/*
}

package() {
	cd "$pkgname-$pkgver"

        install -d "$pkgdir/opt/$pkgname/plugins"
        install -d "$pkgdir/usr/share/webapps/$pkgname/plugins"
        install -d "$pkgdir/var/lib/nfsen/filters"
        install -d "$pkgdir/var/lib/nfsen/fmt"
        install -d "$pkgdir/var/lib/nfsen/profiles-stat"
        install -d "$pkgdir/var/lib/nfsen/profiles-data"
        cp -a bin "$pkgdir/opt/$pkgname"
        cp -a libexec "$pkgdir/opt/$pkgname"
        cp -a plugins/backend/* "$pkgdir/opt/$pkgname/plugins"
        cp -a contrib/PortTracker/PortTracker.pm "$pkgdir/opt/$pkgname/plugins"
        cp -a plugins/PluginTemplate.pm "$pkgdir/opt/$pkgname/plugins"
        cp -a plugins/frontend/* "$pkgdir/usr/share/webapps/$pkgname/plugins"
        cp -a contrib/PortTracker/PortTracker.php "$pkgdir/usr/share/webapps/$pkgname/plugins"
        cp -a ./html/* "$pkgdir/usr/share/webapps/$pkgname"
        chown http:http ${pkgdir}/usr/share/webapps/$pkgname # write access for http user
	install -Dm644 "$srcdir/service" "$pkgdir/usr/lib/systemd/system/nfsen.service" 
	install -Dm644 "$srcdir/tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/nfsen.conf" 
	install -Dm644 BSD-license.txt "$pkgdir/usr/share/license/$pkgname/BSD-license.txt" 
	install -Dm644 ChangeLog "$pkgdir/usr/share/doc/$pkgname/ChangeLog" 
	install -Dm644 README "$pkgdir/usr/share/doc/$pkgname/README" 
	install -Dm644 README.plugins "$pkgdir/usr/share/doc/$pkgname/README.plugins" 
	install -Dm644 "$srcdir/nfsen.conf" "$pkgdir/etc/nfsen.conf"
	install -Dm644 "$srcdir/nginx" "$pkgdir/etc/nginx/sites-available/nginx"
}
md5sums=('fc45b3f44a66c2ed65d1269e479c2414'
         'fa81120f06b2dbcfc97c73c06b0718f6'
         'e8ffd8c767aca866050d679b609a0db9'
         '69898397995d35b1d53d6a61b16b24a8'
         'd60d7334fb00e85ea3230f059ae660aa')