Subject: [alpine-aports] [PATCH] update main/rsyslog to 8.16.0

From: Francisco Guerreiro <[email-masked]>
Date: Thu, 3 Mar 2016 18:05:27 +0000

current version available segfaults on me alot so updated to latest version and:

added redis subpackage for hiredis client support
added different musl fixes for missing constants
enabled syslog over TCP support by default

sprunge link to patch: http://sprunge.us/Xaia

fun times

---
 main/rsyslog/APKBUILD           | 41 ++++++++++++++++++++++-------------------
 main/rsyslog/gnutls-3.4.0.patch | 36 ------------------------------------
 main/rsyslog/musl-fix.patch     | 23 ++++++++++++-----------
 3 files changed, 34 insertions(+), 66 deletions(-)
 delete mode 100644 main/rsyslog/gnutls-3.4.0.patch

diff --git a/main/rsyslog/APKBUILD b/main/rsyslog/APKBUILD
index ec59d92..43e20a9 100644
--- a/main/rsyslog/APKBUILD
+++ b/main/rsyslog/APKBUILD
@@ -2,16 +2,16 @@
 # Maintainer: Cameron Banta <[email-masked]>
 # Contributor: [email-masked]
 pkgname=rsyslog
-pkgver=8.9.0
-pkgrel=2
+pkgver=8.16.0
+pkgrel=1
 pkgdesc="Enhanced multi-threaded syslogd with database support and more."
 url="http://www.rsyslog.com/"
 arch="all"
 license="GPLv3 LGPL3"
-makedepends="zlib-dev gnutls-dev mariadb-dev postgresql-dev net-snmp-dev
+makedepends="zlib-dev gnutls-dev mariadb-dev postgresql-dev
net-snmp-dev hiredis-dev
 	libnet-dev libgcrypt-dev libee-dev libestr-dev liblogging-dev
 	json-c-dev util-linux-dev py-docutils"
-subpackages="$pkgname-doc $pkgname-mysql $pkgname-pgsql $pkgname-tls
$pkgname-snmp
+subpackages="$pkgname-doc $pkgname-mysql $pkgname-pgsql $pkgname-tls
$pkgname-snmp $pkgname-hiredis
 	$pkgname-dbg"
 source="http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
 	$pkgname.initd
@@ -19,7 +19,6 @@
source="http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
 	$pkgname.logrotate
 	$pkgname.conf
 	musl-fix.patch
-	gnutls-3.4.0.patch
 	"

