[Pkg-nagios-changes] [pkg-nagios] r1842 - in merlin/trunk: . debian debian/patches
Hendrik Frenzel
hfrenzel-guest at alioth.debian.org
Mon Mar 8 18:08:57 UTC 2010
Author: hfrenzel-guest
Date: 2010-03-08 18:08:49 +0000 (Mon, 08 Mar 2010)
New Revision: 1842
Added:
merlin/trunk/debian/
merlin/trunk/debian/README.Debian
merlin/trunk/debian/README.source
merlin/trunk/debian/changelog
merlin/trunk/debian/compat
merlin/trunk/debian/config
merlin/trunk/debian/control
merlin/trunk/debian/dirs
merlin/trunk/debian/docs
merlin/trunk/debian/init
merlin/trunk/debian/patches/
merlin/trunk/debian/patches/00list
merlin/trunk/debian/patches/config.dpatch
merlin/trunk/debian/patches/database.dpatch
merlin/trunk/debian/patches/install-script.dpatch
merlin/trunk/debian/patches/makefile.dpatch
merlin/trunk/debian/postinst
merlin/trunk/debian/postrm
merlin/trunk/debian/prerm
merlin/trunk/debian/rules
Log:
[svn-inject] Applying Debian modifications to trunk
Property changes on: merlin/trunk/debian
___________________________________________________________________
Added: mergeWithUpstream
+ 1
Added: merlin/trunk/debian/README.Debian
===================================================================
--- merlin/trunk/debian/README.Debian (rev 0)
+++ merlin/trunk/debian/README.Debian 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,6 @@
+merlin for Debian
+-----------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- Hendrik Frenzel <hfrenzel at scunc.net> Fri, 05 Mar 2010 13:32:10 +0100
Added: merlin/trunk/debian/README.source
===================================================================
--- merlin/trunk/debian/README.source (rev 0)
+++ merlin/trunk/debian/README.source 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,17 @@
+merlin for Debian
+-----------------
+
+<this file describes information about the source package, see Debian policy
+manual section 4.14. You WILL either need to modify or delete this file>
+
+This package uses dpatch to manage all modifications to the upstream
+source. Changes are stored in the source package as diffs in
+debian/patches and applied during the build. Please see:
+
+ /usr/share/doc/dpatch/README.source
+
+for more information on how to apply the patches, modify patches, or
+remove a patch.
+
+
+
Added: merlin/trunk/debian/changelog
===================================================================
--- merlin/trunk/debian/changelog (rev 0)
+++ merlin/trunk/debian/changelog 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,5 @@
+merlin (0.6.7~b1-1) unstable; urgency=low
+
+ * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
+
+ -- Hendrik Frenzel <hfrenzel at scunc.net> Fri, 05 Mar 2010 13:32:10 +0100
Added: merlin/trunk/debian/compat
===================================================================
--- merlin/trunk/debian/compat (rev 0)
+++ merlin/trunk/debian/compat 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1 @@
+7
Added: merlin/trunk/debian/config
===================================================================
--- merlin/trunk/debian/config (rev 0)
+++ merlin/trunk/debian/config 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,35 @@
+#!/bin/sh
+# debian config script for merlin
+#
+# see: dh_installdeb(1)
+set -e
+
+. /usr/share/debconf/confmodule
+
+dbc_dbuser=merlin
+dbc_dbname=merlin
+
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/config.mysql
+ dbc_go merlin $@
+fi
+db_stop
+
+# summary of how this script can be called:
+# * <config> `configure' <installed-version> (from dpkg-preconfigure)
+# * <config> `configure' <installed-version> (from postinst)
+# * <config> `reconfigure' <installed-version> (from dpkg-reconfigure)
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+ configure|reconfigure)
+ ;;
+ *)
+ echo "config called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
Added: merlin/trunk/debian/control
===================================================================
--- merlin/trunk/debian/control (rev 0)
+++ merlin/trunk/debian/control 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,18 @@
+Source: merlin
+Section: net
+Priority: extra
+Maintainer: Hendrik Frenzel <hfrenzel at scunc.net>
+Build-Depends: cdbs, dpatch, debhelper (>= 7), libdbi0-dev
+Standards-Version: 3.8.4
+Homepage: http://www.op5.org/community/projects/merlin
+Vcs-Svn: svn://svn.debian.org/svn/pkg-nagios/merlin/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-nagios/merlin/trunk/
+Dm-Upload-Allowed: yes
+
+Package: merlin
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Module for Effortless Redundancy and Loadbalancing In Nagios
+ The Merlin project, or Module for Effortless Redundancy and Loadbalancing In
+ Nagios, for setting up distributed Nagios installations and allowing Nagios
+ processes to exchange information directly.
Added: merlin/trunk/debian/dirs
===================================================================
--- merlin/trunk/debian/dirs (rev 0)
+++ merlin/trunk/debian/dirs 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,2 @@
+etc/merlin
+
Added: merlin/trunk/debian/docs
===================================================================
--- merlin/trunk/debian/docs (rev 0)
+++ merlin/trunk/debian/docs 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1 @@
+README
Added: merlin/trunk/debian/init
===================================================================
--- merlin/trunk/debian/init (rev 0)
+++ merlin/trunk/debian/init 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,299 @@
+#!/bin/sh
+#
+# Example init.d script with LSB support.
+#
+# Please read this init.d carefully and modify the sections to
+# adjust it to the program you want to run.
+#
+# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs at debian.org>
+#
+# This is free software; you may redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2,
+# or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License with
+# the Debian operating system, in /usr/share/common-licenses/GPL; if
+# not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+#
+### BEGIN INIT INFO
+# Provides: merlin
+# Required-Start: $network $local_fs
+# Required-Stop:
+# Should-Start: $named
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: <Enter a short description of the sortware>
+# Description: <Enter a long description of the software>
+# <...>
+# <...>
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMON=/usr/sbin/merlind # Introduce the server's location here
+NAME=merlin # Introduce the short server's name here
+DESC=merlin # Introduce a short description here
+LOGDIR=/var/log/merlin # Log directory to use
+
+PIDFILE=/var/run/$NAME/$NAME.pid
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Default options, these can be overriden by the information
+# at /etc/default/$NAME
+DAEMON_OPTS="-c /etc/merlin/merlin.conf" # Additional options given to the server
+
+DIETIME=10 # Time to wait for the server to die, in seconds
+ # If this value is set too low you might not
+ # let some servers to die gracefully and
+ # 'restart' will not work
+
+#STARTTIME=2 # Time to wait for the server to start, in seconds
+ # If this value is set each time the server is
+ # started (on start or restart) the script will
+ # stall to try to determine if it is running
+ # If it is not set and the server takes time
+ # to setup a pid file the log message might
+ # be a false positive (says it did not start
+ # when it actually did)
+
+LOGFILE=$LOGDIR/$NAME.log # Server logfile
+#DAEMONUSER=merlin # Users to run the daemons as. If this value
+ # is set start-stop-daemon will chuid the server
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+ . /etc/default/$NAME
+fi
+
+# Use this if you want the user to explicitly set 'RUN' in
+# /etc/default/
+#if [ "x$RUN" != "xyes" ] ; then
+# log_failure_msg "$NAME disabled, please adjust the configuration to your needs "
+# log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it."
+# exit 0
+#fi
+
+# Check that the user exists (if we set a user)
+# Does the user exist?
+if [ -n "$DAEMONUSER" ] ; then
+ if getent passwd | grep -q "^$DAEMONUSER:"; then
+ # Obtain the uid and gid
+ DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
+ DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
+ else
+ log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist."
+ exit 0
+ fi
+fi
+
+
+set -e
+
+running_pid() {
+# Check if a given process pid's cmdline matches a given name
+ pid=$1
+ name=$2
+ [ -z "$pid" ] && return 1
+ [ ! -d /proc/$pid ] && return 1
+ cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
+ # Is this the expected server
+ [ "$cmd" != "$name" ] && return 1
+ return 0
+}
+
+running() {
+# Check if the process is running looking at /proc
+# (works for all users)
+
+ # No pidfile, probably no daemon present
+ [ ! -f "$PIDFILE" ] && return 1
+ pid=`cat $PIDFILE`
+ running_pid $pid $DAEMON || return 1
+ return 0
+}
+
+start_server() {
+ if [ ! -d "/var/run/merlin" ]; then
+ mkdir -p "/var/run/merlin"
+ fi
+# Start the process using the wrapper
+ if [ -z "$DAEMONUSER" ] ; then
+ start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
+ errcode=$?
+ else
+# if we are using a daemonuser then change the user id
+ start-stop-daemon --start --quiet --pidfile $PIDFILE \
+ --chuid $DAEMONUSER \
+ --exec $DAEMON -- $DAEMON_OPTS
+ errcode=$?
+ fi
+ return $errcode
+}
+
+stop_server() {
+# Stop the process using the wrapper
+ if [ -z "$DAEMONUSER" ] ; then
+ killproc -p $PIDFILE $DAEMON
+ errcode=$?
+ else
+# if we are using a daemonuser then look for process that match
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+ --user $DAEMONUSER \
+ --exec $DAEMON
+ errcode=$?
+ fi
+
+ return $errcode
+}
+
+reload_server() {
+ [ ! -f "$PIDFILE" ] && return 1
+ pid=pidofproc $PIDFILE # This is the daemon's pid
+ # Send a SIGHUP
+ kill -1 $pid
+ return $?
+}
+
+force_stop() {
+# Force the process to die killing it manually
+ [ ! -e "$PIDFILE" ] && return
+ if running ; then
+ kill -15 $pid
+ # Is it really dead?
+ sleep "$DIETIME"s
+ if running ; then
+ kill -9 $pid
+ sleep "$DIETIME"s
+ if running ; then
+ echo "Cannot kill $NAME (pid=$pid)!"
+ exit 0
+ fi
+ fi
+ fi
+ rm -f $PIDFILE
+}
+
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DESC " "$NAME"
+ # Check if it's running first
+ if running ; then
+ log_progress_msg "apparently already running"
+ log_end_msg 0
+ exit 0
+ fi
+ if start_server ; then
+ # NOTE: Some servers might die some time after they start,
+ # this code will detect this issue if STARTTIME is set
+ # to a reasonable value
+ [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
+ if running ; then
+ # It's ok, the server started and is running
+ log_end_msg 0
+ else
+ # It is not running after we did start
+ log_end_msg 1
+ fi
+ else
+ # Either we could not start it
+ log_end_msg 1
+ fi
+ ;;
+ stop)
+ log_daemon_msg "Stopping $DESC" "$NAME"
+ if running ; then
+ # Only stop the server if we see it running
+ errcode=0
+ stop_server || errcode=$?
+ log_end_msg $errcode
+ else
+ # If it's not running don't do anything
+ log_progress_msg "apparently not running"
+ log_end_msg 0
+ exit 0
+ fi
+ ;;
+ force-stop)
+ # First try to stop gracefully the program
+ $0 stop
+ if running; then
+ # If it's still running try to kill it more forcefully
+ log_daemon_msg "Stopping (force) $DESC" "$NAME"
+ errcode=0
+ force_stop || errcode=$?
+ log_end_msg $errcode
+ fi
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ errcode=0
+ stop_server || errcode=$?
+ # Wait some sensible amount, some server need this
+ [ -n "$DIETIME" ] && sleep $DIETIME
+ start_server || errcode=$?
+ [ -n "$STARTTIME" ] && sleep $STARTTIME
+ running || errcode=$?
+ log_end_msg $errcode
+ ;;
+ status)
+
+ log_daemon_msg "Checking status of $DESC" "$NAME"
+ if running ; then
+ log_progress_msg "running"
+ log_end_msg 0
+ else
+ log_progress_msg "apparently not running"
+ log_end_msg 1
+ exit 0
+ fi
+ ;;
+ # Use this if the daemon cannot reload
+ reload)
+ log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
+ log_warning_msg "cannot re-read the config file (use restart)."
+ ;;
+ # And this if it cann
+ #reload)
+ #
+ # If the daemon can reload its config files on the fly
+ # for example by sending it SIGHUP, do it here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this a do-nothing entry.
+ #
+ # log_daemon_msg "Reloading $DESC configuration files" "$NAME"
+ # if running ; then
+ # reload_server
+ # if ! running ; then
+ # Process died after we tried to reload
+ # log_progress_msg "died on reload"
+ # log_end_msg 1
+ # exit 0
+ # fi
+ # else
+ # log_progress_msg "server is not running"
+ # log_end_msg 1
+ # exit 0
+ # fi
+ #;;
+
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
Added: merlin/trunk/debian/patches/00list
===================================================================
--- merlin/trunk/debian/patches/00list (rev 0)
+++ merlin/trunk/debian/patches/00list 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,4 @@
+makefile
+install-script
+config
+database
Added: merlin/trunk/debian/patches/config.dpatch
===================================================================
--- merlin/trunk/debian/patches/config.dpatch (rev 0)
+++ merlin/trunk/debian/patches/config.dpatch 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,62 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## config.dpatch by Hendrik Frenzel <hfrenzel at scunc.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad merlin-0.6.7~b1~/example.conf merlin-0.6.7~b1/example.conf
+--- merlin-0.6.7~b1~/example.conf 2010-02-24 13:40:34.000000000 +0100
++++ merlin-0.6.7~b1/example.conf 2010-03-08 17:01:54.000000000 +0100
+@@ -3,7 +3,7 @@
+ #
+ # Default options have been commented out
+ #
+-ipc_socket = @@DESTDIR@@/ipc.sock;
++ipc_socket = /var/run/merlin/ipc.sock;
+
+ # address to listen to. 0.0.0.0 is default
+ #address = 0.0.0.0;
+@@ -11,15 +11,15 @@
+ # module-specific configuration options.
+ module {
+ # textual log of normal hum-drum events
+- log_file = @@DESTDIR@@/logs/neb.log;
++ log_file = /var/log/merlin/neb.log;
+ }
+
+ # daemon-specific config options
+ daemon {
+- pidfile = /var/run/merlin.pid;
++ pidfile = /var/run/merlin/merlin.pid;
+
+ # same as the "module" section above
+- log_file = @@DESTDIR@@/logs/daemon.log;
++ log_file = /var/log/merlin/daemon.log;
+
+ # The import_program is responsible for priming the merlin database
+ # with configuration information and an initial import of status data.
+@@ -32,17 +32,17 @@
+ # --db-host=database_host
+ # The database parameters are taken from "database" section if such
+ # a section exists.
+- import_program = php @@DESTDIR@@/import.php;
++ import_program = php /usr/share/merlin/import.php;
+
+ # port to listen to. 15551 is default. This is a daemon
+ # specific config setting, as the module never listens to
+ # the network
+ port = 15551;
+ database {
+- name = @@DBNAME@@;
+- user = @@DBUSER@@;
+- pass = @@DBPASS@@;
+- host = localhost;
+- type = @@DBTYPE@@;
++ name = _DBC_DBNAME_;
++ user = _DBC_DBUSER_;
++ pass = _DBC_DBPASS_;
++ host = _DBC_DBSERVER_;
++ type = _DBC_DBTYPE_;
+ }
+ }
Property changes on: merlin/trunk/debian/patches/config.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Added: merlin/trunk/debian/patches/database.dpatch
===================================================================
--- merlin/trunk/debian/patches/database.dpatch (rev 0)
+++ merlin/trunk/debian/patches/database.dpatch 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,317 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## database.dpatch by Hendrik Frenzel <hfrenzel at scunc.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad merlin-0.6.7~b1~/db.sql merlin-0.6.7~b1/db.sql
+--- merlin-0.6.7~b1~/db.sql 2010-02-24 13:40:34.000000000 +0100
++++ merlin-0.6.7~b1/db.sql 2010-03-08 16:47:43.000000000 +0100
+@@ -3,7 +3,7 @@
+ -- Database design for the merlin database
+ --
+
+-DROP TABLE IF EXISTS contact_access;
++-- DROP TABLE IF EXISTS contact_access;
+ CREATE TABLE contact_access(
+ contact int,
+ host int,
+@@ -11,7 +11,7 @@
+ KEY contact(contact)
+ );
+
+-DROP TABLE IF EXISTS downtime;
++-- DROP TABLE IF EXISTS downtime;
+ CREATE TABLE downtime(
+ id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ downtime_id int NOT NULL,
+@@ -32,7 +32,7 @@
+ KEY downtime_id(downtime_id)
+ ) COLLATE latin1_general_cs;
+
+-DROP TABLE IF EXISTS notification;
++-- DROP TABLE IF EXISTS notification;
+ CREATE TABLE notification(
+ instance_id int NOT NULL DEFAULT 0,
+ id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
+@@ -54,7 +54,7 @@
+ KEY contact_name(contact_name)
+ ) COLLATE latin1_general_cs;
+
+-DROP TABLE IF EXISTS program_status;
++-- DROP TABLE IF EXISTS program_status;
+ CREATE TABLE program_status(
+ instance_id int NOT NULL DEFAULT 0 PRIMARY KEY,
+ instance_name varchar(255),
+@@ -85,7 +85,7 @@
+ ) COLLATE latin1_general_cs;
+ INSERT INTO program_status(instance_id, instance_name) VALUES(0, "Local Nagios/Merlin Instance");
+
+-DROP TABLE IF EXISTS scheduled_downtime;
++-- DROP TABLE IF EXISTS scheduled_downtime;
+ CREATE TABLE scheduled_downtime(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+@@ -106,7 +106,7 @@
+ UNIQUE KEY downtime_id(downtime_id)
+ ) COLLATE latin1_general_cs;
+
+-DROP TABLE IF EXISTS comment;
++-- DROP TABLE IF EXISTS comment;
+ CREATE TABLE comment(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -128,14 +128,14 @@
+ ) COLLATE latin1_general_cs;
+
+
+-DROP TABLE IF EXISTS gui_action_log;
++-- DROP TABLE IF EXISTS gui_action_log;
+ CREATE TABLE gui_action_log(
+ user VARCHAR(30) NOT NULL,
+ action VARCHAR(50) NOT NULL,
+ time TIMESTAMP
+ ) COLLATE latin1_general_cs;
+
+-DROP TABLE IF EXISTS gui_access;
++-- DROP TABLE IF EXISTS gui_access;
+ CREATE TABLE gui_access(
+ user VARCHAR(30) NOT NULL PRIMARY KEY,
+ view BOOL,
+@@ -151,7 +151,7 @@
+ INSERT INTO gui_access VALUES('monitor', 1, 1, 1, 1, 1, 1, 1, 1, 1);
+
+
+-DROP TABLE IF EXISTS contact;
++-- DROP TABLE IF EXISTS contact;
+ CREATE TABLE contact(
+ instance_id INT NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -182,14 +182,14 @@
+ CREATE UNIQUE INDEX contact_name ON contact(contact_name);
+
+ -- contact, contactgroup:
+-DROP TABLE IF EXISTS contact_contactgroup;
++-- DROP TABLE IF EXISTS contact_contactgroup;
+ CREATE TABLE contact_contactgroup(
+ contact INT NOT NULL,
+ contactgroup INT NOT NULL
+ );
+
+
+-DROP TABLE IF EXISTS contactgroup;
++-- DROP TABLE IF EXISTS contactgroup;
+ CREATE TABLE contactgroup(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -198,7 +198,7 @@
+ ) COLLATE latin1_general_cs;
+ CREATE UNIQUE INDEX contactgroup_name ON contactgroup(contactgroup_name);
+
+-DROP TABLE IF EXISTS timeperiod;
++-- DROP TABLE IF EXISTS timeperiod;
+ CREATE TABLE timeperiod(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -215,14 +215,14 @@
+ CREATE UNIQUE INDEX timeperiod_name ON timeperiod(timeperiod_name);
+
+ -- junction table for timeperiod<->exclude
+-DROP TABLE IF EXISTS timeperiod_exclude;
++-- DROP TABLE IF EXISTS timeperiod_exclude;
+ CREATE TABLE timeperiod_exclude(
+ timeperiod INT NOT NULL,
+ exclude INT NOT NULL
+ ) COLLATE latin1_general_cs;
+
+
+-DROP TABLE IF EXISTS command;
++-- DROP TABLE IF EXISTS command;
+ CREATE TABLE command(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -233,7 +233,7 @@
+
+
+ -- host table
+-DROP TABLE IF EXISTS host;
++-- DROP TABLE IF EXISTS host;
+ CREATE TABLE host(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -336,32 +336,32 @@
+ CREATE UNIQUE INDEX host_name ON host(host_name);
+
+ -- junctions for host objects
+-DROP TABLE IF EXISTS host_parents;
++-- DROP TABLE IF EXISTS host_parents;
+ CREATE TABLE host_parents(
+ host INT NOT NULL,
+ parents INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS host_contact;
++-- DROP TABLE IF EXISTS host_contact;
+ CREATE TABLE host_contact(
+ host INT NOT NULL,
+ contact INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS host_contactgroup;
++-- DROP TABLE IF EXISTS host_contactgroup;
+ CREATE TABLE host_contactgroup(
+ host INT NOT NULL,
+ contactgroup INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS host_hostgroup;
++-- DROP TABLE IF EXISTS host_hostgroup;
+ CREATE TABLE host_hostgroup(
+ host INT NOT NULL,
+ hostgroup INT NOT NULL
+ ) ;
+
+
+-DROP TABLE IF EXISTS hostgroup;
++-- DROP TABLE IF EXISTS hostgroup;
+ CREATE TABLE hostgroup(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL PRIMARY KEY,
+@@ -374,7 +374,7 @@
+ CREATE UNIQUE INDEX hostgroup_name ON hostgroup(hostgroup_name);
+
+
+-DROP TABLE IF EXISTS service;
++-- DROP TABLE IF EXISTS service;
+ CREATE TABLE service(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -474,26 +474,26 @@
+ ) COLLATE latin1_general_cs;
+
+ -- junctions for service objects
+-DROP TABLE IF EXISTS service_contact;
++-- DROP TABLE IF EXISTS service_contact;
+ CREATE TABLE service_contact(
+ service INT NOT NULL,
+ contact INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS service_contactgroup;
++-- DROP TABLE IF EXISTS service_contactgroup;
+ CREATE TABLE service_contactgroup(
+ service INT NOT NULL,
+ contactgroup INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS service_servicegroup;
++-- DROP TABLE IF EXISTS service_servicegroup;
+ CREATE TABLE service_servicegroup(
+ service INT NOT NULL,
+ servicegroup INT NOT NULL
+ ) ;
+
+
+-DROP TABLE IF EXISTS servicegroup;
++-- DROP TABLE IF EXISTS servicegroup;
+ CREATE TABLE servicegroup(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -506,7 +506,7 @@
+ CREATE UNIQUE INDEX servicegroup_name ON servicegroup(servicegroup_name);
+
+
+-DROP TABLE IF EXISTS servicedependency;
++-- DROP TABLE IF EXISTS servicedependency;
+ CREATE TABLE servicedependency(
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ service INT NOT NULL,
+@@ -518,7 +518,7 @@
+ ) COLLATE latin1_general_cs;
+
+
+-DROP TABLE IF EXISTS serviceescalation;
++-- DROP TABLE IF EXISTS serviceescalation;
+ CREATE TABLE serviceescalation(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -531,20 +531,20 @@
+ ) COLLATE latin1_general_cs;
+
+ -- junctions for serviceescalation objects
+-DROP TABLE IF EXISTS serviceescalation_contact;
++-- DROP TABLE IF EXISTS serviceescalation_contact;
+ CREATE TABLE serviceescalation_contact(
+ serviceescalation INT NOT NULL,
+ contact INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS serviceescalation_contactgroup;
++-- DROP TABLE IF EXISTS serviceescalation_contactgroup;
+ CREATE TABLE serviceescalation_contactgroup(
+ serviceescalation INT NOT NULL,
+ contactgroup INT NOT NULL
+ ) ;
+
+
+-DROP TABLE IF EXISTS hostdependency;
++-- DROP TABLE IF EXISTS hostdependency;
+ CREATE TABLE hostdependency(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -556,7 +556,7 @@
+ notification_failure_options VARCHAR(15)
+ ) COLLATE latin1_general_cs;
+
+-DROP TABLE IF EXISTS hostescalation;
++-- DROP TABLE IF EXISTS hostescalation;
+ CREATE TABLE hostescalation(
+ instance_id int NOT NULL DEFAULT 0,
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+@@ -570,13 +570,13 @@
+ ) COLLATE latin1_general_cs;
+
+
+-DROP TABLE IF EXISTS hostescalation_contact;
++-- DROP TABLE IF EXISTS hostescalation_contact;
+ CREATE TABLE hostescalation_contact(
+ hostescalation INT NOT NULL,
+ contact INT NOT NULL
+ ) ;
+
+-DROP TABLE IF EXISTS hostescalation_contactgroup;
++-- DROP TABLE IF EXISTS hostescalation_contactgroup;
+ CREATE TABLE hostescalation_contactgroup(
+ hostescalation INT NOT NULL,
+ contactgroup INT NOT NULL
+@@ -584,7 +584,7 @@
+
+
+ -- custom variables
+-DROP TABLE IF EXISTS custom_vars;
++-- DROP TABLE IF EXISTS custom_vars;
+ CREATE TABLE custom_vars(
+ obj_type VARCHAR(30) NOT NULL,
+ obj_id INT NOT NULL,
+@@ -597,16 +597,16 @@
+ -- gui <=> webconfig db scheme cross-pollination ends here
+
+ -- Obsoleted tables
+-DROP TABLE IF EXISTS hostextinfo;
+-DROP TABLE IF EXISTS serviceextinfo;
++-- DROP TABLE IF EXISTS hostextinfo;
++-- DROP TABLE IF EXISTS serviceextinfo;
+
+-DROP TABLE IF EXISTS `db_version`;
++-- DROP TABLE IF EXISTS `db_version`;
+ CREATE TABLE `db_version` (
+ `version` int(11)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+ INSERT INTO db_version(version) VALUES(1);
+
+-DROP TABLE IF EXISTS `report_data`;
++-- DROP TABLE IF EXISTS `report_data`;
+ CREATE TABLE `report_data` (
+ `id` int(11) NOT NULL auto_increment,
+ `timestamp` int(11) NOT NULL default '0',
Property changes on: merlin/trunk/debian/patches/database.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Added: merlin/trunk/debian/patches/install-script.dpatch
===================================================================
--- merlin/trunk/debian/patches/install-script.dpatch (rev 0)
+++ merlin/trunk/debian/patches/install-script.dpatch 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,59 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## install-script.dpatch by Hendrik Frenzel <hfrenzel at scunc.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad merlin-0.6.7~b1~/install-merlin.sh merlin-0.6.7~b1/install-merlin.sh
+--- merlin-0.6.7~b1~/install-merlin.sh 2010-02-24 13:40:34.000000000 +0100
++++ merlin-0.6.7~b1/install-merlin.sh 2010-03-08 16:12:24.000000000 +0100
+@@ -142,21 +142,33 @@
+ done
+ test "$missing" && abort "Essential files are missing. Perhaps you need to run 'make'?"
+
+- test -d "$root_path/$dest_dir" || mkdir -p 755 "$root_path/$dest_dir"
+- test -d "$root_path/$dest_dir/logs" || mkdir -p 777 "$root_path/$dest_dir/logs"
+- test -d "$root_path/$dest_dir" || { echo "$root_path/$dest_dir is not a directory"; return 1; }
+- for f in merlind merlin.so install-merlin.sh init.sh db.sql example.conf; do
+- cp "$src_dir/$f" "$root_path/$dest_dir"
+- done
+- macro_subst "$src_dir/example.conf" > "$root_path/$dest_dir/merlin.conf"
+- macro_subst "$src_dir/import.php" > "$root_path/$dest_dir/import.php"
+- macro_subst "$src_dir/object_importer.inc.php" > "$root_path/$dest_dir/object_importer.inc.php"
+- for f in merlind import.php install-merlin.sh init.sh; do
+- chmod 755 "$root_path/$dest_dir/$f"
+- done
+- for f in merlin.conf example.conf merlin.so; do
+- chmod 644 "$root_path/$dest_dir/$f"
+- done
++ #test -d "$root_path/$dest_dir" || mkdir -p 755 "$root_path/$dest_dir"
++ #test -d "$root_path/$dest_dir/logs" || mkdir -p 777 "$root_path/$dest_dir/logs"
++ test -d "$root_path/var/log/merlin" || mkdir -p "$root_path/var/log/merlin"
++ #test -d "$root_path/$dest_dir" || { echo "$root_path/$dest_dir is not a directory"; return 1; }
++ #for f in merlind merlin.so install-merlin.sh init.sh db.sql example.conf; do
++ # cp "$src_dir/$f" "$root_path/$dest_dir"
++ #done
++ test -d "$root_path/usr/sbin" || mkdir -p "$root_path/usr/sbin"
++ cp "$src_dir/merlind" "$root_path/usr/sbin"
++ test -d "$root_path/usr/lib/merlin" || mkdir -p "$root_path/usr/lib/merlin"
++ cp "$src_dir/merlin.so" "$root_path/usr/lib/merlin"
++ test -d "$root_path/usr/share/dbconfig-common/data/merlin/install" || \
++ mkdir -p "$root_path/usr/share/dbconfig-common/data/merlin/install"
++ cp "$src_dir/db.sql" "$root_path/usr/share/dbconfig-common/data/merlin/install/mysql"
++ test -d "$root_path/usr/share/merlin/dpkg" || mkdir -p "$root_path/usr/share/merlin/dpkg"
++ #macro_subst "$src_dir/example.conf" > "$root_path/$dest_dir/merlin.conf"
++ #macro_subst "$src_dir/import.php" > "$root_path/$dest_dir/import.php"
++ #macro_subst "$src_dir/object_importer.inc.php" > "$root_path/$dest_dir/object_importer.inc.php"
++ macro_subst "$src_dir/example.conf" > "$root_path/usr/share/merlin/dpkg/merlin.conf"
++ macro_subst "$src_dir/import.php" > "$root_path/usr/share/merlin/import.php"
++ macro_subst "$src_dir/object_importer.inc.php" > "$root_path/usr/share/merlin/object_importer.inc.php"
++ #for f in merlind import.php install-merlin.sh init.sh; do
++ # chmod 755 "$root_path/$dest_dir/$f"
++ #done
++ #for f in merlin.conf example.conf merlin.so; do
++ # chmod 644 "$root_path/$dest_dir/$f"
++ #done
+ }
+
+ install_init ()
Property changes on: merlin/trunk/debian/patches/install-script.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Added: merlin/trunk/debian/patches/makefile.dpatch
===================================================================
--- merlin/trunk/debian/patches/makefile.dpatch (rev 0)
+++ merlin/trunk/debian/patches/makefile.dpatch 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## makefile.dpatch by Hendrik Frenzel <hfrenzel at scunc.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad merlin-0.6.7~b1~/Makefile merlin-0.6.7~b1/Makefile
+--- merlin-0.6.7~b1~/Makefile 2010-02-24 13:40:34.000000000 +0100
++++ merlin-0.6.7~b1/Makefile 2010-03-08 16:12:55.000000000 +0100
+@@ -26,7 +26,7 @@
+
+ install: all
+ @echo "Installing to $(DESTDIR)"
+- sh install-merlin.sh --dest-dir="$(DESTDIR)"
++ sh install-merlin.sh --root="$(DESTDIR)" --install="files"
+
+ check:
+ @for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i 2>&1; done | grep -v /usr/include
Property changes on: merlin/trunk/debian/patches/makefile.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Added: merlin/trunk/debian/postinst
===================================================================
--- merlin/trunk/debian/postinst (rev 0)
+++ merlin/trunk/debian/postinst 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,67 @@
+#!/bin/sh
+# postinst script for merlin
+#
+# see: dh_installdeb(1)
+
+set -e
+
+. /usr/share/debconf/confmodule
+if [ -f /usr/share/dbconfig-common/dpkg/postinst.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/postinst.mysql
+ dbc_generate_include='template:/etc/merlin/merlin.conf'
+ dbc_generate_include_args='--ucf -O root:nagios -m 640 -o template_infile=/usr/share/merlin/dpkg/merlin.conf'
+ dbc_go merlin $@
+fi
+
+setperm() {
+ user="$1"
+ group="$2"
+ mode="$3"
+ file="$4"
+ shift 4
+ # only do something when no setting exists
+ if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+ chown "$user":"$group" "$file"
+ chmod "$mode" "$file"
+ fi
+ unset user
+ unset group
+ unset mode
+ unset file
+}
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ setperm "root" "nagios" 775 "/var/log/merlin"
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+db_stop
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Added: merlin/trunk/debian/postrm
===================================================================
--- merlin/trunk/debian/postrm (rev 0)
+++ merlin/trunk/debian/postrm 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# postrm script for merlin
+#
+# see: dh_installdeb(1)
+
+set -e
+
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/postrm.mysql
+ dbc_go merlin $@
+fi
+
+if [ "$1" = "purge" ]; then
+ db_purge
+ rm -f /etc/merlin/merlin.conf
+ ucf --purge /etc/merlin/merlin.conf
+fi
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Added: merlin/trunk/debian/prerm
===================================================================
--- merlin/trunk/debian/prerm (rev 0)
+++ merlin/trunk/debian/prerm 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,42 @@
+#!/bin/sh
+# prerm script for merlin
+#
+# see: dh_installdeb(1)
+
+set -e
+
+. /usr/share/debconf/confmodule
+. /usr/share/dbconfig-common/dpkg/prerm.mysql
+dbc_go merlin $@
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Added: merlin/trunk/debian/rules
===================================================================
--- merlin/trunk/debian/rules (rev 0)
+++ merlin/trunk/debian/rules 2010-03-08 18:08:49 UTC (rev 1842)
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/makefile.mk
+include /usr/share/cdbs/1/rules/dpatch.mk
+
+# Add here any variable or target overrides you need.
+DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(CURDIR)/debian/merlin
+
Property changes on: merlin/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
+ *
More information about the Pkg-nagios-changes
mailing list