summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-07-20 22:17:39 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-07-20 22:17:39 +0000
commitef58e692289049ccf74175dbe242ed48e9e61b2f (patch)
tree3930dbfe9bb195515a49a84bd88db4bbdd07e2ef
parentaa9a728062db4083699d8c2899e14052d25f2927 (diff)
downloadbcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.tar.gz
bcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.tar.bz2
bcfg2-ef58e692289049ccf74175dbe242ed48e9e61b2f.zip
Commit of Sami's debian packaging improvements
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1979 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--debian/bcfg2-server.dirs1
-rw-r--r--debian/bcfg2-server.init50
-rw-r--r--debian/bcfg2-server.install12
-rw-r--r--debian/bcfg2-server.postinst51
-rw-r--r--debian/bcfg2-server.postrm42
-rw-r--r--debian/bcfg2.default13
-rw-r--r--debian/bcfg2.init50
-rw-r--r--debian/bcfg2.install10
-rw-r--r--debian/bcfg2.postinst52
-rw-r--r--debian/bcfg2.postrm46
-rw-r--r--debian/changelog10
-rw-r--r--debian/control.in (renamed from debian/control)11
-rw-r--r--debian/pycompat1
-rwxr-xr-xdebian/rules103
14 files changed, 331 insertions, 121 deletions
diff --git a/debian/bcfg2-server.dirs b/debian/bcfg2-server.dirs
new file mode 100644
index 000000000..f1ed6d253
--- /dev/null
+++ b/debian/bcfg2-server.dirs
@@ -0,0 +1 @@
+var/lib/bcfg2
diff --git a/debian/bcfg2-server.init b/debian/bcfg2-server.init
index 8025b72cc..d2d82bd10 100644
--- a/debian/bcfg2-server.init
+++ b/debian/bcfg2-server.init
@@ -5,39 +5,47 @@
# chkconfig: 2345 19 81
# description: bcfg2 server for configuration requests
#
+### BEGIN INIT INFO
+# Provides: bcfg2-server
+# Required-Start: $network
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: Configuration management Server
+# Description: Bcfg2 is a configuration management system that builds
+# installs configuration files served by bcfg2-server
+### END INIT INFO
-PIDFILE=/var/tmp/bcfg2-server.pid
+DAEMON=/usr/sbin/bcfg2-server
+PIDFILE=/var/run/bcfg2-server.pid
+PARAMS="-D $PIDFILE"
+
+# Exit if $DAEMON doesn't exist and is not executable
+test -x $DAEMON || exit 5
+
+# Include lsb functions
+. /lib/lsb/init-functions
case "$1" in
start)
- echo -n "Starting bcfg2-server: "
- if [ -f "/etc/debian_version" ] ; then
- /sbin/start-stop-daemon --pidfile "${PIDFILE}" --make-pidfile -b -S --startas /usr/sbin/bcfg2-server
- else
- /usr/sbin/bcfg2-server -D "${PIDFILE}"
- fi
- echo "bcfg2-server"
+ log_begin_msg "Starting Configuration Management Server"
+ log_progress_msg "bcfg2-server"
+ start_daemon ${DAEMON} ${PARAMS}
+ log_end_msg $?
;;
stop)
- echo -n "Stopping bcfg2-server: "
- if [ -f "/etc/debian_version" ] ; then
- /sbin/start-stop-daemon -p "${PIDFILE}" -K /usr/sbin/bcfg2-server
- else
- kill -INT `cat ${PIDFILE}`
- fi
- echo done
+ log_begin_msg "Stopping Configuration Management Server"
+ log_progress_msg "bcfg2-server"
+ killproc -p "${PIDFILE}" ${DAEMON}
+ log_end_msg $?
;;
- restart)
+ force-reload|restart)
$0 stop
sleep 5
$0 start
;;
- force-reload)
- $0 stop
- $0 start
- ;;
*)
- echo "Usage: bcfg2-server {start|stop|restart|force-reload}"
+ log_success_msg "Usage: bcfg2-server {start|stop|restart|force-reload}"
exit 1
esac
diff --git a/debian/bcfg2-server.install b/debian/bcfg2-server.install
index 442ecedf5..1c740956b 100644
--- a/debian/bcfg2-server.install
+++ b/debian/bcfg2-server.install
@@ -1,6 +1,6 @@
-debian/bcfg2-install/usr/bin/bcfg2-* usr/sbin
-debian/bcfg2-install/usr/bin/StatReports usr/sbin
-debian/bcfg2-install/usr/bin/GenerateHostInfo usr/sbin
-debian/bcfg2-install/usr/lib/python2.3/site-packages/Bcfg2/Server/* usr/lib/python2.3/site-packages/Bcfg2/Server
-debian/bcfg2-install/usr/share/bcfg2/* usr/share/bcfg2/
-debian/bcfg2-install/usr/share/man/man8/* usr/share/man/man8
+debian/tmp/usr/bin/bcfg2-* usr/sbin
+debian/tmp/usr/bin/StatReports usr/sbin
+debian/tmp/usr/bin/GenerateHostInfo usr/sbin
+debian/tmp/usr/lib/python*/site-packages/Bcfg2/Server/*
+debian/tmp/usr/share/bcfg2/*
+debian/tmp/usr/share/man/man8/*
diff --git a/debian/bcfg2-server.postinst b/debian/bcfg2-server.postinst
new file mode 100644
index 000000000..c7ec80a8a
--- /dev/null
+++ b/debian/bcfg2-server.postinst
@@ -0,0 +1,51 @@
+#!/bin/sh
+# postinst script for bcfg2-server
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# 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>
+# * <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)
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+if [ -x "/etc/init.d/bcfg2-server" ]; then
+ update-rc.d bcfg2-server defaults >/dev/null
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d bcfg2-server start || exit $?
+ else
+ /etc/init.d/bcfg2-server start || exit $?
+ fi
+fi
+
+exit 0
+
+
diff --git a/debian/bcfg2-server.postrm b/debian/bcfg2-server.postrm
new file mode 100644
index 000000000..5a3c220e0
--- /dev/null
+++ b/debian/bcfg2-server.postrm
@@ -0,0 +1,42 @@
+#!/bin/sh
+# postrm script for bcfg2-server
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# 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' <r>overwrit>r> <new-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#
+
+if [ "$1" = "purge" ] ; then
+ update-rc.d bcfg2-server remove >/dev/null || exit $?
+fi
+
+exit 0
diff --git a/debian/bcfg2.default b/debian/bcfg2.default
new file mode 100644
index 000000000..2d5570c7a
--- /dev/null
+++ b/debian/bcfg2.default
@@ -0,0 +1,13 @@
+# Configuration options for bcfg2 client
+
+# BCFG2_OPTIONS:
+# Set the default options for Bcfg2 on startup
+#
+#BCFG2_OPTIONS="-q"
+
+# BCFG_ENABLED:
+# Should Bcfg2 be run automatically by system scripts
+#
+# Uncomment the following line to automatically start bcfg2 on startup
+#
+#BCFG2_ENABLED=1
diff --git a/debian/bcfg2.init b/debian/bcfg2.init
index a184297e8..8da1209d4 100644
--- a/debian/bcfg2.init
+++ b/debian/bcfg2.init
@@ -1,36 +1,68 @@
#!/bin/sh
+# Start bcfg2 client on startup
#
# bcfg2 - bcfg2 configuration client
#
# chkconfig: 2345 19 81
# description: bcfg2 client for configuration requests
-#
+#
+### BEGIN INIT INFO
+# Provides: bcfg2
+# Required-Start: $network $named
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: S 0 1 6
+# Short-Description: Configuration management client
+# Description: Bcfg2 is a configuration management system that builds
+# installs configuration files served by bcfg2-server
+# This is a client that installs the server provided
+# Configuration.
+### END INIT INFO
+
+# This might need some better logic
+BCFG2=/usr/sbin/bcfg2
+
BCFG2_OPTIONS="-q"
+
+# Disabled per default
+BCFG2_ENABLED=0
+
+# Include default startup configuration if exists
test -f "/etc/default/bcfg2" && . /etc/default/bcfg2
+test "$BCFG2_ENABLED" != "0" || exit 0
+
+# Exit if bcfg2 doesn't exist and is not executable
+test -x $BCFG2 || exit 5
+
+# Include lsb functions
+. /lib/lsb/init-functions
+
case "$1" in
start)
+ log_begin_msg "Running configuration management client"
if test -e /etc/donttouchme; then
rm -f /etc/donttouchme
- echo "bcfg2 does not need to run."
+ log_success_msg "bcfg2 does not need to run."
else
- echo -n "Running bcfg: "
+ log_progress_msg "bcfg2"
/usr/sbin/bcfg2 $BCFG2_OPTIONS
- echo "bcfg2"
+ log_end_msg $?
fi
;;
- stop)
- /bin/true
- ;;
restart)
$0 stop
$0 start
;;
- force-reload)
+ status)
+ # Since we are always OK, always return OK as status
+ exit 0
+ ;;
+ stop|force-reload)
true
;;
*)
- echo "Usage: bcfg2 {start|stop|restart}"
+ log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
esac
diff --git a/debian/bcfg2.install b/debian/bcfg2.install
index 9d3aeea55..b66311a3f 100644
--- a/debian/bcfg2.install
+++ b/debian/bcfg2.install
@@ -1,4 +1,6 @@
-debian/bcfg2-install/usr/bin/bcfg2 usr/sbin
-debian/bcfg2-install/usr/lib/python2.3/site-packages/Bcfg2/*.py usr/lib/python2.3/site-packages/Bcfg2/
-debian/bcfg2-install/usr/lib/python2.3/site-packages/Bcfg2/Client/* usr/lib/python2.3/site-packages/Bcfg2/Client/
-debian/bcfg2-install/usr/share/man/man1/* usr/share/man/man1
+debian/tmp/usr/bin/bcfg2 usr/sbin
+debian/tmp/usr/lib/python*/site-packages/Bcfg2/*.py
+debian/tmp/usr/lib/python*/site-packages/Bcfg2/Client/*
+debian/tmp/usr/share/man/man1/*
+examples/bcfg2.conf usr/share/bcfg2
+debian/bcfg2.default usr/share/bcfg2
diff --git a/debian/bcfg2.postinst b/debian/bcfg2.postinst
new file mode 100644
index 000000000..c287c962a
--- /dev/null
+++ b/debian/bcfg2.postinst
@@ -0,0 +1,52 @@
+#!/bin/sh
+# postinst script for bcfg2
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# 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>
+# * <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)
+ ucf /usr/share/bcfg2/bcfg2.conf /etc/bcfg2.conf
+ ucf /usr/share/bcfg2/bcfg2.default /etc/default/bcfg2
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+if [ -x "/etc/init.d/bcfg2" ]; then
+ update-rc.d bcfg2 defaults >/dev/null
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d bcfg2 start || exit $?
+ else
+ /etc/init.d/bcfg2 start || exit $?
+ fi
+fi
+
+exit 0
+
+
diff --git a/debian/bcfg2.postrm b/debian/bcfg2.postrm
new file mode 100644
index 000000000..91f552c52
--- /dev/null
+++ b/debian/bcfg2.postrm
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postrm script for bcfg2
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# 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' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+ purge)
+ for i in /etc/default/bcfg2 /etc/bcfg2.conf; do
+ rm -f $i
+ ucf -p $i
+ done
+ ;;
+ 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#
+
+if [ "$1" = "purge" ] ; then
+ update-rc.d bcfg2 remove >/dev/null || exit $?
+fi
+
+exit 0
diff --git a/debian/changelog b/debian/changelog
index 362802ef7..d7df067af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,16 @@
bcfg2 (0.8.2-0pre10) unstable; urgency=low
+ [ Narayan Desai ]
* new upstream
- -- Narayan Desai <desai@mcs.anl.gov> Fri, 14 Jul 2006 15:54:16 -0500
+ [ Sami Haahtinen ]
+ * Update Debian packaging
+ * Update Init Scripts
+ * Move to Standards-Version 3.7.2 (no changes)
+ * build with cdbs
+ * Use python-central
+
+ -- Sami Haahtinen <ressu@ressukka.net> Sun, 16 Jul 2006 10:53:52 +0300
bcfg2 (0.8.2-0pre9) unstable; urgency=low
diff --git a/debian/control b/debian/control.in
index b0fa87cb7..0c6d1642d 100644
--- a/debian/control
+++ b/debian/control.in
@@ -2,12 +2,14 @@ Source: bcfg2
Section: admin
Priority: optional
Maintainer: Narayan Desai <desai@mcs.anl.gov>
-Build-Depends: debhelper (>= 4.0.0)
-Standards-Version: 3.6.1.1
+Build-Depends: @cdbs@
+Standards-Version: 3.7.2.0
+XS-Python-Version: >= 2.3
Package: bcfg2
Architecture: all
-Depends: ${python:Depends}, debsums, python-apt, python-lxml (>= 0.8)
+Depends: ${python:Depends}, debsums, python-apt, python-lxml (>= 0.8), ucf, lsb-base (>= 3.1-9)
+XB-Python-Version: ${python:Versions}
Description: build configuration system
Bcfg2 is a symbolic configuration management system,
produced at Argonne National Lab.
@@ -15,7 +17,8 @@ Description: build configuration system
Package: bcfg2-server
Architecture: all
-Depends: ${python:Depends}, bcfg2, python-lxml (>= 0.8), python2.3-fam | python2.4-fam | python-fam | python2.3-gamin | python2.4-gamin , python-pyopenssl, libxml2-utils (>= 2.6.23), fam | gamin
+Depends: ${python:Depends}, python-lxml (>= 0.8), python2.3-fam | python2.4-fam | python-fam | python2.3-gamin | python2.4-gamin , python-pyopenssl, libxml2-utils (>= 2.6.23), fam | gamin, lsb-base (>= 3.1-9), ucf, bcfg2 (= ${source:Version})
+XB-Python-Version: ${python:Versions}
Description: build configuration system, version two
Bcfg2 is a symbolic configuration management system,
produced at Argonne National Lab.
diff --git a/debian/pycompat b/debian/pycompat
new file mode 100644
index 000000000..0cfbf0888
--- /dev/null
+++ b/debian/pycompat
@@ -0,0 +1 @@
+2
diff --git a/debian/rules b/debian/rules
index 243d64ab8..aef1bf627 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,78 +1,29 @@
#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
+# -*- mode: makefile; coding: utf-8 -*-
+
+# Generate debian/control fron control.in with the following command:
+# DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
+
+# Comment this line if you wish to build without pycentral or pysupport
+DEB_PYTHON_SYSTEM := pycentral
+DEB_PYTHON_MODULE_PACKAGE := bcfg2
+DEB_DH_INSTALLINIT_ARGS := -n
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+# By default use 2.3 as the python version (follow the original behaviour)
+# This only affects the build system if built without pycentral or pysupport
+DEB_PYTHON_VERSIONS = 2.3
+
+# Since cdbs is able to handle only one python package at once do things here:
+binary-install/bcfg2-server :: binary-install/%:
+# Mostly borrowed from /usr/share/cdbs/1/class/python-distutils.mk
+ifdef _cdbs_rules_debhelper
+ ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
+ dh_pysupport -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS)
+ else
+ dh_pycentral -pbcfg2-server
+ endif
+ dh_python -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS)
endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
- INSTALL_PROGRAM += -s
-endif
-
-build:
- debian/version-hacker.sh
- python setup.py build
-
-clean:
- dh_testdir
- dh_testroot
- dh_clean
- python setup.py clean
- -rm -Rf debian/install debian/tmp debian/bcfg2-server debian/bcfg2
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
- python setup.py install --prefix=$(PWD)/debian/bcfg2-install/usr
- mkdir -p ./debian/bcfg2/etc
- install -g 0 -o 0 -m 600 examples/bcfg2.conf ./debian/bcfg2/etc/bcfg2.conf
-
-# Build architecture-dependent files here.
-# We have nothing to do by default.
-binary-arch: build install
-
-# Build architecture-independent files here.
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
-# dh_installexamples
- dh_install
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
- dh_installinit -pbcfg2 --no-start -u "start 25 2 3 4 5 ."
- dh_installinit -pbcfg2-server -u"start 21 2 3 4 5 . stop 19 0 1 6 ."
-# dh_installcron
-# dh_installinfo
- dh_installman
-# dh_link
- dh_strip
- dh_compress
- dh_fixperms
- chmod 600 debian/bcfg2/etc/bcfg2.conf
-# dh_perl
- dh_python
-# dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install