jobextra/syslog-ng/PKGBUILD

128 lines
4.8 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=syslog-ng
pkgver=4.6.0
pkgrel=01
pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities - w/o google's grpc systemd and ipv6"
url="https://www.syslog-ng.com/products/open-source-log-management/"
depends=('awk' 'glib2' 'libnsl' 'json-c' 'curl' 'libnet' 'openssl' 'pcre2' 'protobuf' 'libcap')
makedepends=('libxslt' 'mongo-c-driver' 'librabbitmq-c' 'python' 'libesmtp' 'hiredis'
'libdbi' 'libmaxminddb' 'net-snmp' 'librdkafka')
checkdepends=('python-nose' 'python-ply')
optdepends=('logrotate: for rotating log files'
'libdbi: for the SQL plugin'
'librabbitmq-c: for the AMQP plugin'
'mongo-c-driver: for the MongoDB plugin'
'libesmtp: for the SMTP plugin'
'hiredis: for the Redis plugin'
'libmaxminddb: for the GeoIP2 plugin'
'net-snmp: for the SNMP plugin'
'librdkafka: for the Kafka C plugin'
'python: for Python-based plugins'
'python-ply: for debugger CLI')
conflicts=('eventlog')
replaces=('eventlog')
backup=('etc/syslog-ng/scl.conf'
'etc/syslog-ng/syslog-ng.conf'
'etc/logrotate.d/syslog-ng'
'etc/default/syslog-ng')
source=(https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$pkgver/$pkgname-$pkgver.tar.gz
syslog-ng.conf syslog-ng.logrotate)
prepare() {
cd $pkgname-$pkgver
# 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
# _source_version=$(sed -rn 's#.*define VERSION_STR_CURRENT.* "(.*)"#\1#p' lib/versioning.h)
# _config_version=$(head -1 "$srcdir/syslog-ng.conf" | cut -d\ -f2)
#
# if [[ "$_source_version" != "$_config_version" ]]; then
# echo "Version in example config at '$srcdir/syslog-ng.conf' is: $_config_version"
# echo "Expected version from code is: $_source_version"
# echo "Check if config format has incompatible changes and adjust the"
# echo "example config file and bump the version to continue the build."
# echo "Usually simply bumping is fine since our config is simple enough"
# return 1
# fi
}
build() {
cd $pkgname-$pkgver
# https://archlinux.org/todo/lto-fat-objects/
export CFLAGS+=" -ffat-lto-objects"
export CXXFLAGS+=" -ffat-lto-objects"
./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 \
--enable-spoof-source \
--disable-ipv6 \
--disable-systemd \
--disable-grpc \
--with-systemdsystemunitdir=no \
--enable-manpages \
--enable-all-modules \
--disable-java \
--disable-java-modules \
--disable-mqtt \
--disable-riemann \
--with-python=3 \
--with-jsonc=system
# prevent excessive overlinking due to libtool
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
# TODO: package criterion
check() {
cd $pkgname-$pkgver
make check || /usr/bin/true # unit test requires criterion
}
package() {
make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
install -dm755 "$pkgdir/var/lib/syslog-ng" "$pkgdir/etc/syslog-ng/patterndb.d"
install -Dm644 "$srcdir/syslog-ng.conf" "$pkgdir/etc/syslog-ng/syslog-ng.conf"
install -Dm644 "$srcdir/syslog-ng.logrotate" "$pkgdir/etc/logrotate.d/syslog-ng"
install -Dm644 "$srcdir"/$pkgname-$pkgver/contrib/systemd/syslog-ng@default "$pkgdir"/etc/default/syslog-ng
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=('GPL2' 'LGPL2.1')
sha512sums=('7c4fbf1ac5377240afa7a1db8d72772399d2c62657fffc3c59e82b2dea6f12031f02320c4f567f981311bd1d8bbfd98962aeb59720ca857867a51b6bf83afb4b'
'432154be20858721c2dcfee65a608cb65760479c9b78b7751fa1e00fc0276c1b34bdff8bc1bee8a6e5c0138f3034531034401fcbb9cc3c70f1b984225a9c6240'
'cd39f545a6a855c866a466bf846e33940b2c2dd1fc2eaf50cce29c68e1a5753c7c4b56411e4f01c152f32e155104a98dd755a96319767f47c73a8853f720b2cc')
sha256sums=(b69e3360dfb96a754a4e1cbead4daef37128b1152a23572356db4ab64a475d4f # syslog-ng-4.6.0.tar.gz
5b6df307e2cc204d83ae8a76fb9d27ea544b5fd3f514ac3119148f2d8e34d8f0 # syslog-ng.conf
93c935eca56854011ea9e353b7a1da662ad40b2e8452954c5b4b5a1d5b2d5317) # syslog-ng.logrotate
## See the error log ... we have had enough with this crappy software ...
## Now it is not just speaking out of the system, it is mixing ipv6 to ipv4 connections when
## we configured ipv6 to be disabled.
## For a syslog this is TOO MUCH!!!!
## Out it goes, use socklog