From 4e54d618884514a75adc389225c1bcb191d1a270 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 24 Apr 2021 01:20:57 +0200 Subject: [PATCH] Update WIP syslog recipe. --- wip/syslog-ng/APKBUILD | 178 ----------------------------------------- wip/syslog-ng/FIXME | 13 +++ wip/syslog-ng/Makefile | 72 +++++++++++++++++ 3 files changed, 85 insertions(+), 178 deletions(-) delete mode 100644 wip/syslog-ng/APKBUILD create mode 100644 wip/syslog-ng/FIXME create mode 100644 wip/syslog-ng/Makefile diff --git a/wip/syslog-ng/APKBUILD b/wip/syslog-ng/APKBUILD deleted file mode 100644 index a1ecc82..0000000 --- a/wip/syslog-ng/APKBUILD +++ /dev/null @@ -1,178 +0,0 @@ -# Contributor: Michael Pirogov -# Contributor: jv -# Contributor: Adrian Guenter -# Contributor: Jakub Jirutka -# Maintainer: jv -pkgname=syslog-ng -pkgver=3.30.1 -pkgrel=0 -pkgdesc="Next generation logging daemon" -url="https://www.syslog-ng.com/products/open-source-log-management/" -arch="all" -license="GPL-2.0-or-later" -options="!check" # unit tests require https://github.com/Snaipe/Criterion with deps -makedepends=" - curl-dev - eventlog-dev - file - bison - flex - autoconf - automake - libtool - glib-dev - hiredis-dev - ivykis-dev>=0.42.4 - libdbi-dev - json-c-dev - openssl-dev - pcre-dev - python3-dev - rabbitmq-c-dev - " -install="$pkgname.post-install $pkgname.post-upgrade" -subpackages=" - $pkgname-scl::noarch - $pkgname-dev - $pkgname-doc - $pkgname-openrc - py3-$pkgname:_python3 - " -source="https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$pkgver/syslog-ng-$pkgver.tar.gz - $pkgname.conf - $pkgname.logrotate - $pkgname.initd - " - -_modules=" - add-contextual-data - amqp:afamqp - examples - graphite - http - json:json-plugin - map-value-pairs - redis - sql:afsql - stardate - stomp:afstomp - tags-parser - xml - " -for _i in $_modules; do - subpackages="$subpackages $pkgname-${_i%%:*}:_module" -done - -prepare() { - default_prepare - - # Remove bundled libraries - rm -rf lib/ivykis - rm -rf modules/afamqp/rabbitmq-c - rm -rf modules/afmongodb/mongo-c-driver - autoreconf -if -} - -build() { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc/syslog-ng \ - --localstatedir=/run \ - --enable-extra-warnings \ - --enable-ipv6 \ - --enable-manpages \ - \ - --enable-sql \ - --disable-linux-caps \ - --disable-mongodb \ - --enable-json \ - --enable-amqp \ - --enable-stomp \ - --disable-smtp \ - --enable-http \ - --enable-redis \ - --enable-geoip \ - --disable-geoip2 \ - --disable-riemann \ - --disable-systemd \ - --enable-python \ - --disable-java \ - --disable-java-modules \ - --enable-native \ - --enable-rdrand \ - --with-ivykis=system \ - --with-jsonc=system \ - --with-librabbitmq-client=system - make -} - -package() { - make -j1 DESTDIR="$pkgdir" install - - cd "$pkgdir" - - rm -rf run usr/lib/$pkgname/libtest - - # getent module doesn't build properly as musl doesn't support reentrant - # getprotoby[number|name] funcs. The provided compat lib only patches - # solaris, which does provide reentrant versions under a different sig - rm -f usr/lib/$pkgname/libtfgetent.so - - # Remove static file - rm -f usr/lib/libsyslog-ng-native-connector.a - - install -m 644 "$srcdir"/$pkgname.conf etc/$pkgname/$pkgname.conf - install -D -m 755 "$srcdir"/$pkgname.initd etc/init.d/$pkgname - install -D -m 644 "$srcdir"/$pkgname.logrotate etc/logrotate.d/$pkgname - - install -d -m 755 etc/$pkgname/conf.d - install -d -m 700 "$pkgdir"/var/lib/syslog-ng -} - -scl() { - pkgdesc="$pkgdesc (configuration library)" - depends="$pkgname=$pkgver-r$pkgrel" - - _submv usr/share/syslog-ng/include/scl -} - -dev() { - default_dev - - _submv usr/share/syslog-ng/tools \ - usr/share/syslog-ng/xsd -} - -_python3() { - pkgdesc="$pkgdesc (python3 module)" - - _submv usr/lib/syslog-ng/libmod-python.so - - local site_pkgs="$(python3 -c 'import site; print(site.getsitepackages()[0])')" - - mkdir -p "$subpkgdir"/"$site_pkgs" - mv "$pkgdir"/usr/lib/syslog-ng/python/* \ - "$subpkgdir"/"$site_pkgs" -} - -_module() { - local name="${subpkgname#$pkgname-}" - pkgdesc="$pkgdesc (${name//-/ } module)" - - local libname=$(printf '%s\n' $_modules | grep "^$name:" | cut -d: -f2) - local soname="lib${libname:-$name}.so" - - _submv usr/lib/syslog-ng/$soname -} - -_submv() { - local path; for path in "$@"; do - mkdir -p "$subpkgdir/${path%/*}" - mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/ - done -} - -sha512sums="ac7ed4978c6db9464add30aa7aeb71a646f841593b02884c8d4ad34c0508c8d3243bcbe6ee98e81c04698895305334eadd9e624ba71e510c14d79155723efb52 syslog-ng-3.30.1.tar.gz -3fcdf42da3bd6ac4352925c686d07958b37780cd58de8c3c73835a442ffec51a0488390611bac011239b4e94f42c216ca178ba4b1b498bc0105c06cbaf8252f4 syslog-ng.conf -1825b85fb584c5cecf0ad370e81a7473b5c973ce10adce386d1ba5f68432abe4e2f54c937d7d94edb22dbd9031eff483bd113bc3244ce0d0072cf4bf4ab5c2cc syslog-ng.logrotate -873fef8815131f0acc618fa4911cd1eda59e260adc1eaae6eb91034900ce789f05ee48fa8afa4a87763026c18c87aef351e7ea76e0cbb46bcd5297f9ca14d527 syslog-ng.initd" diff --git a/wip/syslog-ng/FIXME b/wip/syslog-ng/FIXME new file mode 100644 index 0000000..f2cf3f9 --- /dev/null +++ b/wip/syslog-ng/FIXME @@ -0,0 +1,13 @@ +This recipe is way more complex in AlpineLinux. +A lot of stuff was removed, such as sql, json, python, redis, geoip... + +See also, these files: + $(name).conf + $(name).logrotate + $(name).initd + +They belong in the final package. + +DOESN'T COMPILE + +The configure script asks for glib. diff --git a/wip/syslog-ng/Makefile b/wip/syslog-ng/Makefile new file mode 100644 index 0000000..ebe070e --- /dev/null +++ b/wip/syslog-ng/Makefile @@ -0,0 +1,72 @@ +name = syslog-ng +version = 3.30.1 +pkgrel = 0 +pkgdesc = "Next generation logging daemon" +url = "https://www.syslog-ng.com/products/open-source-log-management/" +arch = "all" +license = "GPL-2.0-or-later" +options = "!check" # unit tests require https://github.com/Snaipe/Criterion with deps +build-dependencies = curl-dev eventlog-dev file bison flex autoconf automake libtool glib-dev hiredis-dev +build-dependencies += ivykis-dev>=0.42.4 libdbi-dev json-c-dev openssl-dev pcre-dev python3-dev rabbitmq-c-dev + +install = $(name).post-install $(name).post-upgrade +URL = https://github.com/balabit/syslog-ng/releases/download/$(name)-$(version)/$(name)-$(version).tar.gz + +MAKE_INSTALL_OPTIONS_USER = -j1 + +CONFIGURE_OPTIONS_USER = --sysconfdir=/etc/syslog-ng \ + --localstatedir=/run \ + --disable-extra-warnings \ + --enable-ipv6 \ + --enable-manpages \ + \ + --disable-sql \ + --disable-linux-caps \ + --disable-mongodb \ + --disable-json \ + --disable-amqp \ + --disable-stomp \ + --disable-smtp \ + --disable-http \ + --disable-redis \ + --disable-geoip \ + --disable-geoip2 \ + --disable-riemann \ + --disable-systemd \ + --disable-python \ + --disable-java \ + --disable-java-modules \ + --enable-native \ + --disable-rdrand + #--with-ivykis=system \ + #--with-jsonc=system \ + #--with-librabbitmq-client=system + + +SYSCONF ?= ../../ +include $(SYSCONF)/package.mk + + +pre_configure: + # Remove bundled libraries + rm -rf $(bdir)/lib/ivykis + rm -rf $(bdir)/modules/afamqp/rabbitmq-c + rm -rf $(bdir)/modules/afmongodb/mongo-c-driver + cd $(bdir); autoreconf -if + +post_fake_root_install: + rm -rf $(pkg_fake_root_dir)/usr/lib/$(name)/libtest + + # rm -rf $(pkg_fake_root_dir)/run + + # getent module doesn't build properly as musl doesn't support reentrant + # getprotoby[number|name] funcs. The provided compat lib only patches + # solaris, which does provide reentrant versions under a different sig + rm -f $(bdir)/usr/lib/$(name)/libtfgetent.so + +# install -m 644 "$(bdir)"/$(name).conf $(pkg_fake_root_dir)/etc/$(name)/$(name).conf +# install -D -m 755 "$(bdir)"/$(name).initd $(pkg_fake_root_dir)/etc/init.d/$(name) +# install -D -m 644 "$(bdir)"/$(name).logrotate $(pkg_fake_root_dir)/etc/logrotate.d/$(name) +# +# install -d -m 755 "$(pkg_fake_root_dir)"/etc/$(name)/conf.d +# install -d -m 700 "$(pkg_fake_root_dir)"/var/lib/syslog-ng