summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 75173b2cb666bf5076cb84be04b1d53c4fbcca45 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# shellcheck disable=SC2034,SC2154,SC2164
pkgname=('ulogd-git')
_srcname='ulogd'
pkgdesc='Userspace logging daemon for netfilter/iptables related logging'
pkgver='r1'
pkgrel='1'
arch=('i686' 'x86_64')
url='http://www.netfilter.org/projects/ulogd/index.html'
license=('GPL2')

depends=(
    'libmnl'
    'libnetfilter_acct'
    'libnetfilter_conntrack'
    'libnetfilter_log'
    'libnfnetlink'
)
makedepends=(
    'git'
    'libmariadbclient'
    'libpcap'
    'libdbi'
    'postgresql-libs'
    'sqlite'
    'jansson'
)
optdepends=(
    'libmariadbclient: MySQL databases support'
    'sqlite: SQLite3 databases support'
    'postgresql-libs: PostgreSQL databases support'
    'libdbi: DBI abstraction databases support'
    'libpcap: PCAP output support'
    'jansson: JSON output support'
)
provides=("${pkgname[0]%-git}")
conflicts=("${pkgname[0]%-git}")

source=(
    "${_srcname}::git+git://git.netfilter.org/ulogd2"
    'ulogd.service'
    'ulogd.logrotate'
    'ulogd.conf'
)
sha512sums=(
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
)

backup=('etc/ulogd.conf')

pkgver() {
    cd "${srcdir}/${_srcname}"

    printf 'r%s.%s.%s\n' \
        "$( git rev-list --count 'HEAD' )" \
        "$( git log --max-count='1' --pretty='format:%ct' )" \
        "$( git rev-parse --short 'HEAD' )"
}

build() {
    cd "${srcdir}/${_srcname}"

    autoreconf --install --force --warnings='all'
    ./configure \
        --prefix='/usr' \
        --sbindir='/usr/bin' \
        --sysconfdir='/etc' \
        --with-mysql \
        --with-pgsql \
        --with-dbi

    make
}

package() {
    cd "${srcdir}/${_srcname}"

    make DESTDIR="${pkgdir}" install

    install --directory "${pkgdir}/usr/share/doc/ulogd"
    install --mode='644' ulogd.conf doc/*.{table,sql} "${pkgdir}/usr/share/doc/ulogd/"

    cd "${srcdir}"
    install -D --mode='644' ulogd.service "${pkgdir}/usr/lib/systemd/system/ulogd.service"
    install -D --mode='644' ulogd.logrotate "${pkgdir}/etc/logrotate.d/ulogd"
    install -D --mode='644' ulogd.conf "${pkgdir}/etc/ulogd.conf"
}