public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/jmbsvicetto:master commit in: net-im/nagibot/files/, net-im/nagibot/
@ 2013-08-15 12:02 Jorge Manuel B. S. Vicetto
  0 siblings, 0 replies; 3+ messages in thread
From: Jorge Manuel B. S. Vicetto @ 2013-08-15 12:02 UTC (permalink / raw
  To: gentoo-commits

commit:     97c36a3f5fa577f84a235e3273eebc6be6f03a35
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 15 12:09:13 2013 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 12:09:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/jmbsvicetto.git;a=commit;h=97c36a3f

Add nagibot.

---
 net-im/nagibot/Manifest             |  1 +
 net-im/nagibot/files/nagibot.conf   | 23 ++++++++++++++++++
 net-im/nagibot/files/nagibot.init   | 39 ++++++++++++++++++++++++++++++
 net-im/nagibot/metadata.xml         | 12 ++++++++++
 net-im/nagibot/nagibot-0.8.3.ebuild | 47 +++++++++++++++++++++++++++++++++++++
 5 files changed, 122 insertions(+)

diff --git a/net-im/nagibot/Manifest b/net-im/nagibot/Manifest
new file mode 100644
index 0000000..7fadbe9
--- /dev/null
+++ b/net-im/nagibot/Manifest
@@ -0,0 +1 @@
+DIST Nagibot-v0.8.3.tar.gz 15781 SHA256 68c3b160cfc27a6e8e231fd7ddfc97f21cb0c5908451e10b6797dbc80befc813 SHA512 1e3eb004549f2f323e2c59f83c3ae5a8461bc38e90d51dbd9b878ccee1b56db49285485b532f9a5b17cef1b7105ec4879ce73761670444695da126f4032ea752 WHIRLPOOL 3694f23f57f16975baa924fa7a42ee9ee0032fba0133540e7681ffa75232f043ba12de186ec47c9df81a23344a06b337aede9dab6af73b2505634af616f10c78

diff --git a/net-im/nagibot/files/nagibot.conf b/net-im/nagibot/files/nagibot.conf
new file mode 100644
index 0000000..fac89fe
--- /dev/null
+++ b/net-im/nagibot/files/nagibot.conf
@@ -0,0 +1,23 @@
+---
+# User / Group / Prefix
+prefix=nagios
+pidfile=/run/nagibot/nagibot.pid
+---
+# Rooms to join
+noc@conference.ruhr-uni-bochum.de: NagiBot
+---
+# JIDs to inform (none in my case)
+---
+# Configuration
+nagios_msg_fifo: /var/lib/${prefix}/rw/nagibot.fifo
+nagios_cmd_file: /var/lib/${prefix}//rw/icinga.cmd
+nagios_status_log_file: /var/lib/${prefix}/status.dat
+
+bot_status: available
+bot_status_text: Ich bin ein bot, holt mich hier raus ...
+bot_status_priority: 0
+
+# authentication
+jid: me@server
+password: 
+---

diff --git a/net-im/nagibot/files/nagibot.init b/net-im/nagibot/files/nagibot.init
new file mode 100644
index 0000000..dd8748e
--- /dev/null
+++ b/net-im/nagibot/files/nagibot.init
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+get_nagibot_config() {
+	awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
+}
+
+: ${CFGFILE:=/etc/conf.d/nagibot.conf}
+
+command=/usr/bin/nagibot.pl
+command_args="--config ${CFGFILE}"
+pidfile=$(get_nagibot_config pid_file)
+jid=$(get_nagibot_config jid)
+start_stop_daemon_args="--nicelevel ${NICE_LEVEL:-0} --wait 1500"
+extra_started_commands="reload"
+
+depend() {
+	config "$CFGFILE"
+}
+
+start_pre() {
+	checkpath -d $(dirname ${pidfile}) -o ${prefix}:${prefix} -m 0750
+}
+
+start() {
+	ebegin "Starting ${SVCNAME}"
+
+	start-stop-daemon --start -- ${NAGIBOT} $jid ${NAGIBOT_OPTS} -k start
+}
+
+reload() {
+	ebegin "Reloading ${SERVICE}"
+	kill -HUP `cat ${pidfile}`
+	eend $?
+}
+
+# vim: filetype=gentoo-init-d:

diff --git a/net-im/nagibot/metadata.xml b/net-im/nagibot/metadata.xml
new file mode 100644
index 0000000..d54f261
--- /dev/null
+++ b/net-im/nagibot/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+	<email>jmbsvicetto@gentoo.org</email>
+	<name>Jorge Manuel B. S. Vicetto</name>
+</maintainer>
+<upstream>
+  <remote-id type="cpan">AnyEvent-XMPP</remote-id>
+  <remote-id type="cpan-module">AnyEvent::XMPP</remote-id>
+</upstream>
+</pkgmetadata>

diff --git a/net-im/nagibot/nagibot-0.8.3.ebuild b/net-im/nagibot/nagibot-0.8.3.ebuild
new file mode 100644
index 0000000..a33ef73
--- /dev/null
+++ b/net-im/nagibot/nagibot-0.8.3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+MY_PN="Nagibot"
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}-v${PV}.tar.gz"
+DESCRIPTION="Perl extension that uses XMPP for nagios notifications"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="icinga"
+
+RDEPEND="
+	dev-perl/YAML
+	dev-perl/AnyEvent
+	dev-perl/AnyEvent-XMPP
+	dev-perl/Nagios-Status-HostStatus
+	dev-perl/Nagios-Status-ServiceStatus
+	virtual/perl-Text-ParseWords
+	dev-perl/Sys-CpuLoad
+	dev-perl/File-Pid
+	icinga? ( net-analyzer/icinga )
+	!icinga? ( net-analyzer/nagios )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_PN}-v${PV}"
+SRC_TEST="do"
+
+src_prepare() {
+	sed -i -e "s:!/opt/perl/bin/perl:!/usr/bin/perl:" nagibot.pl
+
+	cp "${FILESDIR}/nagibot.conf" "${S}"
+	if ( use icinga ); then
+		sed -i -e "s:prefix=nagios:prefix=icinga:" nagibot.conf
+	fi
+}
+
+src_install() {
+	dobin nagibot.pl
+	newinitd "${FILESDIR}/nagibot.init" nagibot
+	doconfd "nagibot.conf"
+
+	dodoc INSTALL README TODO Changes nagios-misccommands nagibot-example.conf
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] dev/jmbsvicetto:master commit in: net-im/nagibot/files/, net-im/nagibot/
@ 2013-08-15 19:04 Jorge Manuel B. S. Vicetto
  0 siblings, 0 replies; 3+ messages in thread
