From f678fa0bf73f22a90344cfd9441e29a82d270b41 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 15 Jan 2010 13:20:34 +0100 Subject: [PATCH] Split services into separate files The example configuration file pazpar2.cfg.dist now includes a default service default.xml (part of etc). And default.xml includes settings/edu.xml. The default.xml file (not to be confused with settings/defaults.xml) is a template for jsdemo and other services. The Debian package installs /etc/pazpar2/server.xml which is now the main pazpar2 configuration (used to be called pazpar2.cfg). server.xml includes services from /etc/pazpar2/services-enabled/*.xml . The default.xml (from etc) is installed in /etc/pazpar2/services-available and a symlink to it is created from services-enabled. The default.xml service is unnamed and, thus, will be used by jsdemo and test1. --- debian/cfg.patch | 5 --- debian/pazpar2.default | 2 +- debian/pazpar2.dirs | 2 + debian/pazpar2.postinst | 17 ++++++++ debian/rules | 4 +- debian/server.xml | 16 +++++++ etc/default.xml | 111 +++++++++++++++++++++++++++++++++++++++++++++++ etc/pazpar2.cfg.dist | 106 +------------------------------------------- 8 files changed, 150 insertions(+), 113 deletions(-) delete mode 100644 debian/cfg.patch create mode 100644 debian/pazpar2.postinst create mode 100644 debian/server.xml create mode 100644 etc/default.xml diff --git a/debian/cfg.patch b/debian/cfg.patch deleted file mode 100644 index fa3c658..0000000 --- a/debian/cfg.patch +++ /dev/null @@ -1,5 +0,0 @@ -5,6c5 -< -< ---- -> diff --git a/debian/pazpar2.default b/debian/pazpar2.default index 66c435a..ccf9281 100644 --- a/debian/pazpar2.default +++ b/debian/pazpar2.default @@ -7,4 +7,4 @@ # # Additional options that are passed to the Daemon. -DAEMON_OPTS="-D -u nobody -p /var/run/pazpar2.pid -l /var/log/pazpar2.log -f /etc/pazpar2/pazpar2.cfg" +DAEMON_OPTS="-D -u nobody -p /var/run/pazpar2.pid -l /var/log/pazpar2.log -f /etc/pazpar2/server.xml" diff --git a/debian/pazpar2.dirs b/debian/pazpar2.dirs index 06f5d75..6e3ab5d 100644 --- a/debian/pazpar2.dirs +++ b/debian/pazpar2.dirs @@ -1,4 +1,6 @@ etc/pazpar2 etc/pazpar2/settings +etc/pazpar2/services-enabled +etc/pazpar2/services-available usr/bin usr/sbin diff --git a/debian/pazpar2.postinst b/debian/pazpar2.postinst new file mode 100644 index 0000000..bf54741 --- /dev/null +++ b/debian/pazpar2.postinst @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +if [ "$1" != "configure" ]; then + exit 0 +fi +if [ -x "/etc/init.d/pazpar2" ]; then + update-rc.d pazpar2 defaults >/dev/null + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d pazpar2 start || exit $? + else + /etc/init.d/pazpar2 start || exit $? + fi + ln -sf ../services-available/default.xml \ + /etc/pazpar2/services-enabled/default.xml +fi +exit 0 diff --git a/debian/rules b/debian/rules index 802373f..2281048 100755 --- a/debian/rules +++ b/debian/rules @@ -78,8 +78,8 @@ binary-arch: build install # pazpar2-doc package mv $(CURDIR)/debian/pazpar2/usr/share/doc/pazpar2/* $(CURDIR)/debian/pazpar2-doc/usr/share/doc/pazpar2-doc # pazpar2 package - cp $(CURDIR)/etc/pazpar2.cfg.dist $(CURDIR)/debian/pazpar2/etc/pazpar2/pazpar2.cfg - patch $(CURDIR)/debian/pazpar2/etc/pazpar2/pazpar2.cfg $(CURDIR)/debian/cfg.patch + cp $(CURDIR)/debian/server.xml $(CURDIR)/debian/pazpar2/etc/pazpar2/server.xml + cp $(CURDIR)/etc/default.xml $(CURDIR)/debian/pazpar2/etc/pazpar2/services-available/ cp etc/settings/*.xml $(CURDIR)/debian/pazpar2/etc/pazpar2/settings/ cp etc/*.xsl $(CURDIR)/debian/pazpar2/etc/pazpar2/ # pazpar2-apache2 package diff --git a/debian/server.xml b/debian/server.xml new file mode 100644 index 0000000..520f62d --- /dev/null +++ b/debian/server.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/etc/default.xml b/etc/default.xml new file mode 100644 index 0000000..81526b9 --- /dev/null +++ b/etc/default.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/etc/pazpar2.cfg.dist b/etc/pazpar2.cfg.dist index 68e4d47..a66b18e 100644 --- a/etc/pazpar2.cfg.dist +++ b/etc/pazpar2.cfg.dist @@ -4,111 +4,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + -- 1.7.10.4