packages: nagios-merlin/ldflags-as-needed.patch (NEW), nagios-merlin/merlin...

glen glen at pld-linux.org
Tue Dec 7 14:38:53 CET 2010


Author: glen                         Date: Tue Dec  7 13:38:53 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initial

---- Files affected:
packages/nagios-merlin:
   ldflags-as-needed.patch (NONE -> 1.1)  (NEW), merlind.init (NONE -> 1.1)  (NEW), nagios-merlin.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/nagios-merlin/ldflags-as-needed.patch
diff -u /dev/null packages/nagios-merlin/ldflags-as-needed.patch:1.1
--- /dev/null	Tue Dec  7 14:38:53 2010
+++ packages/nagios-merlin/ldflags-as-needed.patch	Tue Dec  7 14:38:48 2010
@@ -0,0 +1,31 @@
+--- merlin-0.9.0/Makefile~	2010-11-01 16:27:11.000000000 +0200
++++ merlin-0.9.0/Makefile	2010-12-07 15:10:45.564915223 +0200
+@@ -51,22 +51,22 @@
+ 	$(QUIET_LINK)$(CC) $^ -o $@ $(LDFLAGS)
+ 
+ mtest: mtest.o sql.o $(TEST_OBJS) $(TEST_DEPS) $(MODULE_OBJS)
+-	$(QUIET_LINK)$(CC) $^ -o $@ $(MTEST_LDFLAGS)
++	$(QUIET_LINK)$(CC) $^ -o $@ $(MTEST_LDFLAGS) $(LDFLAGS)
+ 
+ test-lparse: test-lparse.o lparse.o logutils.o hash.o test_utils.o
+-	$(QUIET_LINK)$(CC) $^ -o $@
++	$(QUIET_LINK)$(CC) $^ -o $@ $(LDFLAGS)
+ 
+ import: $(IMPORT_OBJS)
+-	$(QUIET_LINK)$(CC) $^ -o $@ -ldbi
++	$(QUIET_LINK)$(CC) $^ -o $@ -ldbi $(LDFLAGS)
+ 
+ showlog: $(SHOWLOG_OBJS)
+-	$(QUIET_LINK)$(CC) $^ -o $@
++	$(QUIET_LINK)$(CC) $^ -o $@ $(LDLFAGS)
+ 
+ nebtest: $(NEBTEST_OBJS)
+-	$(QUIET_LINK)$(CC) $^ -o $@ -ldl -rdynamic -Wl,-export-dynamic
++	$(QUIET_LINK)$(CC) $^ -o $@ -ldl -rdynamic -Wl,-export-dynamic $(LDFLAGS)
+ 
+ $(PROG): $(DAEMON_OBJS)
+-	$(QUIET_LINK)$(CC) $(LDFLAGS) $(DAEMON_LDFLAGS) $(LIBS) $^ -o $@
++	$(QUIET_LINK)$(CC) $(LIBS) $(DAEMON_LDFLAGS) $(LDFLAGS) $^ -o $@
+ 
+ $(NEB): $(MODULE_OBJS)
+ 	$(QUIET_LINK)$(CC) $(MOD_LDFLAGS) $(LDFLAGS) $^ -o $@

================================================================
Index: packages/nagios-merlin/merlind.init
diff -u /dev/null packages/nagios-merlin/merlind.init:1.1
--- /dev/null	Tue Dec  7 14:38:53 2010
+++ packages/nagios-merlin/merlind.init	Tue Dec  7 14:38:48 2010
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# Start / Stop the Merlin daemon
+#
+# chkconfig:	2345 90 10
+#
+# description: Merlin is an event-distribution system for Nagios
+#
+# processname:	merlind
+# config:
+# pidfile:
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down "Merlin Daemon"
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/merlind ] && . /etc/sysconfig/merlind
+
+pidfile="/var/run/merlind.pid"
+config_file=/etc/nagios/merlin.conf
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/merlind ]; then
+		msg_already_running "Merlin Daemon"
+		return
+	fi
+
+	msg_starting "Merlin Daemon"
+	daemon /usr/sbin/merlind -c "$config_file"
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/merlind
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/merlind ]; then
+		msg_not_running "Merlin Daemon"
+		return
+	fi
+
+	# Stop daemons.
+	msg_stopping "Merlin Daemon"; busy
+	/usr/sbin/merlind -c "$config_file" -k && ok || fail
+	rm -f /var/lock/subsys/merlind
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/merlind ]; then
+		msg_not_running "Merlin Daemon"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status --pidfile $pidfile merlind
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL

