summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile46
-rwxr-xr-xautocluster48
-rw-r--r--autocluster.spec.in48
-rw-r--r--debian/changelog.in6
-rw-r--r--debian/compat1
-rw-r--r--debian/control13
-rw-r--r--debian/copyright39
-rw-r--r--debian/dirs1
-rw-r--r--debian/docs1
-rwxr-xr-xdebian/rules31
-rw-r--r--releases/SoFS-1.52
-rw-r--r--releases/SoFS-1.5.12
-rw-r--r--releases/SoFS-daily2
14 files changed, 235 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 4d9cda3..e1823d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,7 @@ config
*~
install.ttyS0
mnt
+debian/changelog
+autocluster.spec
+autocluster.hack
+autocluster-*.tar.gz
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5b27907
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+version = 0.1.$$(date '+%Y%m%d')
+
+prefix = /usr/local
+datadir = ${prefix}/share/autocluster
+bindir = ${prefix}/bin
+DESTDIR =
+
+datas = base config.default config.sample host_setup imacros releases \
+ templates
+scripts = vircmd waitfor autocluster
+hacks = autocluster.hack
+docs = README examples
+genpkg = debian/changelog autocluster.spec
+
+all: $(hacks)
+
+autocluster.hack: autocluster
+ sed -e '/##BEGIN-INSTALLDIR-MAGIC##/i \
+installdir=$(datadir)' -e '/##BEGIN-INSTALLDIR-MAGIC##/,/##END-INSTALLDIR-MAGIC##/d' $< > $@
+
+install: all
+ mkdir -p $(DESTDIR)$(datadir)
+ cp -a $(datas) $(DESTDIR)$(datadir)/
+ mkdir -p $(DESTDIR)$(bindir)
+ install -m 755 vircmd waitfor $(DESTDIR)$(bindir)
+ install -m 755 autocluster.hack $(DESTDIR)$(bindir)/autocluster
+
+debian/changelog: debian/changelog.in
+ sed -e "s/@@DATE@@/$$(date '+%a, %e %b %Y %T %z')/" -e "s/@@VERSION@@/$(version)/" $< > $@ || rm -f $@
+
+autocluster.spec: autocluster.spec.in
+ sed -e "s/@@VERSION@@/$(version)/" $< > $@ || rm -f $@
+
+dist: $(genpkg)
+ here=$$PWD && \
+ foo=$$(mktemp -d) && \
+ t=autocluster-$(version) && \
+ mkdir -p $${foo}/$${t} && \
+ cp -a Makefile $(datas) $(scripts) $(docs) $(genpkg) $${foo}/$${t} && \
+ cd $${foo} && \
+ tar cz --exclude="*~" -f $${here}/$${t}.tar.gz $${t} && \
+ cd $${here} && \
+ rm -r $${foo}
+
+clean:
+ rm -f $(hacks) $(genpkg)
diff --git a/autocluster b/autocluster
index 04070d2..046d383 100755
--- a/autocluster
+++ b/autocluster
@@ -17,12 +17,16 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
+##BEGIN-INSTALLDIR-MAGIC##
+# There are better ways of doing this but not if you still want to be
+# able to run straight out of a git tree. :-)
if [ -f "$0" ]; then
installdir="`dirname \"$0\"`"
else
autocluster=`which $0`
installdir="`dirname \"$autocluster\"`"
fi
+##END-INSTALLDIR-MAGIC##
####################
# show program usage
@@ -31,9 +35,19 @@ usage ()
cat <<EOF
Usage: autocluster [OPTION] ... <COMMAND>
options:
- -c <file> specify config file (default is "config")
- -x enable script debugging
- --dump dump config settings and exit
+ -c <file> specify config file (default is "config")
+EOF
+
+ local releases=$(echo $(cd $installdir/releases && ls))
+ releases="\"${releases// /\", \"}\""
+
+ usage_smart_display \
+ defconf "WITH_RELEASE" "" \
+ "<string>" "specify kickstart and yum templates using a release version string. Possible values are: ${releases}."
+
+cat <<EOF
+ -x enable script debugging
+ --dump dump config settings and exit
configuration options:
EOF
@@ -668,7 +682,7 @@ usage_display_text() {
}
# Display usage information for long config options.
-usage_config_options(){( # sub-shell for local declaration of defconf()
+usage_smart_display () {( # sub-shell for local declaration of defconf()
local def_fillcol=78
local fillcol=$def_fillcol
local rows=$(stty size | sed -e 's@.* @@')
@@ -686,10 +700,16 @@ usage_config_options(){( # sub-shell for local declaration of defconf()
usage_display_text $startcol $fillcol "$4" "$2"
}
- . "$installdir/config.default"
+
+ "$@"
)}
+# Display usage information for long config options.
+usage_config_options(){
+ usage_smart_display . "$installdir/config.default"
+}
+
######################################################################
. "$installdir/config.default"
@@ -697,7 +717,7 @@ usage_config_options(){( # sub-shell for local declaration of defconf()
############################
# parse command line options
long_opts=$(getopt_config_options)
-getopt_output=$(getopt -n autocluster -o "c:xh" -l help,dump -l "$long_opts" -- "$@")
+getopt_output=$(getopt -n autocluster -o "c:xh" -l help,dump,with-release -l "$long_opts" -- "$@")
[ $? != 0 ] && usage
use_default_config=true
@@ -709,6 +729,7 @@ while true ; do
case "$1" in
-c) shift 2 ; use_default_config=false ;;
--) shift ; break ;;
+ --with-release) shift 2 ;; # Don't set use_default_config=false!!!
--dump|-x) shift ;;
-h|--help) usage ;; # Usage should be shown here for real defaults.
--*) shift 2 ;; # Assume other long opts are valid and take an arg.
@@ -723,7 +744,18 @@ eval set -- "$getopt_output"
while true ; do
case "$1" in
- -c) . "`dirname $2`/$2" ; shift 2 ; conf_done=true ;;
+ -c) . "`dirname $2`/$2" ; shift 2 ;;
+ --with-release)
+ # This simply loads an extra config file from $installdir/releases
+ f="${installdir}/releases/$2"
+ if [ -r "$f" ] ; then
+ . "$f"
+ else
+ echo "Unknown release \"$2\" specified to --with-release"
+ exit 1
+ fi
+ shift 2
+ ;;
-x) set -x; shift ;;
--dump) dump_config ;;
--) shift ; break ;;
@@ -808,5 +840,3 @@ case $command in
usage;
;;
esac
-
-
diff --git a/autocluster.spec.in b/autocluster.spec.in
new file mode 100644
index 0000000..b1f4242
--- /dev/null
+++ b/autocluster.spec.in
@@ -0,0 +1,48 @@
+Summary: Automated environment for building virtual clusters
+Packager: Martin Schwenke <martin@meltin.net>
+Name: autocluster
+Version: @@VERSION@@
+Release: 1
+Epoch: 0
+License: GNU GPL version 3
+Group: System Environment/Daemons
+URL: git://git.samba.org/tridge/autocluster.git
+
+Source: autocluster-%{version}.tar.gz
+
+#Prereq: fileutils sed expect kvm libvirt
+
+Provides: autocluster = %{version}
+
+Prefix: /usr
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%description
+KVM and libvirt-based virtual cluster generation environment for
+testing clustered software.
+
+######################################################################
+
+%prep
+%setup -q
+
+%build
+make prefix=%{_prefix}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+######################################################################
+
+%files
+%defattr(-,root,root)
+
+%doc README examples/example.sh
+%{_prefix}/share/autocluster
+%{_bindir}/autocluster
+%{_bindir}/vircmd
+%{_bindir}/waitfor
diff --git a/debian/changelog.in b/debian/changelog.in
new file mode 100644
index 0000000..0ef1cf9
--- /dev/null
+++ b/debian/changelog.in
@@ -0,0 +1,6 @@
+autocluster (@@VERSION@@-1) unstable; urgency=low
+
+ * Release based on a tarball from git.
+
+ -- Martin Schwenke <martin@meltin.net> @@DATE@@
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..f1aa87b
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,13 @@
+Source: autocluster
+Section: unknown
+Priority: extra
+Maintainer: Martin Schwenke <martin@meltin.net>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: autocluster
+Architecture: all
+Depends: libvirt-bin (>= 0.4.4), kvm (>= 72), expect
+Description: Automated environment for building virtual clusters
+ KVM and libvirt-based virtual cluster generation environment for
+ testing clustered software.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ccac207
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,39 @@
+This package was debianized by Martin Schwenke <martin@meltin.net> on
+Mon, 13 Oct 2008 14:33:00 +1100.
+
+It was downloaded from <git://git.samba.org/tridge/autocluster.git>
+
+Upstream Author(s):
+
+ Andrew Tridgell <tridge@samba.org>
+ Martin Schwenke <martin@meltin.net>
+
+Copyright:
+
+ Copyright (C) 2008 Andrew Tridgell and Martin Schwenke
+
+License:
+
+ This package is free software; you can 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 of the License, or
+ (at your option) any later version.
+
+ This package 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
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2008, Martin Schwenke <martin@meltin.net> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..1200fb3
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+usr/share/autocluster
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..81db93e
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+clean:
+ dh_testdir
+ dh_testroot
+ dh_clean
+
+build:
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ make install prefix=/usr DESTDIR=$(CURDIR)/debian/tmp
+
+binary: install
+ dh_testdir
+ dh_testroot
+ dh_install --autodest debian/tmp/*
+ dh_installdocs
+ dh_installexamples examples/example.sh
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+.PHONY: binary install
diff --git a/releases/SoFS-1.5 b/releases/SoFS-1.5
new file mode 100644
index 0000000..a722766
--- /dev/null
+++ b/releases/SoFS-1.5
@@ -0,0 +1,2 @@
+KICKSTART="$installdir/templates/kickstart-1.5.cfg"
+YUM_TEMPLATE="$installdir/templates/SoFS-1.5.repo"
diff --git a/releases/SoFS-1.5.1 b/releases/SoFS-1.5.1
new file mode 100644
index 0000000..3a06da8
--- /dev/null
+++ b/releases/SoFS-1.5.1
@@ -0,0 +1,2 @@
+KICKSTART="$installdir/templates/kickstart-1.5.1.cfg"
+YUM_TEMPLATE="$installdir/templates/SoFS-1.5.1.repo"
diff --git a/releases/SoFS-daily b/releases/SoFS-daily
new file mode 100644
index 0000000..a5f2037
--- /dev/null
+++ b/releases/SoFS-daily
@@ -0,0 +1,2 @@
+KICKSTART="$installdir/templates/kickstart-1.5.1.cfg"
+YUM_TEMPLATE="$installdir/templates/SoFS-daily.repo"