From a5ac33e90dfdd61062d22ad73f93edd57aedf3ae Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 29 Oct 2009 21:12:39 +0000 Subject: Add new Debian packaging from Sami Haahtinen Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5512 ce84e21b-d406-0410-9b95-82705330c041 --- debian/bcfg2-server.docs | 1 + debian/bcfg2-server.init | 99 ++++++++++++++++++++++ debian/bcfg2-server.preinst | 13 +++ debian/bcfg2.docs | 1 + debian/bcfg2.init | 141 +++++++++++++++++++++++++++++++ debian/bcfg2.preinst | 13 +++ debian/buildsys-select.sh | 64 -------------- debian/buildsys/2.3/bcfg2-server.init | 53 ------------ debian/buildsys/2.3/bcfg2.init | 72 ---------------- debian/buildsys/2.3/compat | 1 - debian/buildsys/2.3/control.in | 29 ------- debian/buildsys/2.4/control.in | 29 ------- debian/buildsys/common/bcfg2-server.init | 99 ---------------------- debian/buildsys/common/bcfg2.init | 141 ------------------------------- debian/buildsys/common/compat | 1 - debian/buildsys/common/pycompat | 1 - debian/buildsys/pycentral/control.in | 32 ------- debian/buildsys/pycentral/pycompat | 1 - debian/changelog | 10 +++ debian/compat | 1 + debian/control | 30 +++++++ debian/pycompat | 1 + debian/rules | 51 ++--------- debian/version-hacker.sh | 26 ------ 24 files changed, 318 insertions(+), 592 deletions(-) create mode 100644 debian/bcfg2-server.docs create mode 100644 debian/bcfg2-server.init create mode 100644 debian/bcfg2-server.preinst create mode 100644 debian/bcfg2.docs create mode 100644 debian/bcfg2.init create mode 100644 debian/bcfg2.preinst delete mode 100755 debian/buildsys-select.sh delete mode 100644 debian/buildsys/2.3/bcfg2-server.init delete mode 100644 debian/buildsys/2.3/bcfg2.init delete mode 100644 debian/buildsys/2.3/compat delete mode 100644 debian/buildsys/2.3/control.in delete mode 100644 debian/buildsys/2.4/control.in delete mode 100644 debian/buildsys/common/bcfg2-server.init delete mode 100644 debian/buildsys/common/bcfg2.init delete mode 100644 debian/buildsys/common/compat delete mode 100644 debian/buildsys/common/pycompat delete mode 100644 debian/buildsys/pycentral/control.in delete mode 100644 debian/buildsys/pycentral/pycompat create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/pycompat delete mode 100755 debian/version-hacker.sh diff --git a/debian/bcfg2-server.docs b/debian/bcfg2-server.docs new file mode 100644 index 000000000..62deb0497 --- /dev/null +++ b/debian/bcfg2-server.docs @@ -0,0 +1 @@ +AUTHORS diff --git a/debian/bcfg2-server.init b/debian/bcfg2-server.init new file mode 100644 index 000000000..d8ed2e908 --- /dev/null +++ b/debian/bcfg2-server.init @@ -0,0 +1,99 @@ +#!/bin/sh +# +# bcfg-server - Bcfg2 configuration daemon +# +# chkconfig: 2345 19 81 +# description: bcfg2 server for configuration requests +# +### BEGIN INIT INFO +# Provides: bcfg2-server +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 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 + +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 + +# Internal variables +BINARY=$(basename $DAEMON) + +start () { + echo -n "Starting Configuration Management Server: " + start_daemon ${DAEMON} ${PARAMS} + STATUS=$? + if [ "$STATUS" = 0 ] + then + log_success_msg "bcfg2-server" + test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-server + else + log_failure_msg "bcfg2-server" + fi + return $STATUS +} + +stop () { + echo -n "Stopping Configuration Management Server: " + killproc -p $PIDFILE ${BINARY} + STATUS=$? + if [ "$STATUS" = 0 ]; then + log_success_msg "bcfg2-server" + test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-server + else + log_failure_msg "bcfg2-server" + fi + return $STATUS +} + +status () { + # Inspired by redhat /etc/init.d/functions status() call + PID=$(pidof -x $BINARY) + if [ -n "$PID" ]; then + echo "$BINARY (pid $PID) is running..." + return 0 + fi + + if [ -f $PIDFILE ]; then + if [ -n "$PID" ]; then + log_failure_msg "$BINARY dead but pid file exists..." + return 1 + fi + fi + + log_failure_msg "$BINARY is not running" + return 3 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart|reload|force-reload) + stop + sleep 5 + start + ;; + *) + log_success_msg "Usage: $0 {start|stop|status|reload|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/bcfg2-server.preinst b/debian/bcfg2-server.preinst new file mode 100644 index 000000000..2eb87e99b --- /dev/null +++ b/debian/bcfg2-server.preinst @@ -0,0 +1,13 @@ +#!/bin/sh +# This file can be removed after a few releases. +set -e +if [ "$1" = upgrade ] +then + if dpkg --compare-versions "$2" lt 1.0pre5-0.3; then + if which pycentral > /dev/null; then + pycentral pkgremove bcfg2-server + fi + fi +fi + +#DEBHELPER# diff --git a/debian/bcfg2.docs b/debian/bcfg2.docs new file mode 100644 index 000000000..62deb0497 --- /dev/null +++ b/debian/bcfg2.docs @@ -0,0 +1 @@ +AUTHORS diff --git a/debian/bcfg2.init b/debian/bcfg2.init new file mode 100644 index 000000000..76adf0ad4 --- /dev/null +++ b/debian/bcfg2.init @@ -0,0 +1,141 @@ +#!/bin/sh +# +# bcfg2 - bcfg2 configuration client +# +# chkconfig: 2345 19 81 +# description: bcfg2 client for configuration requests +# +### BEGIN INIT INFO +# Provides: bcfg2 +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 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 + +# Set default options +# You can set script specific options with BCFG2_OPTIONS_INIT +# You can set agent-mode specific options with BCFG2_OPTIONS_AGENT +BCFG2_OPTIONS="-q" + +# Disabled per default +BCFG2_ENABLED=0 +BCFG2_INIT=0 +BCFG2_AGENT=0 + +# Include default startup configuration if exists +test -f "/etc/default/bcfg2" && . /etc/default/bcfg2 + +[ "$BCFG2_ENABLED" -eq 0 ] && exit 0 +[ "$BCFG2_AGENT" -eq 0 -a "$BCFG2_INIT" -eq 0 ] && exit 0 + +# Exit if bcfg2 doesn't exist and is not executable +test -x $BCFG2 || exit 5 + +# Agent mode daemon capability +PIDFILE=/var/run/bcfg2-agent.pid +# Internal variables +BINARY=$(basename $BCFG2) + +AGENT_EXTRA_OPTS="-A -i ${PIDFILE}" + +# Include lsb functions +. /lib/lsb/init-functions + +start () { + echo -n "Running configuration management client: " + if [ "$BCFG2_AGENT" -eq 1 ] + then + start_daemon ${BCFG2} ${AGENT_EXTRA_OPTS} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_AGENT} + STATUS=$? + fi + + if [ "$BCFG2_INIT" -eq 1 ]; then + ${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT} + STATUS=$? + fi + + if [ "$STATUS" -eq 0 ] + then + log_success_msg "bcfg2" + if [ "$BCFG2_AGENT" -eq 1 ]; then + test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-agent + fi + else + log_failure_msg "bcfg2" + fi + return $STATUS +} + +status () { + if [ "$BCFG2_AGENT" -eq 1 ] + then + PID=$(pidof -x $BINARY) + if [ -n "$PID" ] ; then + log_success_msg "$BINARY (pid $PID) is running..." + return 0 + fi + if [ -f $PIDFILE ]; then + if [ -n "$PID" ]; then + log_failure_msg "$BINARY dead but pid file exists..." + return 1 + fi + fi + else + return 0 + fi +} + +stop () { + if [ "$BCFG2_AGENT" -eq 1 ] + then + echo -n "Stopping configuration management client daemon: " + killproc -p $PIDFILE ${BINARY} + STATUS=$? + if [ "$STATUS" -eq 0 ] + then + log_success_msg "bcfg2" + if [ "$BCFG2_AGENT" -eq 1 ]; then + test -d /var/lock/subsys && rm -f /var/lock/subsys/bcfg2-agent + fi + else + log_failure_msg "bcfg2" + fi + return $STATUS + else + return 0 + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart|reload|force-reload) + if [ "$BCFG2_AGENT" -eq 1 ] + then + stop + sleep 5 + start + fi + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" + exit 1 +esac + +exit 0 diff --git a/debian/bcfg2.preinst b/debian/bcfg2.preinst new file mode 100644 index 000000000..be4b1444a --- /dev/null +++ b/debian/bcfg2.preinst @@ -0,0 +1,13 @@ +#!/bin/sh +# This file can be removed after a few releases. +set -e +if [ "$1" = upgrade ] +then + if dpkg --compare-versions "$2" lt 1.0pre5-0.3; then + if which pycentral > /dev/null; then + pycentral pkgremove bcfg2 + fi + fi +fi + +#DEBHELPER# diff --git a/debian/buildsys-select.sh b/debian/buildsys-select.sh deleted file mode 100755 index 291d669f6..000000000 --- a/debian/buildsys-select.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# -# This script will select the build target, which is one of: -# 2.3 - Build for python2.3 -# 2.4 - Build for python2.4 -# pycentral - Build with python-central support - -FILES="control.in bcfg2.init bcfg2-server.init pycompat compat" -SUITE=$1 - -if [ ! -d buildsys ]; then - echo "you need to be in debian/ directory" - exit 1 -fi - -copy_files() { - for i in $FILES; do - if [ -e buildsys/$SUITE/$i ]; then - cp buildsys/$SUITE/$i $i - else - cp buildsys/common/$i $i - fi - done -} - -toggle_DPS() { - case $1 in - enable) - sed -i -e 's/^#DEB_PYTHON_SYSTEM/DEB_PYTHON_SYSTEM/' rules - ;; - disable) - sed -i -e 's/^DEB_PYTHON_SYSTEM/#DEB_PYTHON_SYSTEM/' rules - ;; - *) - echo "internal error!" - exit 1 - ;; - esac -} - -generate_control() { - cp control.in control - if [ "$SUITE" = "pycentral" ]; then - toggle_DPS enable - else - toggle_DPS disable - fi - cd .. && DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean -} - -case $SUITE in - 2.3|2.4|pycentral) - copy_files - generate_control - ;; - clean) - rm $FILES control - toggle_DPS enable - echo "removed build files, select a build system to enable build" - ;; - *) - echo "Usage: $0 2.3|2.4|pycentral|clean" - ;; -esac diff --git a/debian/buildsys/2.3/bcfg2-server.init b/debian/buildsys/2.3/bcfg2-server.init deleted file mode 100644 index 235087465..000000000 --- a/debian/buildsys/2.3/bcfg2-server.init +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# Bcfg2Server - Bcfg2 configuration daemon -# -# chkconfig: 2345 19 81 -# description: bcfg2 server for configuration requests -# -### BEGIN INIT INFO -# Provides: bcfg2-server -# Required-Start: $network $remote_fs $named -# Required-Stop: $network $remote_fs $named -# Default-Start: 2 3 4 5 -# Default-Stop: 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 - -msg=echo -fail=echo - -case "$1" in - start) - $msg -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 - $msg "bcfg2-server" - ;; - stop) - $msg -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 - ;; - restart|force-reload|reload) - $0 stop - sleep 5 - $0 start - ;; - *) - ${msg} "Usage: $0 {start|stop|status|reload|restart|force-reload}" - exit 1 -esac - -exit 0 diff --git a/debian/buildsys/2.3/bcfg2.init b/debian/buildsys/2.3/bcfg2.init deleted file mode 100644 index 463d6a414..000000000 --- a/debian/buildsys/2.3/bcfg2.init +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# -# bcfg2 - bcfg2 configuration client -# -# chkconfig: 2345 19 81 -# description: bcfg2 client for configuration requests -# -### BEGIN INIT INFO -# Provides: bcfg2 -# Required-Start: $network $remote_fs $named -# Required-Stop: $network $remote_fs $named -# Default-Start: 2 3 4 5 -# Default-Stop: 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 - -# Set default options -# You can set script specific options with BCFG2_OPTIONS_INIT -BCFG2_OPTIONS="-q" - -# Disabled per default -BCFG2_ENABLED=0 -BCFG2_INIT=0 -BCFG2_AGENT=0 - -# Include default startup configuration if exists -test -f "/etc/default/bcfg2" && . /etc/default/bcfg2 - -[ "$BCFG2_ENABLED" -eq 0 ] && exit 0 -[ "$BCFG2_AGENT" -eq 0 -a "$BCFG2_INIT" -eq 0 ] && exit 0 - -# Exit if bcfg2 doesn't exist and is not executable -test -x $BCFG2 || exit 5 - -case "$1" in - start) - echo -n "Running configuration management client: " - - if [ "$BCFG2_AGENT" -eq 1 ] - then - ${BCFG2} -A -i /var/run/bcfg2-agent.pid ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_AGENT} - STATUS=$? - fi - - if [ "$BCFG2_INIT" -eq 1 ] - then - ${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT} - STATUS=$? - fi - - echo "bcfg2" - ;; - status) - # Since we are always OK, always return OK as status - exit 0 - ;; - restart|reload|stop|force-reload) - true - ;; - *) - echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" - exit 1 -esac - -exit 0 diff --git a/debian/buildsys/2.3/compat b/debian/buildsys/2.3/compat deleted file mode 100644 index b8626c4cf..000000000 --- a/debian/buildsys/2.3/compat +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/debian/buildsys/2.3/control.in b/debian/buildsys/2.3/control.in deleted file mode 100644 index 7d6e9eda6..000000000 --- a/debian/buildsys/2.3/control.in +++ /dev/null @@ -1,29 +0,0 @@ -Source: bcfg2 -Section: admin -Priority: optional -Maintainer: Sami Haahtinen -Build-Depends: @cdbs@, python2.3-dev, python -Standards-Version: 3.7.2.0 - -Package: bcfg2 -Architecture: all -Depends: ${python:Depends}, debsums, python-apt, python2.3-lxml (>= 0.8), ucf -Description: Configuration management client - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2 is the client portion of bcfg2 system which installs configuration - images provided by bcfg2-server - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ - -Package: bcfg2-server -Architecture: all -Depends: ${python:Depends}, python2.3-lxml (>= 0.8), python2.3-gamin | python2.3-fam , libxml2-utils (>= 2.6.23), gamin | fam, ucf, bcfg2 (= ${Source-Version}), openssl -Recommends: graphviz, python-profiler -Description: Configuration management server - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2-server is the server for bcfg2 clients, which generates configuration - sets and stores statistics of client system states. - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ diff --git a/debian/buildsys/2.4/control.in b/debian/buildsys/2.4/control.in deleted file mode 100644 index 526fc7d25..000000000 --- a/debian/buildsys/2.4/control.in +++ /dev/null @@ -1,29 +0,0 @@ -Source: bcfg2 -Section: admin -Priority: optional -Maintainer: Sami Haahtinen -Build-Depends: @cdbs@, python2.4-dev -Standards-Version: 3.7.2.0 - -Package: bcfg2 -Architecture: all -Depends: ${python:Depends}, debsums, python2.4-apt, python-lxml (>=0.9) | python2.4-lxml (>= 0.9), ucf, lsb-base (>= 3.1) -Description: Configuration management client - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2 is the client portion of bcfg2 system which installs configuration - images provided by bcfg2-server - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ - -Package: bcfg2-server -Architecture: all -Depends: ${python:Depends}, python-lxml (>=0.9) | python2.4-lxml (>= 0.9), python2.4-gamin | python2.4-fam, python2.4-pyopenssl, libxml2-utils (>= 2.6.23), gamin | fam, lsb-base (>= 3.1), ucf, bcfg2 (= ${Source-Version}), openssl -Recommends: graphviz, python-profiler -Description: Configuration management server - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2-server is the server for bcfg2 clients, which generates configuration - sets and stores statistics of client system states. - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ diff --git a/debian/buildsys/common/bcfg2-server.init b/debian/buildsys/common/bcfg2-server.init deleted file mode 100644 index 1302ec10c..000000000 --- a/debian/buildsys/common/bcfg2-server.init +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh -# -# bcfg-server - Bcfg2 configuration daemon -# -# chkconfig: 2345 19 81 -# description: bcfg2 server for configuration requests -# -### BEGIN INIT INFO -# Provides: bcfg2-server -# Required-Start: $network $remote_fs $named -# Required-Stop: $network $remote_fs $named -# Default-Start: 2 3 4 5 -# Default-Stop: 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 - -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 - -# Internal variables -BINARY=$(basename $DAEMON) - -start () { - echo -n "Starting Configuration Management Server: " - start_daemon ${DAEMON} ${PARAMS} - STATUS=$? - if [ "$STATUS" = 0 ] - then - log_success_msg "bcfg2-server" - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-server - else - log_failure_msg "bcfg2-server" - fi - return $STATUS -} - -stop () { - echo -n "Stopping Configuration Management Server: " - killproc -p $PIDFILE ${BINARY} - STATUS=$? - if [ "$STATUS" = 0 ]; then - log_success_msg "bcfg2-server" - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-server - else - log_failure_msg "bcfg2-server" - fi - return $STATUS -} - -status () { - # Inspired by redhat /etc/init.d/functions status() call - PID=$(pidof -x $BINARY) - if [ -n "$PID" ]; then - echo "$BINARY (pid $PID) is running..." - return 0 - fi - - if [ -f $PIDFILE ]; then - if [ -n "$PID" ]; then - log_failure_msg "$BINARY dead but pid file exists..." - return 1 - fi - fi - - log_failure_msg "$BINARY is not running" - return 3 -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart|reload|force-reload) - stop - sleep 5 - start - ;; - *) - log_success_msg "Usage: $0 {start|stop|status|reload|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/debian/buildsys/common/bcfg2.init b/debian/buildsys/common/bcfg2.init deleted file mode 100644 index a7b65ce05..000000000 --- a/debian/buildsys/common/bcfg2.init +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh -# -# bcfg2 - bcfg2 configuration client -# -# chkconfig: 2345 19 81 -# description: bcfg2 client for configuration requests -# -### BEGIN INIT INFO -# Provides: bcfg2 -# Required-Start: $network $remote_fs $named -# Required-Stop: $network $remote_fs $named -# Default-Start: 2 3 4 5 -# Default-Stop: 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 - -# Set default options -# You can set script specific options with BCFG2_OPTIONS_INIT -# You can set agent-mode specific options with BCFG2_OPTIONS_AGENT -BCFG2_OPTIONS="-q" - -# Disabled per default -BCFG2_ENABLED=0 -BCFG2_INIT=0 -BCFG2_AGENT=0 - -# Include default startup configuration if exists -test -f "/etc/default/bcfg2" && . /etc/default/bcfg2 - -[ "$BCFG2_ENABLED" -eq 0 ] && exit 0 -[ "$BCFG2_AGENT" -eq 0 -a "$BCFG2_INIT" -eq 0 ] && exit 0 - -# Exit if bcfg2 doesn't exist and is not executable -test -x $BCFG2 || exit 5 - -# Agent mode daemon capability -PIDFILE=/var/run/bcfg2-agent.pid -# Internal variables -BINARY=$(basename $BCFG2) - -AGENT_EXTRA_OPTS="-A -i ${PIDFILE}" - -# Include lsb functions -. /lib/lsb/init-functions - -start () { - echo -n "Running configuration management client: " - if [ "$BCFG2_AGENT" -eq 1 ] - then - start_daemon ${BCFG2} ${AGENT_EXTRA_OPTS} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_AGENT} - STATUS=$? - fi - - if [ "$BCFG2_INIT" -eq 1 ]; then - ${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT} - STATUS=$? - fi - - if [ "$STATUS" -eq 0 ] - then - log_success_msg "bcfg2" - if [ "$BCFG2_AGENT" -eq 1 ]; then - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-agent - fi - else - log_failure_msg "bcfg2" - fi - return $STATUS -} - -status () { - if [ "$BCFG2_AGENT" -eq 1 ] - then - PID=$(pidof -x $BINARY) - if [ -n "$PID" ] ; then - log_success_msg "$BINARY (pid $PID) is running..." - return 0 - fi - if [ -f $PIDFILE ]; then - if [ -n "$PID" ]; then - log_failure_msg "$BINARY dead but pid file exists..." - return 1 - fi - fi - else - return 0 - fi -} - -stop () { - if [ "$BCFG2_AGENT" -eq 1 ] - then - echo -n "Stopping configuration management client daemon: " - killproc -p $PIDFILE ${BINARY} - STATUS=$? - if [ "$STATUS" -eq 0 ] - then - log_success_msg "bcfg2" - if [ "$BCFG2_AGENT" -eq 1 ]; then - test -d /var/lock/subsys && rm -f /var/lock/subsys/bcfg2-agent - fi - else - log_failure_msg "bcfg2" - fi - return $STATUS - else - return 0 - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart|reload|force-reload) - if [ "$BCFG2_AGENT" -eq 1 ] - then - stop - sleep 5 - start - fi - ;; - *) - echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" - exit 1 -esac - -exit 0 diff --git a/debian/buildsys/common/compat b/debian/buildsys/common/compat deleted file mode 100644 index 7ed6ff82d..000000000 --- a/debian/buildsys/common/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/buildsys/common/pycompat b/debian/buildsys/common/pycompat deleted file mode 100644 index d00491fd7..000000000 --- a/debian/buildsys/common/pycompat +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/debian/buildsys/pycentral/control.in b/debian/buildsys/pycentral/control.in deleted file mode 100644 index 807b28c36..000000000 --- a/debian/buildsys/pycentral/control.in +++ /dev/null @@ -1,32 +0,0 @@ -Source: bcfg2 -Section: admin -Priority: optional -Maintainer: Sami Haahtinen -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.9), ucf, lsb-base (>= 3.1-9), python (>= 2.6) | python-m2crypto (>= 0.17) | python-ssl -XB-Python-Version: ${python:Versions} -Description: Configuration management client - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2 is the client portion of bcfg2 system which installs configuration - images provided by bcfg2-server - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ - -Package: bcfg2-server -Architecture: all -Depends: ${python:Depends}, python-lxml (>= 0.9), python-fam | python-gamin, libxml2-utils (>= 2.6.23), gamin | fam, lsb-base (>= 3.1-9), ucf, bcfg2 (= ${Source-Version}), openssl -Recommends: python-genshi (>= 0.4.4), graphviz, python-profiler -XB-Python-Version: ${python:Versions} -Description: Configuration management server - Bcfg2 is a configuration management system that generates configuration sets - for clients bound by client profiles. - bcfg2-server is the server for bcfg2 clients, which generates configuration - sets and stores statistics of client system states. - . - Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ diff --git a/debian/buildsys/pycentral/pycompat b/debian/buildsys/pycentral/pycompat deleted file mode 100644 index 0cfbf0888..000000000 --- a/debian/buildsys/pycentral/pycompat +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/debian/changelog b/debian/changelog index dcd49e419..81b94a155 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +bcfg2 (1.0.0rc1-1) unstable; urgency=low + + * Update packaging + * Switch to plain debhelper + * Switch from pycentral to python-support + * Move homepage to the dedicated Homepage field + * Update Standards-Version to 3.8.3.0 + + -- Sami Haahtinen Sat, 24 Oct 2009 00:20:51 +0300 + bcfg2 (1.0.0rc1-0.1) unstable; urgency=low * first release candidate diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..7ed6ff82d --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..691aa1f91 --- /dev/null +++ b/debian/control @@ -0,0 +1,30 @@ +Source: bcfg2 +Section: admin +Priority: optional +Maintainer: Sami Haahtinen +Build-Depends: debhelper (>= 7.0.50~), python-dev (>= 2.3.5-11), python-support +Standards-Version: 3.8.3.0 +XS-Python-Version: >= 2.3 + +Package: bcfg2 +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, debsums, python-apt, python-lxml (>= 0.9), ucf, lsb-base (>= 3.1-9) +XB-Python-Version: ${python:Versions} +Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ +Description: Configuration management client + Bcfg2 is a configuration management system that generates configuration sets + for clients bound by client profiles. + bcfg2 is the client portion of bcfg2 system which installs configuration + images provided by bcfg2-server + +Package: bcfg2-server +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, python-lxml (>= 0.9), python-fam | python-gamin, libxml2-utils (>= 2.6.23), gamin | fam, lsb-base (>= 3.1-9), ucf, bcfg2 (= ${Source-Version}), openssl, python-profiler +Recommends: python-genshi (>= 0.4.4), graphviz +XB-Python-Version: ${python:Versions} +Homepage: http://trac.mcs.anl.gov/projects/bcfg2/ +Description: Configuration management server + Bcfg2 is a configuration management system that generates configuration sets + for clients bound by client profiles. + bcfg2-server is the server for bcfg2 clients, which generates configuration + sets and stores statistics of client system states. 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 3809fee35..f7defaf74 100755 --- a/debian/rules +++ b/debian/rules @@ -1,44 +1,9 @@ #!/usr/bin/make -f -# -*- 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 -ifdef DEB_PYTHON_SYSTEM -DEB_DH_INSTALLINIT_ARGS := -n -else -DEB_DH_INSTALLINIT_ARGS := --no-start -endif -DEB_COMPRESS_EXCLUDE :=*.tif - -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 DEB_PYTHON_SYSTEM - ifeq (pysupport, $(DEB_PYTHON_SYSTEM)) - dh_pysupport -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS) - else - dh_pycentral -pbcfg2-server - endif -endif - dh_python -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS) - -ifdef DEB_PYTHON_SYSTEM -# Invoke dh_installinit after compiling python modules -binary-install/bcfg2 :: - dh_installinit -p$(cdbs_curpkg) -o --no-start - -binary-install/bcfg2-server :: - dh_installinit -p$(cdbs_curpkg) -o -endif - +%: + dh --with python-support $@ + +override_dh_installinit: + # Install bcfg2 initscript without staring it on postinst + dh_installinit -p bcfg2 --no-start + # Install everything else normally + dh_installinit -N bcfg2 diff --git a/debian/version-hacker.sh b/debian/version-hacker.sh deleted file mode 100755 index e400cb37f..000000000 --- a/debian/version-hacker.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -CWD=`pwd` -echo $CWD - -cd debian/ - -#get the default python version for this system. -VERSION=`python -c 'import sys;major,minor = sys.version_info[0:2]; print minor '` - -#hardcoded version is 2.3 - -if [ ${VERSION} -eq 4 ]; then - -#fix all the files that are version specific - - for fd in bcfg2.install bcfg2.postinst.debhelper bcfg2-server.install bcfg2-server.posti\nst.debhelper; - do - sed -e 's/2\.3/2\.4/g' $fd > /tmp/${fd}.tmp - mv /tmp/${fd}.tmp $fd - #rm /tmp/${fd}.tmp - done - -fi - -cd $CWD -- cgit v1.2.3-1-g7c22