================================================================
Index: packages/nagios-merlin/nagios-merlin.spec
diff -u /dev/null packages/nagios-merlin/nagios-merlin.spec:1.1
--- /dev/null	Tue Dec  7 14:38:53 2010
+++ packages/nagios-merlin/nagios-merlin.spec	Tue Dec  7 14:38:48 2010
@@ -0,0 +1,93 @@
+# $Revision$, $Date$
+Summary:	Merlin: Module for Effortless Redundancy and Loadbalancing In Nagios
+Name:		nagios-merlin
+Version:	0.9.0
+Release:	0.1
+License:	GPL v2
+Group:		Networking
+Source0:	http://www.op5.org/op5media/op5.org/downloads/merlin-%{version}.tar.gz
+# Source0-md5:	dd3fda7b4eea661e65b60f9b6a7d079e
+Source1:	merlind.init
+Patch0:		ldflags-as-needed.patch
+URL:		http://www.op5.org/community/plugin-inventory/op5-projects/merlin
+BuildRequires:	bash
+BuildRequires:	libdbi-devel
+BuildRequires:	rpmbuild(macros) >= 1.228
+BuildRequires:	sed >= 4.0.9
+Requires:	nagios >= 3.2.4
+Requires(post,preun):	/sbin/chkconfig
+Requires:	rc-scripts
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_sysconfdir	/etc/nagios
+%define		_appdir	%{_libdir}/nagios/merlin
+
+%description
+The Merlin project, or Module for Effortless Redundancy and
+Loadbalancing In Nagios, was initially started to create an easy way
+to set up distributed Nagios installations, allowing Nagios processes
+to exchange information directly as an alternative to the standard
+nagios way using NSCA. When starting the Ninja project we realised
+that we could continue the work on Merlin and adopt the project to
+function as backend for Ninja by adding support for storing the status
+information in a database, fault tolearance and some other cool
+things. This means that Merlin now are responsible for providing
+status data, acting as a backend, for the Ninja GUI.
+
+%prep
+%setup -q -n merlin-%{version}
+%patch0 -p1
+
+%build
+%{__make} \
+	V=1 \
+	CC="%{__cc}" \
+	CFLAGS='%{rpmcflags} -pipe $(WARN_FLAGS) -fPIC -fno-strict-aliasing -rdynamic' \
+	LDFLAGS="%{rpmldflags}"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+# script uses bash specificts (pushd, popd)
+bash install-merlin.sh \
+	--root=$RPM_BUILD_ROOT \
+	--dest-dir=%{_appdir} \
+	--libexecdir=%{_libdir} \
+	--batch \
+	--install=files
+
+chmod a+rx $RPM_BUILD_ROOT%{_appdir}/merlin.so
+rm -f $RPM_BUILD_ROOT%{_appdir}/init.sh
+rm -f $RPM_BUILD_ROOT%{_appdir}/install-merlin.sh
+rm -f $RPM_BUILD_ROOT%{_appdir}/example.conf
+
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/merlind
+
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/merlin.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc COPYING HOWTO README SPECS TECHNICAL
+%doc example.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/merlin.conf
+%attr(754,root,root) /etc/rc.d/init.d/merlind
+%{_appdir}/db.sql
+%{_appdir}/object_importer.inc.php
+%attr(755,root,root) %{_appdir}/import
+%attr(755,root,root) %{_appdir}/import.php
+%attr(755,root,root) %{_appdir}/merlin.so
+%attr(755,root,root) %{_appdir}/merlind
+%attr(755,root,root) %{_appdir}/showlog
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2010/12/07 13:38:48  glen
+- initial
================================================================


More information about the pld-cvs-commit mailing list