summaryrefslogtreecommitdiff
path: root/app-admin/metalog
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/metalog')
-rw-r--r--app-admin/metalog/Manifest8
-rw-r--r--app-admin/metalog/files/consolelog.sh20
-rw-r--r--app-admin/metalog/files/metalog-0.9-metalog-conf.patch11
-rw-r--r--app-admin/metalog/files/metalog.confd18
-rw-r--r--app-admin/metalog/files/metalog.initd41
-rw-r--r--app-admin/metalog/files/metalog.service-r110
-rw-r--r--app-admin/metalog/metadata.xml11
-rw-r--r--app-admin/metalog/metalog-3-r2.ebuild56
8 files changed, 175 insertions, 0 deletions
diff --git a/app-admin/metalog/Manifest b/app-admin/metalog/Manifest
new file mode 100644
index 000000000000..689636fb2799
--- /dev/null
+++ b/app-admin/metalog/Manifest
@@ -0,0 +1,8 @@
+AUX consolelog.sh 269 BLAKE2B 83aefc979d30847eb2d0b588232361cf129dec5a01ff8fafea7dd14daf4e2376c7381ce43e715e1093f13083d0e42cb037fcd65ae83f13b964c946f147e42cb9 SHA512 4cbf2145480d67b46db8a291137f5d953ce07d5d35b7c011e3dec13e4e5ab729f81666884c23db568065cb0b16fddba7178570c04777428861107aeb7c48f332
+AUX metalog-0.9-metalog-conf.patch 269 BLAKE2B ed59aa36a7388b4f91be80731fcfda0c806fc8bb90b86ca6357fea949ff6f231b42b37fdf2f044541c07fbbc4b0a67db4d6dcdcb18c9cd5091e2c3106bb4fc34 SHA512 0c95e8461e89d9469452d2ef66fa52f469b61578b12a6c72adb73e48807f998f8fb58cf0b3f1bc5caa38296fd59c8f8d1fc209beec81790387816d1c497a07df
+AUX metalog.confd 393 BLAKE2B 326653a23ff4e6bc78a4ddebf8af7c517f7b67973063ce1ac642195c7566667c7a330a4113acdd451522c907aa0814195ed5124aa92184bfca08eddc670b2d3f SHA512 4fea6b7f48e55d5f69a9c9a69f54623bb9d515e2fd2eda6829f8b769eec85e3de448eb42feb6bf65645400480169b3d70d56dff090103cfc95a3810515c42b2e
+AUX metalog.initd 701 BLAKE2B 9cb211b887b7294a11649710d45c104603fa9b9c27469f33c20613b58d0eede015cc7faa7d489530150bacc9ae5c4f4ecdee69ac2a9fbd4eb7157296413d0594 SHA512 45eb2f4c5a99723ac24bdb90726a81efef422aab7c991d1502a0bb728a4138cda74b2f8efb4cc70f1375b21b92039639e8bd5ab01af310991a81fce668f6f096
+AUX metalog.service-r1 153 BLAKE2B 0353f6c1983b7146ce6471be82540aeb87d930e5c9f7334a4133754c52c2c8770c04a9eeb6f9f20ecc41359b1eae135e525d2dbde2471f2d973bb751690703d7 SHA512 72076f6aeab9975dedd824ea1d48b96f6a964d06f529923d4f7a1280a1123a63c0e958f74c6a1417c6362487a69d165bf3eb6c417aae3887ff43ae726f5a30d8
+DIST metalog-3.tar.xz 360784 BLAKE2B 951841d423769cd97e14985e15d5a2499ca351e082c0effe28dc16d46db91235b7ef0448fe32d38b2ed5b53011d04b3375dc87c2a859c49bede2ae177ec16954 SHA512 2ac614bb85fe466308c4ced0842fdab5f056eda60e892189a8220719f1e06a72fce3c76842a2ac8c63a6808c20d8b7a7d8676896e14f7f54e40630ecbd21e289
+EBUILD metalog-3-r2.ebuild 1471 BLAKE2B 5da0f4866c405bd0d7073a1d98a8ad9acef166ff67af57c3330aafd68aacc7bc6ae8c81d28e402554ee637d26f5ce3aa14adfcdcb5a4cad3422a44f849e5bdb9 SHA512 91abf5ae5b73cd63246672d6bffe3ecbef91c271556958f7d1488bece9445109030752d5c932050e0413541aa240b3f09afd881f0a7350b58bfcf8dafe76bf70
+MISC metadata.xml 334 BLAKE2B 2d9ae46fcede549cabba6654513afcb6bee8ea22ba48bdc910c7b136e4d27bf6e223db5b13501b275790ecbf4fcbcb4ebf5ac9b6b81c6fa098e2f2c402793b0b SHA512 14ef6878732ffc5d14d1d27cec55ec886e76969e016ce8a009cafffa0b8d4e470c1b0f2480da5aaf0ed885c101b20d5edd7ce333efb9bc6f0bf56462e7260b37
diff --git a/app-admin/metalog/files/consolelog.sh b/app-admin/metalog/files/consolelog.sh
new file mode 100644
index 000000000000..90fb38e9921a
--- /dev/null
+++ b/app-admin/metalog/files/consolelog.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# consolelog.sh
+# For metalog -- log to a console
+
+set -f
+
+. /etc/conf.d/metalog
+if [ -z "${CONSOLE}" ] ; then
+ CONSOLE="/dev/console"
+fi
+
+if [ -z "${FORMAT}" ] ; then
+ FORMAT='$1 [$2] $3'
+fi
+
+for d in ${CONSOLE} ; do
+ eval echo ${FORMAT} > ${d}
+done
+
+exit 0
diff --git a/app-admin/metalog/files/metalog-0.9-metalog-conf.patch b/app-admin/metalog/files/metalog-0.9-metalog-conf.patch
new file mode 100644
index 000000000000..efb794de5454
--- /dev/null
+++ b/app-admin/metalog/files/metalog-0.9-metalog-conf.patch
@@ -0,0 +1,11 @@
+--- a/metalog.conf
++++ b/metalog.conf
+@@ -21,6 +21,8 @@
+ # merely write $@ to some device (your console for messages):
+ # echo "$@" > /dev/tty10
+ #
++# Hint: you can control the consolelog.sh behavior in /etc/conf.d/metalog
++#
+ #console logging :
+ #
+ # facility = "*"
diff --git a/app-admin/metalog/files/metalog.confd b/app-admin/metalog/files/metalog.confd
new file mode 100644
index 000000000000..ec7e64edae2b
--- /dev/null
+++ b/app-admin/metalog/files/metalog.confd
@@ -0,0 +1,18 @@
+# /etc/conf.d/metalog
+
+# Some useful options:
+# -a Log with buffering
+# -s Log without buffering
+# See `metalog --help` for more
+
+METALOG_OPTS=""
+
+
+# Options used by /usr/sbin/consolelog.sh
+
+# Space delimited list of devices to write "console" messages to
+#CONSOLE="/dev/console /dev/tty10"
+CONSOLE="/dev/tty10"
+
+# Format of logging (make sure you use single quotes)
+FORMAT='$1 [$2] $3'
diff --git a/app-admin/metalog/files/metalog.initd b/app-admin/metalog/files/metalog.initd
new file mode 100644
index 000000000000..f81e9eec51ca
--- /dev/null
+++ b/app-admin/metalog/files/metalog.initd
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="buffer unbuffer"
+
+PIDFILE=/var/run/metalog.pid
+
+depend() {
+ need localmount
+ use clock hostname
+ after bootmisc
+ provide logger
+}
+
+ssd() { start-stop-daemon --exec /usr/sbin/metalog --pidfile "${PIDFILE}" "$@" ; }
+
+start() {
+ ebegin "Starting metalog"
+ ssd --start -- \
+ --daemonize --pidfile="${PIDFILE}" ${METALOG_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping metalog"
+ ssd --stop
+ eend $?
+}
+
+buffer() {
+ ebegin "Enabling log buffering"
+ ssd --signal USR2
+ eend $?
+}
+
+unbuffer() {
+ ebegin "Disabling log buffering"
+ ssd --signal USR1
+ eend $?
+}
diff --git a/app-admin/metalog/files/metalog.service-r1 b/app-admin/metalog/files/metalog.service-r1
new file mode 100644
index 000000000000..862881aee165
--- /dev/null
+++ b/app-admin/metalog/files/metalog.service-r1
@@ -0,0 +1,10 @@
+[Unit]
+Description=System Logger Daemon
+
+[Service]
+ExecStart=/usr/sbin/metalog
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service
diff --git a/app-admin/metalog/metadata.xml b/app-admin/metalog/metadata.xml
new file mode 100644
index 000000000000..cf5328e7d009
--- /dev/null
+++ b/app-admin/metalog/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">metalog</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-admin/metalog/metalog-3-r2.ebuild b/app-admin/metalog/metalog-3-r2.ebuild
new file mode 100644
index 000000000000..a3b3bc3dceb9
--- /dev/null
+++ b/app-admin/metalog/metalog-3-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+inherit eutils systemd
+
+DESCRIPTION="A highly configurable replacement for syslogd/klogd"
+HOMEPAGE="http://metalog.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="unicode"
+
+RDEPEND=">=dev-libs/libpcre-3.4"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-arch/xz-utils"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.9-metalog-conf.patch )
+
+src_configure() {
+ econf $(use_with unicode)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog README NEWS metalog.conf
+
+ into /
+ dosbin "${FILESDIR}"/consolelog.sh
+
+ newinitd "${FILESDIR}"/metalog.initd metalog
+ newconfd "${FILESDIR}"/metalog.confd metalog
+ systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service"
+}
+
+pkg_preinst() {
+ if [[ -d "${ROOT}"/etc/metalog ]] && [[ ! -e "${ROOT}"/etc/metalog.conf ]] ; then
+ mv -f "${ROOT}"/etc/metalog/metalog.conf "${ROOT}"/etc/metalog.conf
+ rmdir "${ROOT}"/etc/metalog
+ export MOVED_METALOG_CONF=true
+ else
+ export MOVED_METALOG_CONF=false
+ fi
+}
+
+pkg_postinst() {
+ if ${MOVED_METALOG_CONF} ; then
+ ewarn "The default metalog.conf file has been moved"
+ ewarn "from /etc/metalog/metalog.conf to just"
+ ewarn "/etc/metalog.conf. If you had a standard"
+ ewarn "setup, the file has been moved for you."
+ fi
+}