summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/metalog')
-rw-r--r--app-admin/metalog/Manifest1
-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.confd19
-rwxr-xr-xapp-admin/metalog/files/metalog.initd42
-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-r1.ebuild59
8 files changed, 173 insertions, 0 deletions
diff --git a/app-admin/metalog/Manifest b/app-admin/metalog/Manifest
new file mode 100644
index 000000000000..69661bb6f96b
--- /dev/null
+++ b/app-admin/metalog/Manifest
@@ -0,0 +1 @@
+DIST metalog-3.tar.xz 360784 SHA256 0c3a1e19008b3d525eab6e5548a4e8cbb0fb235f2804dc41aace82c67ceeebe0 SHA512 2ac614bb85fe466308c4ced0842fdab5f056eda60e892189a8220719f1e06a72fce3c76842a2ac8c63a6808c20d8b7a7d8676896e14f7f54e40630ecbd21e289 WHIRLPOOL d06a23622bfcef053ac4d959952060c8c1649ea0a5e2f759612caf5819a32944b3c7f6d78233fec83944fe7b5535851d7dca4579b7849e08951da18be503ed09
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..d3b2efc2e264
--- /dev/null
+++ b/app-admin/metalog/files/metalog-0.9-metalog-conf.patch
@@ -0,0 +1,11 @@
+--- metalog.conf
++++ 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..196a20eac145
--- /dev/null
+++ b/app-admin/metalog/files/metalog.confd
@@ -0,0 +1,19 @@
+# /etc/conf.d/metalog
+# $Id$
+
+# 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 100755
index 000000000000..a921c0d574d3
--- /dev/null
+++ b/app-admin/metalog/files/metalog.initd
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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..c0a75cd058dd
--- /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>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">metalog</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-admin/metalog/metalog-3-r1.ebuild b/app-admin/metalog/metalog-3-r1.ebuild
new file mode 100644
index 000000000000..b7ec541593e4
--- /dev/null
+++ b/app-admin/metalog/metalog-3-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+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 ~sparc-fbsd ~x86-fbsd"
+IUSE="unicode"
+
+RDEPEND=">=dev-libs/libpcre-3.4"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-arch/xz-utils"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.9-metalog-conf.patch
+}
+
+src_configure() {
+ econf $(use_with unicode)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog README NEWS metalog.conf
+
+ into /
+ dosbin "${FILESDIR}"/consolelog.sh || die
+
+ 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
+}