summaryrefslogtreecommitdiffstats
path: root/debian/buildsys-select.sh
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-08-01 02:02:08 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-08-01 02:02:08 +0000
commit8b6e761baac8bb93e631da2e405d3f1e49b01916 (patch)
treec7f668729f80d3fc3d7cbb92465db81f49bbbad5 /debian/buildsys-select.sh
parenta5733c06ab8b7491aaf9dcc6e15d7d14016d8806 (diff)
downloadbcfg2-8b6e761baac8bb93e631da2e405d3f1e49b01916.tar.gz
bcfg2-8b6e761baac8bb93e631da2e405d3f1e49b01916.tar.bz2
bcfg2-8b6e761baac8bb93e631da2e405d3f1e49b01916.zip
Packaging changes from ressu
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2019 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'debian/buildsys-select.sh')
-rwxr-xr-xdebian/buildsys-select.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/debian/buildsys-select.sh b/debian/buildsys-select.sh
new file mode 100755
index 000000000..291d669f6
--- /dev/null
+++ b/debian/buildsys-select.sh
@@ -0,0 +1,64 @@
+#!/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