Subject: [alpine-devel] [PATCH] testing/rsyslog: new package

From: Cameron Banta <[email-masked]>
Date: Mon, 13 Dec 2010 17:36:33 +0000

---
 testing/rsyslog/APKBUILD          |   84 +++++++++++++++++++++++++++++++++++
 testing/rsyslog/rsyslog.conf      |   87 +++++++++++++++++++++++++++++++++++++
 testing/rsyslog/rsyslog.confd     |   17 +++++++
 testing/rsyslog/rsyslog.initd     |   38 ++++++++++++++++
 testing/rsyslog/rsyslog.logrotate |    9 ++++
 5 files changed, 235 insertions(+), 0 deletions(-)
 create mode 100644 testing/rsyslog/APKBUILD
 create mode 100644 testing/rsyslog/rsyslog.conf
 create mode 100644 testing/rsyslog/rsyslog.confd
 create mode 100644 testing/rsyslog/rsyslog.initd
 create mode 100644 testing/rsyslog/rsyslog.logrotate

diff --git a/testing/rsyslog/APKBUILD b/testing/rsyslog/APKBUILD
new file mode 100644
index 0000000..12e2ec9
--- /dev/null
+++ b/testing/rsyslog/APKBUILD
@@ -0,0 +1,84 @@
+# Contributor: [email-masked]
+# Maintainer: [email-masked]
+pkgname=rsyslog
+pkgver=5.6.2
+pkgrel=0
+pkgdesc="Enhanced multi-threaded syslogd with database support and more."
+url="http://www.rsyslog.com/"
+license="GPLv3 LGPL-3"
+makedepends="zlib-dev gnutls-dev mysql-dev postgresql-dev net-snmp-dev libnet-dev"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-mysql $pkgname-pgsql $pkgname-tls $pkgname-snmp"
+source="http://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
+	$pkgname.initd
+	$pkgname.confd
+	$pkgname.logrotate
+	$pkgname.conf"
+
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+	cd "$_builddir"
+	./configure \
+		--disable-gui \
+		--disable-rfc3195 \
+		--enable-largefile \
+		--enable-imdiag \
+		--enable-imfile \
+		--enable-imtemplate \
+		--enable-mail \
+		--enable-omprog \
+		--enable-omstdout \
+		--enable-omtemplate \
+		--enable-omudpspoof \
+                --enable-zlib \
+                --enable-mysql \
+                --enable-pgsql \
+                --enable-gnutls \
+                --enable-snmp \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install
+
+	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+	install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname
+	install -m644 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf
+}
+
+mysql() {
+	pkgdesc="rsyslog mysql support"
+	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+	mv "$pkgdir"/usr/lib/rsyslog/ommysql.so "$subpkgdir"/usr/lib/rsyslog/
+}
+
+pgsql() {
+	pkgdesc="rsyslog pgsql support"
+	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+	mv "$pkgdir"/usr/lib/rsyslog/ompgsql.so "$subpkgdir"/usr/lib/rsyslog/
+}
+
+tls() {
+	pkgdesc="rsyslog tls support"
+	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+	mv "$pkgdir"/usr/lib/rsyslog/lmnsd_gtls.so "$subpkgdir"/usr/lib/rsyslog/
+}
+
+snmp() {
+	pkgdesc="rsyslog snmp support"
+	mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+	mv "$pkgdir"/usr/lib/rsyslog/omsnmp.so "$subpkgdir"/usr/lib/rsyslog/
+}
+
+md5sums="6fc0bdf1b2de7f6466b4510194008e3c  rsyslog-5.6.2.tar.gz
+06f6e1ef8a05d3b6b49c06b0b99d3064  rsyslog.initd
+0a0aef98f677364e6178c34274df7723  rsyslog.confd
+bc43debc9ffdf66bc1409025fd3d1176  rsyslog.logrotate
+65fbf5a7a81a53a70974e3085e96cb41  rsyslog.conf"
diff --git a/testing/rsyslog/rsyslog.conf b/testing/rsyslog/rsyslog.conf
new file mode 100644
index 0000000..1918746
--- /dev/null
+++ b/testing/rsyslog/rsyslog.conf
@@ -0,0 +1,87 @@
+# rsyslog v5: load input modules
+# If you do not load inputs, nothing happens!
+# You may need to set the module load path if modules are not found.
+
+$ModLoad immark.so # provides --MARK-- message capability
+$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command)
+$ModLoad imklog.so # kernel logging (formerly provided by rklogd)
+
+# Include configuration files from directory
+$IncludeConfig /etc/rsyslog.d/*
+
+# Check config syntax on startup and abort if unclean (default off)
+#$AbortOnUncleanConfig on
+
+# Reduce repeating messages (default off)
+#$RepeatedMsgReduction on
+
+# Log all kernel messages to the console.
+# Logging much else clutters up the screen.
+#kern.*                                                 /dev/console
+
+# Log anything (except mail) of level info or higher.
+# Don't log private authentication messages!
+*.info;mail.none;authpriv.none;cron.none                -/var/log/messages
+
+# The authpriv file has restricted access.
+authpriv.*                                              /var/log/secure
+
+# Log all the mail messages in one place.
+mail.*                                                  -/var/log/maillog
+
+# Log cron stuff
+cron.*                                                  -/var/log/cron
+
+# Everybody gets emergency messages
+*.emerg                                                 *
+
+# Save news errors of level crit and higher in a special file.
+uucp,news.crit                                          -/var/log/spooler
+
+# Save boot messages also to boot.log
+local7.*                                                /var/log/boot.log
+
+# More configuration examples:
+#
+# Remote Logging (we use TCP for reliable delivery)
+# An on-disk queue is created for this action. If the remote host is
+# down, messages are spooled to disk and sent when it is up again.
+#$WorkDirectory /var/spool/rsyslog # where to place spool files
+#$ActionQueueFileName uniqName # unique name prefix for spool files
+#$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)
+#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
+#$ActionQueueType LinkedList   # run asynchronously
+#$ActionResumeRetryCount -1    # infinety retries if host is down
+#$ActionResumeInterval 30      # retry interval
+# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
+#*.* @@remote-host
+
+# Remote Logging with TCP + SSL/TLS
+#$DefaultNetstreamDriver gtls
+#$DefaultNetstreamDriverCAFile /etc/ssl/rsyslog/rsyslog_ca.cert.pem
+#$DefaultNetstreamDriverCertFile /etc/ssl/rsyslog/rsyslog_CLIENT.cert.pem
+#$DefaultNetstreamDriverKeyFile /etc/ssl/rsyslog/rsyslog_CLIENT.key.pem
+#$ActionSendStreamDriverAuthMode x509/name # enable peer authentication
+#$ActionSendStreamDriverPermittedPeer foo # authorize to send encrypted data to server foo
+#$ActionSendStreamDriverMode 1 # run driver in TLS-only mode
+
+# ######### Receiving Messages from Remote Hosts ##########
+# TCP Syslog Server:
+#$ModLoad imtcp  # provides TCP syslog reception
+#$TCPServerRun 10514 # start a TCP syslog server at port 10514
+
+# TCP + SSL/TLS Syslog Server:
+#$ModLoad imtcp  # provides TCP syslog reception
+#$DefaultNetstreamDriver gtls # use gnuTLS for data encryption
+#$DefaultNetstreamDriverCAFile /etc/ssl/rsyslog/rsyslog_ca.cert.pem
+#$DefaultNetstreamDriverCertFile /etc/ssl/rsyslog/rsyslog_SERVER.cert.pem
+#$DefaultNetstreamDriverKeyFile /etc/ssl/rsyslog/rsyslog_SERVER.key.pem
+#$InputTCPServerStreamDriverMode 1 # run driver in TLS-only mode
+#$InputTCPServerStreamDriverAuthMode x509/name # enable peer authentication
+#$InputTCPServerStreamDriverPermittedPeer bar # authorize client named bar (one line per client)
+#$TCPServerRun 10514 # start a TCP syslog server at port 10514
+
+# UDP Syslog Server:
+#$ModLoad imudp.so  # provides UDP syslog reception
+#$UDPServerRun 514 # start a UDP syslog server at standard port 514
+
diff --git a/testing/rsyslog/rsyslog.confd b/testing/rsyslog/rsyslog.confd
new file mode 100644
index 0000000..85e90ed
--- /dev/null
+++ b/testing/rsyslog/rsyslog.confd
@@ -0,0 +1,17 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/5-stable/rsyslog.confd,v 1.1 2010/10/21 07:38:29 dev-zero Exp $
+
+# Configuration file
+CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+PIDFILE="/var/run/rsyslogd.pid"
+
+# Options to rsyslogd
+# See rsyslogd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the location
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+# * "-c5" tells rsyslog to _not_ run in sysklogd compatibility mode
+RSYSLOG_OPTS="-c5"
diff --git a/testing/rsyslog/rsyslog.initd b/testing/rsyslog/rsyslog.initd
new file mode 100644
index 0000000..68ff86c
--- /dev/null
+++ b/testing/rsyslog/rsyslog.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/5-stable/rsyslog.initd,v 1.1 2010/10/21 07:38:29 dev-zero Exp $
+
+opts="reload"
+
+depend() {
+	provide logger
+}
+
+start() {
+	ebegin "Starting rsyslogd"
+	start-stop-daemon \
+		--start --quiet --exec /usr/sbin/rsyslogd \
+		-- ${RSYSLOG_OPTS} -i "${PIDFILE}" -f "${CONFIGFILE}"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping rsyslogd"
+	start-stop-daemon \
+		--stop --quiet \
+		--pidfile "${PIDFILE}"
+	eend $?
+}
+
+reload() {
+	if [ ! -f "${PIDFILE}" ]; then
+		eerror "rsyslogd not running"
+		return 1
+	fi
+
+	ebegin "Re-opening rsyslogd log files"
+	start-stop-daemon --stop --oknodo --signal HUP \
+		--pidfile "${PIDFILE}"
+	eend $?
+}
diff --git a/testing/rsyslog/rsyslog.logrotate b/testing/rsyslog/rsyslog.logrotate
new file mode 100644
index 0000000..86095de
--- /dev/null
+++ b/testing/rsyslog/rsyslog.logrotate
@@ -0,0 +1,9 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/5-stable/rsyslog.logrotate,v 1.1 2010/10/21 07:38:29 dev-zero Exp $
+/var/log/messages /var/log/secure /var/log/maillog /var/log/cron /var/log/spooler /var/log/boot.log {
+    sharedscripts
+    postrotate
+        /etc/init.d/rsyslog reload &>/dev/null || true
+    endscript
+}
-- 
1.7.3.2

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