Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/metalog: new aport

From: Milan P. Stanić <mps_at_arvanta.net>
Date: Fri, 22 Feb 2019 16:13:34 +0100

---
 testing/metalog/APKBUILD      | 53 +++++++++++++++++++++++++++++++++++
 testing/metalog/metalog.confd | 10 +++++++
 testing/metalog/metalog.initd | 40 ++++++++++++++++++++++++++
 3 files changed, 103 insertions(+)
 create mode 100644 testing/metalog/APKBUILD
 create mode 100644 testing/metalog/metalog.confd
 create mode 100644 testing/metalog/metalog.initd
diff --git a/testing/metalog/APKBUILD b/testing/metalog/APKBUILD
new file mode 100644
index 0000000000..306bd665d8
--- /dev/null
+++ b/testing/metalog/APKBUILD
_at_@ -0,0 +1,53 @@
+# Contributor: Milan P. Stanić <mps_at_arvanta.net>
+# Maintainer: Milan P. Stanić <mps_at_arvanta.net>
+pkgname=metalog
+pkgver=20181125
+pkgrel=0
+pkgdesc="small, simple to config, flexible syslogd/klogd daemon"
+url="https://github.com/hvisage/metalog"
+arch="all"
+license="GPL-2.0-only"
+depends=""
+makedepends="pcre-dev automake autoconf autoconf-archive"
+subpackages="$pkgname-doc $pkgname-openrc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/hvisage/metalog/archive/${pkgver}.tar.gz
+	metalog.initd
+	metalog.confd
+	"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+	cd "$builddir"
+	./autogen.sh
+}
+
+build() {
+	cd "$builddir"
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--localstatedir=/var
+	make
+}
+
+check() {
+	cd "$builddir"
+	make check
+}
+
+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
+}
+
+sha512sums="8ab6713e158a50a330efd0f81764bb4e9be16da3194eea8043d3758474171841adbca86c735a387b87df7f69b1567d3fcf320fc5dfcd5b6ad88f7ce4c6622d58  metalog-20181125.tar.gz
+c77d4a01e6a9d89e170f77531a9814e7cc2bbf0c0cc7247bc79708a5bea90e60325dbbbe25b96d067c7df1fd349b39e3da5e82db4d2218834eed1a4e13fc8f67  metalog.initd
+6e1e1249b90f98c70c8493f55d42f378b4111a0f7b80eaee9a51875967b297bf12ca80804e8fa9a39249b2a981dbc6f60ddadb93397e7fa0ad6959dd7c8b28be  metalog.confd"
diff --git a/testing/metalog/metalog.confd b/testing/metalog/metalog.confd
new file mode 100644
index 0000000000..f3c7a277d1
--- /dev/null
+++ b/testing/metalog/metalog.confd
_at_@ -0,0 +1,10 @@
+# Configuration file
+CONFIGFILE="/etc/metalog.conf"
+
+# PID file
+PIDFILE="/var/run/metalog.pid"
+
+# Options to metalog
+# "-B" start server in background/daemon mode
+# "-s" tells metalog to run in sync mode
+METALOG_OPTS="-B -s"
diff --git a/testing/metalog/metalog.initd b/testing/metalog/metalog.initd
new file mode 100644
index 0000000000..c7f25f1d37
--- /dev/null
+++ b/testing/metalog/metalog.initd
_at_@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+
+extra_started_commands="reload"
+
+description="syslog server"
+name=metalog
+command="/usr/sbin/$name"
+
+depend() {
+	need clock hostname localmount
+	provide logger
+}
+
+start() {
+	ebegin "Starting metalog"
+	start-stop-daemon \
+		--start --quiet --exec $command \
+		-- ${METALOG_OPTS} -p "${PIDFILE}" -C "${CONFIGFILE}"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping metalog"
+	start-stop-daemon \
+		--stop --quiet \
+		--pidfile "${PIDFILE}"
+	eend $?
+}
+
+reload() {
+	if [ ! -f "${PIDFILE}" ]; then
+		eerror "metalog not running"
+		return 1
+	fi
+
+	ebegin "Re-opening metalog log files"
+	start-stop-daemon --stop --signal HUP \
+		--pidfile "${PIDFILE}"
+	eend $?
+}
-- 
2.20.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Feb 22 2019 - 16:13:34 UTC