summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45449ba39372d619982a0696ab0178f99eec205b (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
# Maintainer: skogler

pkgname=barnyard2-git
pkgver=r166.f9186f2
pkgrel=1
pkgdesc="A dedicated spooler for Snort's unified2 binary output format."
arch=('i686' 'x86_64')
url="http://www.github.com/firnsy/barnyard2"
license=('GPL')
depends=('libpcap' 'libmariadbclient' 'snort')
options=()
provides=('barnyard2')
conflicts=('barnyard2')
install=barnyard2.install
source=('barnyard2::git+https://github.com/firnsy/barnyard2.git'
        'barnyard2@.service')
md5sums=('SKIP'
         '1cadc9bb8c5147cd41977dce2a226c40')

pkgver() {
  cd "barnyard2"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "barnyard2"
    ./autogen.sh
    ./configure --prefix=/usr --sysconfdir=/etc/ --with-mysql --with-mysql-libraries=/usr/lib/
    make
}

check() {
    cd "barnyard2"
    make -k check
}

package() {
    cd "barnyard2"
    make DESTDIR="$pkgdir/" install
    chmod 644 "$pkgdir/etc/barnyard2.conf"
    install -d -m755 "$pkgdir/var/log/barnyard2"
    install -d -m755 "$pkgdir/var/log/snort"

    install -D -m644 '../barnyard2@.service' "$pkgdir/usr/lib/systemd/system/barnyard2@.service"

    touch "$pkgdir/var/log/snort/barnyard2.waldo"
    chmod 644 "$pkgdir/var/log/snort/barnyard2.waldo"
    sed -i 's#/etc/snort/sid-msg.map#/etc/snort/rules/sid-msg.map#' "$pkgdir/etc/barnyard2.conf"

}