summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 11ee40dc24b72ed726f25d879f8a7a9e1a7accaa (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
# Maintainer: László Várady <laszlo.varady93@gmail.com>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=syslog-ng-git
_pkgname=syslog-ng
pkgver=3.34.1.r22.ge18982343
pkgrel=1
pkgdesc="Enhanced system logging daemon"
arch=('x86_64')
url="https://www.syslog-ng.com/products/open-source-log-management/"
license=('GPL2' 'LGPL2.1')
depends=('systemd-libs' 'awk' 'glib2' 'ivykis' 'openssl' 'pcre' 'json-c' 'curl' 'libnet')
makedepends=('git' 'autoconf-archive' 'libxslt' 'docbook-xsl' 'json-c' 'curl' 'libdbi' 'libesmtp'
             'hiredis' 'librabbitmq-c' 'riemann-c-client' 'libmaxminddb' 'mongo-c-driver'
             'net-snmp' 'librdkafka' 'paho-mqtt-c' 'python' 'systemd')
checkdepends=('criterion' 'python-nose' 'python-ply')
optdepends=('logrotate: for rotating log files'
            'json-c: for the JSON plugin'
            'curl: for the HTTP plugin'
            'libdbi: for the SQL plugin'
            'libesmtp: for the SMTP plugin'
            'hiredis: for the Redis plugin'
            'librabbitmq-c: for the AMQP plugin'
            'riemann-c-client: for the Riemann plugin'
            'libmaxminddb: for the GeoIP2 plugin'
            'mongo-c-driver: for the MongoDB plugin'
            'net-snmp: for the SNMP plugin'
            'librdkafka: for the Kafka C plugin'
            'paho-mqtt-c: for the MQTT plugin'
            'python: for Python-based plugins')
provides=("$_pkgname")
conflicts=("$_pkgname" 'eventlog')
replaces=('eventlog')
backup=('etc/syslog-ng/scl.conf'
        'etc/syslog-ng/syslog-ng.conf'
        'etc/logrotate.d/syslog-ng'
        'etc/default/syslog-ng@default')
source=("$_pkgname::git+https://github.com/balabit/syslog-ng.git"
        'syslog-ng.logrotate')
sha256sums=('SKIP' 'SKIP')

pkgver() {
  cd "$_pkgname"
  printf "%s" "$(git describe --long --tags --match "syslog-ng-*" \
                 | sed 's/^syslog-ng-//; s/\([^-]*-g\)/r\1/; s/-/./g')"
}

prepare() {
  cd "$_pkgname"
  sed -i -e 's,/bin/,/usr/bin/,' -e 's,/sbin/,/bin/,' contrib/systemd/syslog-ng@.service
  sed -i -e 's|/var/run|/run|g' contrib/systemd/syslog-ng@default
}

build() {
  cd "$_pkgname"
  skip_submodules=1 ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc/syslog-ng --libexecdir=/usr/lib \
    --sbindir=/usr/bin --localstatedir=/var/lib/syslog-ng --datadir=/usr/share \
    --with-pidfile-dir=/run --with-jsonc=system --with-ivykis=system \
    --enable-all-modules --enable-ipv6 --enable-pacct --enable-manpages \
    --enable-systemd --with-systemdsystemunitdir=/usr/lib/systemd/system \
    --disable-java --disable-java-modules
  make
}

check() {
  cd "$_pkgname"
  make --keep-going check || /usr/bin/true
}

package() {
  make -C $_pkgname DESTDIR="$pkgdir/" install
  install -dm755 "$pkgdir/var/lib/syslog-ng" "$pkgdir/etc/syslog-ng/patterndb.d"
  install -Dm644 "$srcdir/syslog-ng.logrotate" "$pkgdir/etc/logrotate.d/syslog-ng"
  install -Dm644 "$srcdir/$_pkgname/contrib/systemd/syslog-ng@default" -t "$pkgdir/etc/default"
}