From: Jorge Manuel B. S. Vicetto @ 2013-08-15 19:04 UTC (permalink / raw
  To: gentoo-commits

commit:     f1ec6313e680ffa11b01d0d2da9f039f5b41ca89
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 15 19:10:55 2013 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 19:10:55 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/jmbsvicetto.git;a=commit;h=f1ec6313

Update the config and split it on conf.d file and a nagibot.cfg file.
Add some warnings.

---
 net-im/nagibot/files/nagibot.cfg    | 21 +++++++++++++++++++++
 net-im/nagibot/files/nagibot.conf   | 26 ++++----------------------
 net-im/nagibot/files/nagibot.init   | 10 +++++++---
 net-im/nagibot/nagibot-0.8.3.ebuild | 16 +++++++++++++++-
 4 files changed, 47 insertions(+), 26 deletions(-)

diff --git a/net-im/nagibot/files/nagibot.cfg b/net-im/nagibot/files/nagibot.cfg
new file mode 100644
index 0000000..41005cd
--- /dev/null
+++ b/net-im/nagibot/files/nagibot.cfg
@@ -0,0 +1,21 @@
+---
+# Rooms to join
+noc@conference.ruhr-uni-bochum.de: NagiBot
+---
+# JIDs to inform
+- me@example.com
+- myself@example.com
+---
+# Configuration
+nagios_msg_fifo: /var/lib/PREFIX/rw/nagibot.fifo
+nagios_cmd_file: /var/lib/PREFIX//rw/icinga.cmd
+nagios_status_log_file: /var/lib/PREFIX/status.dat
+
+bot_status: available
+bot_status_text: I'm a bot for nagios/icinga ...
+bot_status_priority: 0
+
+# authentication
+#jid: me@server
+password: 
+---

diff --git a/net-im/nagibot/files/nagibot.conf b/net-im/nagibot/files/nagibot.conf
index fac89fe..e18f74a 100644
--- a/net-im/nagibot/files/nagibot.conf
+++ b/net-im/nagibot/files/nagibot.conf
@@ -1,23 +1,5 @@
----
 # User / Group / Prefix
-prefix=nagios
-pidfile=/run/nagibot/nagibot.pid
----
-# Rooms to join
-noc@conference.ruhr-uni-bochum.de: NagiBot
----
-# JIDs to inform (none in my case)
----
-# Configuration
-nagios_msg_fifo: /var/lib/${prefix}/rw/nagibot.fifo
-nagios_cmd_file: /var/lib/${prefix}//rw/icinga.cmd
-nagios_status_log_file: /var/lib/${prefix}/status.dat
-
-bot_status: available
-bot_status_text: Ich bin ein bot, holt mich hier raus ...
-bot_status_priority: 0
-
-# authentication
-jid: me@server
-password: 
----
+PIDFILE=/run/nagibot/nagibot.pid
+PREFIX=nagios
+JID=me@server
+FIFO=/var/lib/${PREFIX}/rw/nagibot.fifo

diff --git a/net-im/nagibot/files/nagibot.init b/net-im/nagibot/files/nagibot.init
index dd8748e..7b64556 100644
--- a/net-im/nagibot/files/nagibot.init
+++ b/net-im/nagibot/files/nagibot.init
@@ -11,10 +11,13 @@ get_nagibot_config() {
 
 command=/usr/bin/nagibot.pl
 command_args="--config ${CFGFILE}"
-pidfile=$(get_nagibot_config pid_file)
-jid=$(get_nagibot_config jid)
+pidfile=$(get_nagibot_config PIDFILE)
+jid=$(get_nagibot_config JID)
+fifo=$(get_nagibot_config FIFO)
+prefix=$(get_nagibot_config PREFIX)
 start_stop_daemon_args="--nicelevel ${NICE_LEVEL:-0} --wait 1500"
 extra_started_commands="reload"
+NAGIBOT_OPTS="-d -c ${CFGFILE} ${jid}"
 
 depend() {
 	config "$CFGFILE"
@@ -22,12 +25,13 @@ depend() {
 
 start_pre() {
 	checkpath -d $(dirname ${pidfile}) -o ${prefix}:${prefix} -m 0750
+	checkpath -p ${fifo} -o ${prefix}:${prefix} -m 0750
 }
 
 start() {
 	ebegin "Starting ${SVCNAME}"
 
-	start-stop-daemon --start -- ${NAGIBOT} $jid ${NAGIBOT_OPTS} -k start
+	start-stop-daemon --start -- ${NAGIBOT} ${NAGIBOT_OPTS} -k start
 }
 
 reload() {

diff --git a/net-im/nagibot/nagibot-0.8.3.ebuild b/net-im/nagibot/nagibot-0.8.3.ebuild
index a838afe..33a9f2b 100644
--- a/net-im/nagibot/nagibot-0.8.3.ebuild
+++ b/net-im/nagibot/nagibot-0.8.3.ebuild
@@ -33,8 +33,13 @@ src_prepare() {
 	sed -i -e "s:!/opt/perl/bin/perl:!/usr/bin/perl:" nagibot.pl
 
 	cp "${FILESDIR}/nagibot.conf" "${S}"
+	cp "${FILESDIR}/nagibot.cfg" "${S}"
 	if ( use icinga ); then
-		sed -i -e "s:prefix=nagios:prefix=icinga:" nagibot.conf
+		sed -i -e "s:PREFIX=nagios:PREFIX=icinga:" nagibot.conf
+
+		sed -i -e "s:PREFIX:icinga:" nagibot.cfg
+	else
+		sed -i -e "s:PREFIX:nagios:" nagibot.cfg
 	fi
 }
 
@@ -42,6 +47,15 @@ src_install() {
 	dobin nagibot.pl
 	newinitd "${FILESDIR}/nagibot.init" nagibot
 	doconfd "nagibot.conf"
+	dodir /etc/nagibot
+	insinto /etc/nagibot
+	doins nagibot.cfg
 
 	dodoc INSTALL README TODO Changes nagios-misccommands nagibot-example.conf
 }
+
+pkg_postinst() {
+	ewarn "Please check /etc/conf.d/nagibot.conf and /etc/nagibot/nagibot.cfg"
+	ewarn "as you need to set a few variables. Don't forget to set JID, configure"
+	ewarn "the rooms and the ids to notify and set the password for the JID."
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] dev/jmbsvicetto:master commit in: net-im/nagibot/files/, net-im/nagibot/
@ 2013-08-15 22:27 Jorge Manuel B. S. Vicetto
  0 siblings, 0 replies; 3+ messages in thread
From: Jorge Manuel B. S. Vicetto @ 2013-08-15 22:27 UTC (permalink / raw
  To: gentoo-commits

commit:     5cbc85dd49a8989a2fcbe9b129f277dd56a634b1
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 15 22:34:20 2013 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 22:34:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/jmbsvicetto.git;a=commit;h=5cbc85dd

Improve the init script and fix the conf.d file name.

---
 net-im/nagibot/files/nagibot.init   | 21 ++++++---------------
 net-im/nagibot/nagibot-0.8.3.ebuild |  2 +-
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/net-im/nagibot/files/nagibot.init b/net-im/nagibot/files/nagibot.init
index 7b64556..4eac984 100644
--- a/net-im/nagibot/files/nagibot.init
+++ b/net-im/nagibot/files/nagibot.init
@@ -3,40 +3,31 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
-get_nagibot_config() {
-	awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
-}
-
-: ${CFGFILE:=/etc/conf.d/nagibot.conf}
+: ${CFGFILE:=/etc/nagibot/nagibot.cfg}
 
 command=/usr/bin/nagibot.pl
-command_args="--config ${CFGFILE}"
-pidfile=$(get_nagibot_config PIDFILE)
-jid=$(get_nagibot_config JID)
-fifo=$(get_nagibot_config FIFO)
-prefix=$(get_nagibot_config PREFIX)
 start_stop_daemon_args="--nicelevel ${NICE_LEVEL:-0} --wait 1500"
 extra_started_commands="reload"
-NAGIBOT_OPTS="-d -c ${CFGFILE} ${jid}"
+NAGIBOT_OPTS="-c ${CFGFILE} -d ${JID}"
 
 depend() {
 	config "$CFGFILE"
 }
 
 start_pre() {
-	checkpath -d $(dirname ${pidfile}) -o ${prefix}:${prefix} -m 0750
-	checkpath -p ${fifo} -o ${prefix}:${prefix} -m 0750
+	checkpath -o ${PREFIX}:${PREFIX} -m 0750 -d $(dirname ${PIDFILE})
+	checkpath -o ${PREFIX}:${PREFIX} -m 0750 -p ${FIFO}
 }
 
 start() {
 	ebegin "Starting ${SVCNAME}"
 
-	start-stop-daemon --start -- ${NAGIBOT} ${NAGIBOT_OPTS} -k start
+	start-stop-daemon --start --exec ${NAGIBOT} --pidfile ${PIDFILE} -- ${NAGIBOT_OPTS}
 }
 
 reload() {
 	ebegin "Reloading ${SERVICE}"
-	kill -HUP `cat ${pidfile}`
+	kill -HUP `cat ${PIDFILE}`
 	eend $?
 }
 

diff --git a/net-im/nagibot/nagibot-0.8.3.ebuild b/net-im/nagibot/nagibot-0.8.3.ebuild
index 33a9f2b..9ccf823 100644
--- a/net-im/nagibot/nagibot-0.8.3.ebuild
+++ b/net-im/nagibot/nagibot-0.8.3.ebuild
@@ -46,7 +46,7 @@ src_prepare() {
 src_install() {
 	dobin nagibot.pl
 	newinitd "${FILESDIR}/nagibot.init" nagibot
-	doconfd "nagibot.conf"
+	newconfd "nagibot.conf" nagibot
 	dodir /etc/nagibot
 	insinto /etc/nagibot
 	doins nagibot.cfg


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-15 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15 22:27 [gentoo-commits] dev/jmbsvicetto:master commit in: net-im/nagibot/files/, net-im/nagibot/ Jorge Manuel B. S. Vicetto
  -- strict thread matches above, loose matches on Subject: below --
2013-08-15 19:04 Jorge Manuel B. S. Vicetto
2013-08-15 12:02 Jorge Manuel B. S. Vicetto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox