app-admin/logstash-bin: version bump to 2.1.0
authorTomas Mozes <tmozes@sygic.com>
Mon, 7 Dec 2015 09:29:06 +0000 (10:29 +0100)
committerIan Delaney <idella4@gentoo.org>
Mon, 7 Dec 2015 11:37:18 +0000 (19:37 +0800)
app-admin/logstash-bin/files/agent.conf.sample-r2 [new file with mode: 0644]
app-admin/logstash-bin/files/logstash.confd-r2 [new file with mode: 0644]
app-admin/logstash-bin/files/logstash.initd-r2 [new file with mode: 0644]
app-admin/logstash-bin/logstash-bin-2.1.0.ebuild [new file with mode: 0644]
app-admin/logstash-bin/metadata.xml

diff --git a/app-admin/logstash-bin/files/agent.conf.sample-r2 b/app-admin/logstash-bin/files/agent.conf.sample-r2
new file mode 100644 (file)
index 0000000..96781bd
--- /dev/null
@@ -0,0 +1,20 @@
+input {
+    stdin {
+        type => "stdin"
+    }
+
+    file {
+        type => "syslog"
+        path => [ "/var/log/*.log", "/var/log/debug", "/var/log/messages", "/var/log/syslog" ]
+    }
+}
+
+output {
+    stdout {
+        codec => rubydebug
+    }
+  
+    elasticsearch {
+        hosts => localhost
+    }
+}
diff --git a/app-admin/logstash-bin/files/logstash.confd-r2 b/app-admin/logstash-bin/files/logstash.confd-r2
new file mode 100644 (file)
index 0000000..cb68395
--- /dev/null
@@ -0,0 +1,9 @@
+#LS_USER="root"
+#LS_GROUP="root"
+#LS_CONFDIR="/etc/logstash/conf.d"
+#LS_LOGFILE="/var/log/logstash/logstash.log"
+#LS_PIDFILE="/run/logstash/logstash.pid"
+#LS_HEAP_SIZE="500m"
+#LS_NICE=19
+#LS_OPEN_FILES=16384
+#LS_OPTS=""
diff --git a/app-admin/logstash-bin/files/logstash.initd-r2 b/app-admin/logstash-bin/files/logstash.initd-r2
new file mode 100644 (file)
index 0000000..e4abf59
--- /dev/null
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+LS_USER="${LS_USER:-root}"
+LS_GROUP="${LS_GROUP:-root}"
+LS_CONFDIR="${LS_CONFDIR:-/etc/logstash/conf.d}"
+LS_LOGFILE="${LS_LOGFILE:-/var/log/logstash/logstash.log}"
+LS_PIDFILE="${LS_PIDFILE:-/run/logstash/logstash.pid}"
+LS_NICE="${LS_NICE:-19}"
+LS_OPEN_FILES="${LS_OPEN_FILES:-16384}"
+LS_HEAP_SIZE="${LS_HEAP_SIZE:-500m}"
+
+command="/opt/logstash/bin/logstash"
+command_args="agent --config ${LS_CONFDIR}/*.conf --log ${LS_LOGFILE} ${LS_OPTS}"
+extra_commands="checkconfig"
+command_background="true"
+start_stop_daemon_args="--nicelevel ${LS_NICE} \
+       --user ${LS_USER}:${LS_GROUP} \
+       --env LS_HEAP_SIZE=${LS_HEAP_SIZE}"
+pidfile="${LS_PIDFILE}"
+
+depend() {
+       use net
+       after elasticsearch
+}
+
+checkconfig() {
+       ebegin "Checking your configuration"
+       ${command} ${command_args} --configtest
+       eend $? "Configuration error. Please fix your configuration files."
+}
+
+start_pre() {
+       checkconfig || return 1
+
+       checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_PIDFILE}")"
+       checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_LOGFILE}")"
+       checkpath -f -o "${LS_USER}":"${LS_GROUP}" -m640 "${LS_LOGFILE}"
+
+       rc_ulimit="-n ${LS_OPEN_FILES}"
+}
+
+stop() {
+       ebegin "Stopping logstash"
+       start-stop-daemon --stop \
+               --pidfile="${LS_PIDFILE}" \
+               --retry=TERM/5/KILL/5
+}
diff --git a/app-admin/logstash-bin/logstash-bin-2.1.0.ebuild b/app-admin/logstash-bin/logstash-bin-2.1.0.ebuild
new file mode 100644 (file)
index 0000000..f165b2a
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_PN="${PN/-bin}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Tool for managing events and logs"
+HOMEPAGE="https://www.elastic.co/products/logstash"
+SRC_URI="standard? ( https://download.elastic.co/${MY_PN}/${MY_PN}/${MY_P}.tar.gz )
+       all-plugins? ( https://download.elastic.co/${MY_PN}/${MY_PN}/${MY_PN}-all-plugins-${PV}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+standard all-plugins"
+
+RESTRICT="strip"
+QA_PREBUILT="opt/logstash/vendor/jruby/lib/jni/*/libjffi*.so"
+
+DEPEND=""
+RDEPEND="|| ( virtual/jre:1.8 virtual/jre:1.7 )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+       if use standard && use all-plugins; then
+               die "Both standard and all-plugins USE selected, please pick just one."
+       fi
+}
+
+src_install() {
+       keepdir /etc/"${MY_PN}"/{conf.d,patterns,plugins}
+       keepdir "/var/log/${MY_PN}"
+
+       insinto "/etc/${MY_PN}/conf.d"
+       newins "${FILESDIR}/agent.conf.sample-r2" agent.conf.sample
+
+       insinto "/opt/${MY_PN}"
+       doins -r .
+       fperms 0755 "/opt/${MY_PN}/bin/${MY_PN}" "/opt/${MY_PN}/vendor/jruby/bin/jruby"
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/${MY_PN}.logrotate" ${MY_PN}
+
+       newconfd "${FILESDIR}/${MY_PN}.confd-r2" ${MY_PN}
+       newinitd "${FILESDIR}/${MY_PN}.initd-r2" ${MY_PN}
+}
+
+pkg_postinst() {
+       einfo "Getting started with logstash:"
+       einfo "  https://www.elastic.co/guide/en/logstash/current/getting-started-with-logstash.html"
+       einfo ""
+       einfo "Packages that might be interesting:"
+       einfo "  app-misc/elasticsearch"
+       einfo "  dev-python/elasticsearch-curator"
+       einfo "  www-apps/kibana-bin"
+}
index df4f52042daeda4f06922facdb15725edae73d00..f82fc0180ff613f67a35cf289eb1a7fd2df73a95 100644 (file)
@@ -5,10 +5,14 @@
        <maintainer>
                <email>idella4@gentoo.org</email>
                <name>Ian Delaney</name>
-        </maintainer>
-        <maintainer>
-                <email>hydrapolic@gmail.com</email>
-                <name>Tomas Mozes</name>
-                <description>Proxy maintainer</description>
-        </maintainer>
+       </maintainer>
+       <maintainer>
+               <email>hydrapolic@gmail.com</email>
+               <name>Tomas Mozes</name>
+               <description>Proxy maintainer</description>
+       </maintainer>
+       <use>
+               <flag name="standard">standard distribution package</flag>
+               <flag name="all-plugins">contains the standard distribution package plus all plugins</flag>
+       </use>
 </pkgmetadata>