@@ -39,7 +38,6 @@ build() {
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
-		--disable-gui \
 		--disable-rfc3195 \
 		--enable-largefile \
 		--enable-imdiag \
@@ -48,11 +46,13 @@ build() {
 		--enable-omprog \
 		--enable-omstdout \
 		--enable-omudpspoof \
-		--enable-zlib \
+  		--enable-imptcp \
+  		--enable-impstats \
 		--enable-mysql \
 		--enable-pgsql \
 		--enable-gnutls \
 		--enable-snmp \
+		--enable-omhiredis \
 		--prefix=/usr \
 		--sysconfdir=/etc \
 		--mandir=/usr/share/man \
@@ -77,6 +77,12 @@ mysql() {
 	mv "$pkgdir"/usr/lib/rsyslog/ommysql.so "$subpkgdir"/usr/lib/rsyslog/
 }

+hiredis(){
+	pkgdesc="rsyslog hiredis support"
+	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+	mv "$pkgdir"/usr/lib/rsyslog/omhiredis.so "$subpkgdir"/usr/lib/rsyslog/
+}
+
 pgsql() {
 	pkgdesc="rsyslog pgsql support"
 	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
@@ -95,24 +101,21 @@ snmp() {
 	mv "$pkgdir"/usr/lib/rsyslog/omsnmp.so "$subpkgdir"/usr/lib/rsyslog/
 }

-md5sums="b9e10a3ea9d52b4fa9bbbf540d313970  rsyslog-8.9.0.tar.gz
+md5sums="52916045c07ebbd3ee77c39e8465bc4d  rsyslog-8.16.0.tar.gz
 67b8afd572b4103b39b54a729b880b53  rsyslog.initd
 a34f33d8f798ab6652b347ad09656284  rsyslog.confd
 bc43debc9ffdf66bc1409025fd3d1176  rsyslog.logrotate
-bc0a9b1095f5f6ffc937cd2c9bd26dff  rsyslog.conf
-05a0995f5cbe241720aaf6b149860286  musl-fix.patch
-aafafdf4502f5e4de5fcfebd21499700  gnutls-3.4.0.patch"
-sha256sums="eab00e8e758cd9dd33b3e2cf6af80297d1951dc7db37bd723a6488a35d577adc
 rsyslog-8.9.0.tar.gz
+480f153508fd10d157cefc0bb898fe2d  musl-fix.patch
+bc0a9b1095f5f6ffc937cd2c9bd26dff  rsyslog.conf"
+sha256sums="4fe4f97c10899086d98b9401d7e8d2bcff61c7c3f7cde8627891e36fc6ec1b76
 rsyslog-8.16.0.tar.gz
 223d4bdb69760ef5a9a044d68434c805cd15e31fa190a86f5f283912d0baf6d6  rsyslog.initd
 f93cd477770872486185152454ce66e89302b7a8d7a112ff285ceea892dfe1f1  rsyslog.confd
 f0effc19bd1f1bfa367d65d6516c73509cb34545157b9e91cf6e437685dd3fe5
rsyslog.logrotate
-e4ebe806b5a71edaa4492033ea3a3e70810a64d3f3d4f4e9954eefcf25f2e2ed  rsyslog.conf
-feda2d9ca6c788e375116b6c43b6c4ac5debe83dab0efcfc9a47216c9af36599
musl-fix.patch
-540530796fd535889ef1a1741ad06e3a0ab4441247396f89ebb06010ce9c102e
gnutls-3.4.0.patch"
-sha512sums="942cccc2cbe147572cc2d346ac330d80c86915757b2b7a380829f0b40294d7e4afd4887d5066821af1e059cd78cdb38520fc9d28b55daa7afcd0e5b2e6bd9a5d
 rsyslog-8.9.0.tar.gz
+5b8420570bef57aeba55965bbbddb29f966b60a33ef9e7fc5f921820274080b0
musl-fix.patch
+e4ebe806b5a71edaa4492033ea3a3e70810a64d3f3d4f4e9954eefcf25f2e2ed  rsyslog.conf"
+sha512sums="e45acc16078d83937edd7e22f916fe050b62aa057ca4dd980823850f2195213c12db36f759c528b5fe6f1b061a61e2117fca6086245bc248392cc4e61b2383dc
 rsyslog-8.16.0.tar.gz
+20967235e8233588210071a7157a81fe02a1e88d7c7f55855fcc2fe34295269a6e3e3bfccb3d4dd83a6a48da28948c92d6ce47a0c5d817f6b6a4030635f4f896
 musl-fix.patch
 9a4b184076a82e0899da79ab3749e1c67eac03f36c4460d34ed0385f4a3ffad53681a1cc25dd514e835c9399a9abd01c235743535ad549d5be7f66d9e127b9dc
 rsyslog.initd
 a4d969671800227129be870b0318961b79d16365663754111a136734bbf7005abd4da24853dfdc07b3b6691ab5a7b215f0ac6c19022b4c5c8dab06165a42431b
 rsyslog.confd
 d54377ddf39197656811a84272568ea761f984e19dd04fc54f372dd04a9244e66d02b26ab33073d0344d054f031660ec611f3c7a18c266e7b68cef5e2c47f06f
 rsyslog.logrotate
-3bcd58b222eb7f4d8a42a0643cacb6ab44790f90c9bd550678e002bc19863d5d6a7341e5e5ba0b9292f85c6c04cd5cc42d174acdc63e8ba22022620db10f2b9b
 rsyslog.conf
-d5f16d624b40fcd68f689bb65cfad8f537b35f3d7f9c4453c472b21437964442baf0846b3658a6cdd2e0d44b60085140deffc68cf9e3c460bcc5db40cf142ee1
 musl-fix.patch
-b0e2fc464c840211acef0da481fed5eb594d5bee62672fbccf379efcf3f88c3acee5efd8c51671508feaf2edacd05426766577c94e733479a90a58f68f4fc8a4
 gnutls-3.4.0.patch"
+3bcd58b222eb7f4d8a42a0643cacb6ab44790f90c9bd550678e002bc19863d5d6a7341e5e5ba0b9292f85c6c04cd5cc42d174acdc63e8ba22022620db10f2b9b
 rsyslog.conf"
diff --git a/main/rsyslog/gnutls-3.4.0.patch b/main/rsyslog/gnutls-3.4.0.patch
deleted file mode 100644
index fcf199b..0000000
--- a/main/rsyslog/gnutls-3.4.0.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -wbBur rsyslog-8.9.0.org/runtime/nsd_gtls.c
rsyslog-8.9.0/runtime/nsd_gtls.c
---- rsyslog-8.9.0.org/runtime/nsd_gtls.c	2015-03-29 16:00:04.000000000 +0300
-+++ rsyslog-8.9.0/runtime/nsd_gtls.c	2015-04-16 15:42:44.701275194 +0300
-@@ -231,13 +231,13 @@
- gtlsClientCertCallback(gnutls_session_t session,
-               __attribute__((unused)) const gnutls_datum_t*
req_ca_rdn, int __attribute__((unused)) nreqs,
-               __attribute__((unused)) const gnutls_pk_algorithm_t*
sign_algos, int __attribute__((unused)) sign_algos_length,
--              gnutls_retr_st *st)
-+              gnutls_retr2_st *st)
- {
- 	nsd_gtls_t *pThis;
-
- 	pThis = (nsd_gtls_t*) gnutls_session_get_ptr(session);
-
--	st->type = GNUTLS_CRT_X509;
-+	st->cert_type = GNUTLS_CRT_X509;
- 	st->ncerts = 1;
- 	st->cert.x509 = &pThis->ourCert;
- 	st->key.x509 = pThis->ourKey;
-@@ -1673,14 +1673,14 @@
- 	gnutls_session_set_ptr(pThis->sess, (void*)pThis);
- 	iRet = gtlsLoadOurCertKey(pThis); /* first load .pem files */
- 	if(iRet == RS_RET_OK) {
--		gnutls_certificate_client_set_retrieve_function(xcred,
gtlsClientCertCallback);
-+		gnutls_certificate_set_retrieve_function(xcred, gtlsClientCertCallback);
- 	} else if(iRet != RS_RET_CERTLESS) {
- 		FINALIZE; /* we have an error case! */
- 	}
-
- 	/* Use default priorities */
- 	CHKgnutls(gnutls_set_default_priority(pThis->sess));
--	CHKgnutls(gnutls_certificate_type_set_priority(pThis->sess,
cert_type_priority));
-+	CHKgnutls(gnutls_set_default_priority(pThis->sess));
-
- 	/* put the x509 credentials to the current session */
- 	CHKgnutls(gnutls_credentials_set(pThis->sess,
GNUTLS_CRD_CERTIFICATE, xcred));
diff --git a/main/rsyslog/musl-fix.patch b/main/rsyslog/musl-fix.patch
index 698443c..bfd20b5 100644
--- a/main/rsyslog/musl-fix.patch
+++ b/main/rsyslog/musl-fix.patch
@@ -1,12 +1,13 @@
-diff --git a/tools/omfile.c.orig b/tools/omfile.c
-index 015f453..8e0b6f4 100644
---- a/tools/omfile.c.orig
-+++ b/tools/omfile.c
-@@ -48,6 +48,7 @@
- #include <libgen.h>
- #include <unistd.h>
- #include <sys/file.h>
-+#include <fcntl.h>
- #ifdef OS_SOLARIS
- #	include <fcntl.h>
+--- rsyslog-8.16.0/runtime/rsyslog.h
++++ rsyslog-8.16.0-musl/runtime/rsyslog.h
+@@ -643,3 +643,10 @@
  #endif
+
+ #endif /* multi-include protection */
++
++/*  musl patches for alpine */
++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
++#define GLOB_BRACE 0
++#ifndef WAIT_ANY
++#define WAIT_ANY (-1)
++#endif
-- 
2.6.4

---

From: Sören Tempel <[email-masked]>
Date: Sat, 5 Mar 2016 20:50:22 +0100

>  source="http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz

Great work but sadly this patch seems to be corrupt or at least
git-apply(1) claims that it is. Would you mind resubmitting it?

Sören.

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Francisco Guerreiro <[email-masked]>
Date: Mon, 7 Mar 2016 14:24:39 +0000

yeah sorry it was due to my email client

i updated the patch with a correction and now it "git apply"'s ok :)

link to it here: http://sprunge.us/YZiU

thank you for accepting it :) having a rsyslog after v8.10 will make it
much easier to convince my company to start adopting alpinelinux, the only
remaining good linux distro in the world! :D

On Sat, Mar 5, 2016 at 7:50 PM, Sören Tempel <[email-masked]>
wrote:

> >  source="
> http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
> >       $pkgname.initd
> > @@ -19,7 +19,6 @@
> > source="
> http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
> >       $pkgname.logrotate
> >       $pkgname.conf
> >       musl-fix.patch
> > -     gnutls-3.4.0.patch
> >       "
>