summaryrefslogtreecommitdiff
path: root/update.mk
blob: 50a3eb3771d2977d17e4e3ef654d7efd35dae982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Declare the packages that were updated between versions here. Each
# package must provide a "make install" procedure that will allow to
# update packages from CVS. Currently

# These are the packages that were updated from Kolab Server version
# 2.2.2 to 2.2.3.
UPDATES_2.2.3_2.2.4=openssl                 \
                    http://files.kolab.org/incoming/wrobel/x509-0-20090125.src.rpm@ \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/apr-1.2.12-20080101.src.rpm@with_ldap \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/imap-2006k-20080101.src.rpm@with_annotate \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/curl-7.17.1-20080101.src.rpm@ \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/perl-crypto-5.10.0-20080101.src.rpm@ \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/perl-ssl-5.10.0-20080101.src.rpm@ \
                    http://files.kolab.org/server/release/kolab-server-2.2.3/sources/sasl-2.1.22-20080101.src.rpm@with_login,with_ldap,with_ntlm \
                    apache                  \
                    apache-php              \
                    php                     \
                    openldap                \
                    imapd                   \
                    postfix                 \
                    kolabd                  \
                    clamav                  \

# These are the packages that were updated from Kolab Server version
# 2.2.2 to 2.2.3.
UPDATES_2.2.2_2.2.3=clamav                  \
                    db                      \
                    imapd                   \
                    kolabd                  \
                    pear/PEAR-Net_LDAP2     \
                    php-kolab/Kolab_Filter  \
                    php-kolab/Kolab_Server  \
                    kolab-webadmin          \
                    kolab-webclient         \
# Hm, we can't update these automatically...
#                    openpkg                 \
#                    perl-kolab

# Set the new version we are aiming at after each release.
CVS_VERSION=2.2.4
# Determines the current version
CURRENT_VERSION=$(shell $(KOLABDIR)/bin/openpkg rpm -q kolabd | sed -e 's/kolabd-\([0-9.]*\)-[0-9]*/\1/')

KOLAB_SERVER_CVS=KOLAB_SERVER-$(CVS_VERSION)
KOLAB_SERVER_CURRENT=KOLAB_SERVER-$(CURRENT_VERSION)


.PHONY: update
update: current

.PHONY:current
current: $(KOLAB_SERVER_CVS)

.PHONY:$(KOLAB_SERVER_CVS)
$(KOLAB_SERVER_CVS): KOLAB_SERVER-2.2.3
	@mkdir -p update
	@for UPDATE in $(UPDATES_2.2.3_2.2.4);                       \
	do                                                           \
	  if [ "x`echo $$UPDATE | grep http://`" == "x" ]; then      \
	    make -C $$UPDATE install || exit $$?;                    \
	  else                                                       \
	    TARGET=`echo $${UPDATE} | sed -e 's#.*/\([^/]*\).src.rpm@.*#\1.$(PLATTAG).rpm#'`; \
	    PACKAGE=`echo $${UPDATE} | sed -e 's#\([^@]*\)@.*#\1#'`; \
	    if [ ! -e update/$$TARGET ]; then                        \
	      OPTIONS=`echo $${UPDATE} | sed -e 's#.*@\([^@]*\)#\1#' | sed -e "s#\([^,]*\),\?#--define '\1 yes' #g"`; \
	      LOCAL=`echo $${UPDATE} | sed -e 's#.*/\([^/]*\).src.rpm@.*#\1.src.rpm#'`; \
	      cd update; wget -c $$PACKAGE; echo "openpkg rpm --rebuild $$OPTIONS $$LOCAL" | sh;\
	      cp /kolab/RPM/PKG/$$TARGET .;                          \
	      /kolab/bin/openpkg rpm -Uhv --force $$TARGET;          \
	      cd ..;                                                 \
	    fi;                                                      \
	  fi;                                                        \
	done
	@for UPDATE in kolab-webadmin perl-kolab;                    \
	do                                                           \
	  echo "Please update $$UPDATE manually using 'make dist' and 'openpkg rpm'"; \
	done

ifeq "x$(KOLAB_SERVER_CURRENT)" "xKOLAB_SERVER-2.2.3"
.PHONY:KOLAB_SERVER-2.2.3
KOLAB_SERVER-2.2.3:
	@echo "You are using Kolab Server 2.2.3. Updating from there..."
else
.PHONY:KOLAB_SERVER-2.2.3
KOLAB_SERVER-2.2.3: KOLAB_SERVER-2.2.2
	@echo "You are using Kolab Server 2.2.3. Updating from there..."
	for UPDATE in $(UPDATES_2.2.2_2.2.3);   \
	do                                      \
	  make -C $$UPDATE install || exit $$?; \
	done
endif

ifeq "x$(KOLAB_SERVER_CURRENT)" "xKOLAB_SERVER-2.2.2"
.PHONY:KOLAB_SERVER-2.2.2
KOLAB_SERVER-2.2.2:
	@echo "You are using Kolab Server 2.2.2. Updating from there..."
else
.PHONY:KOLAB_SERVER-2.2.2
KOLAB_SERVER-2.2.2:
	@echo "You are using Kolab Server $(CURRENT_VERSION)."
	@echo "The update operation is not supported for server versions below 2.2.2"
	@exit 1
endif