summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-02-09 14:14:55 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-02-09 14:14:55 (GMT)
commit08bbd06849f9dd89b3fc880956cbc522ab62a69d (patch)
treecffed74b671ad8a0bfd50f0b7a995ec58b9d8c6f
parentf25dd8e693f6125555cafe238eb27af56e446b92 (diff)
downloadserver-08bbd06849f9dd89b3fc880956cbc522ab62a69d.tar.gz
Added a marker file that allows to indicate that we are in a test environment. It contains a few variables that define basic parameters of the environment. Added a install-server target to the central Makefile. It installs a server from binary packages.
-rw-r--r--.cvsignore1
-rw-r--r--Makefile41
-rw-r--r--make-helper/kolab.mk18
-rw-r--r--test_environment.dist11
4 files changed, 68 insertions, 3 deletions
diff --git a/.cvsignore b/.cvsignore
index fcd21a9..e142ee9 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,3 @@
stage
upstream
+test_environment
diff --git a/Makefile b/Makefile
index 14f46ad..821b79f 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,7 @@ BASE_FILES=install-kolab.sh \
1st.README
CURRENT_SOURCE_RELEASE = http://files.kolab.org/server/release/kolab-server-2.2.3/sources/
-CURRENT_BINARY_RELEASE = http://files.kolab.org/server/release/kolab-server-2.2.3/$(PLATTAG)/
+CURRENT_BINARY_RELEASE = http://files.kolab.org/server/release/kolab-server-2.2.3/$(PLATFORM)/
PHPUNIT=$(HOME)/bin/phpunit
@@ -429,11 +429,49 @@ files: stage/source
####################
####################
+# SETUP START
+####################
+# Sub targets for installing a server from the binary distribution.
+# The whole section is only active if we manually marked the server
+# as being a test machine (by creating the test_environment file).
+
+ifeq "x$(TEST_ENVIRONMENT)" "xYES"
+# Convenience target to install the server
+.PHONY:install-server
+install-server: $(KOLABDIR)
+
+# Downloads the binary packages for installation
+$(BINARY_SOURCE_DIR):
+ mkdir -p $@
+ cd $@ && wget -r -l1 -nd --no-parent $(CURRENT_BINARY_RELEASE)
+
+# Installs the Kolab server from the binary packages
+$(KOLABDIR): $(BINARY_SOURCE_DIR)
+ cd $(BINARY_SOURCE_DIR) && sh install-kolab.sh 2>&1 | tee kolab-install.log
+
+# Convenience target to uninstall the server
+.PHONY:clean-server
+clean-server:
+ @echo "THIS WILL COMPLETELY WIPE YOUR KOLAB SERVER INSTALLATION IN $(KOLABDIR)!!!"
+ @echo "You have 5 seconds to abort..."
+ @sleep 5
+ /kolab/bin/openpkg rpm -e `/kolab/bin/openpkg rpm -qa`
+ rm -rf $(KOLABDIR)
+endif
+
+####################
+# SETUP END
+####################
+
+####################
# UPDATE START
####################
# Sub targets for updating an installed server to the packages
# generated from CVS.
+# The whole section is only active if we manually marked the server
+# as being a test machine (by creating the test_environment file).
+ifeq "x$(TEST_ENVIRONMENT)" "xYES"
.PHONY: update
update: dist stage/update/source
@@ -449,6 +487,7 @@ stage/update/source: stage/release/source
chown -R $(KOLABUSR)\: stage/update/source
cd stage/update/source && sh install-kolab.sh -X
cd stage/update/source && sh install-kolab.sh 2>&1 | tee kolab-update.log
+endif
####################
# UPDATE END
diff --git a/make-helper/kolab.mk b/make-helper/kolab.mk
index a2d00e4..a14fbdc 100644
--- a/make-helper/kolab.mk
+++ b/make-helper/kolab.mk
@@ -1,7 +1,18 @@
+# Check if we are in a test environment
+TEST_ENVIRONMENT=$(shell test -e test_environment && echo YES)
+ifeq "x$(TEST_ENVIRONMENT)" "xYES"
+ BINARY_SOURCE_DIR=$(shell source test_environment && echo $$BINARY_SOURCE_DIR)
+endif
+
# Initial sanity check for the OpenPKG tool
OPENPKG=$(shell which openpkg && echo YES)
ifeq "x$(OPENPKG)" "x"
- $(error Did not find the "openpkg" tool. Make sure your environment settings are sane. On a standard kolab system you might need to run "eval `/kolab/etc/rc --eval all env`")
+ ifeq "x$(TEST_ENVIRONMENT)" "x"
+ $(error Did not find the "openpkg" tool. Make sure your environment settings are sane. On a standard kolab system you might need to run "eval `/kolab/etc/rc --eval all env`")
+ else
+ KOLABDIR=$(shell source test_environment && echo $$KOLABDIR)
+ OPENPKG=$(KOLABDIR)/bin/openpkg
+ endif
endif
# Set KOLABDIR to the base directory of the OpenPKG/Kolab installation if it is unset
@@ -37,7 +48,10 @@ KOLABPKGURI ?= http://files.kolab.org/server/release/kolab-server-2.2.0/sources/
OPENPKGURI ?= http://files.kolab.org/server/development-2.2/openpkg-orig-srpms/
# Determine the suffix for binary packages on this system if it is unset
-PLATTAG ?= $(shell $(RPM) -q --qf="%{ARCH}-%{OS}" openpkg)-$(KOLABDIR:/%=%)
+PLATFORM ?= $(shell $(RPM) -q --qf="%{ARCH}-%{OS}" openpkg)
+
+# Determine the suffix for binary packages on this system if it is unset
+PLATTAG ?= $(PLATFORM)-$(KOLABDIR:/%=%)
# Determine the staging area for collecting new source rpms if it is unset
STAGING ?= ../stage
diff --git a/test_environment.dist b/test_environment.dist
new file mode 100644
index 0000000..878c5bb
--- /dev/null
+++ b/test_environment.dist
@@ -0,0 +1,11 @@
+# This is a development helper that should allow quick installation
+# and update of a Kolab Server from CVS HEAD.
+#
+# Simply copy this file from test_environment.dist to test_environment
+# and adapt the settings to your need.
+
+# The location where the binary packages should be downloaded to.
+BINARY_SOURCE_DIR=/root/kolab-server-2.2.3/ix86-debian5.0
+
+# The location to which the Kolab server should be installed.
+KOLABDIR=/kolab