summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8ea053deddfa7fbdd31f96dd94da5185f20e7e20 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
ifeq "x$(HOME)" "x"
  HOME = /kolab
endif

# Don't know if this is correct but if somebody
# calls this makefile as root we assume that there
# is an installation in /kolab
ifeq "x$(HOME)" "x/root"
  HOME = /kolab
endif

BASE_PACKAGES=php-smarty              \
              openldap                \
              apache-php              \
              php                     \
              postfix                 \
              imapd                   \
              clamav                  \
              gmp                     \
              sqlite                  \
              perl-ldap

PERL_PACKAGES=perl-kolab

PERL_MAKEFILES=$(PERL_PACKAGES:%=%/Makefile)

KOLAB_PACKAGES=perl-kolab              \
               kolabd                  \
               kolab-webadmin          \
               kolab-webclient         \
               kolab-fbview            \

PEAR_PACKAGES= pear/PEAR-Auth_SASL      \
               pear/PEAR-Date           \
               pear/PEAR-HTTP_Request   \
               pear/PEAR-Log            \
               pear/PEAR-Mail           \
               pear/PEAR-Mail-mimeDecode\
               pear/PEAR-Net_LMTP       \
               pear/PEAR-Net_SMTP       \
               pear/PEAR-Net_Socket     \
               pear/PEAR-Net_URL        \
               pear/PEAR-Horde-Channel  \
               pear/PEAR-PHPUnit-Channel\
               pear/Horde_Argv          \
               pear/Horde_Auth          \
               pear/Horde_Browser       \
               pear/Horde_CLI           \
               pear/Horde_Cache         \
               pear/Horde_Cipher        \
               pear/Horde_DOM           \
               pear/Horde_DataTree      \
               pear/Horde_Date          \
               pear/Horde_Framework     \
               pear/Horde_Group         \
               pear/Horde_History       \
               pear/Horde_LDAP          \
               pear/Horde_MIME          \
               pear/Horde_NLS           \
               pear/Horde_Notification  \
               pear/Horde_Perms         \
               pear/Horde_Prefs         \
               pear/Horde_Secret        \
               pear/Horde_Serialize     \
               pear/Horde_SessionObjects \
               pear/Horde_Util          \
               pear/Horde_iCalendar     \
               pear/PHPUnit             \
               php-kolab/Kolab_Format   \
               php-kolab/Kolab_Server   \
               php-kolab/Kolab_Storage  \
               php-kolab/Kolab_Freebusy \
               php-kolab/Kolab_Filter   \

BASE_FILES=install-kolab.sh \
           README.1st

# These are the packages that already provide a "make install"
# procedure that will allow to update packages from CVS.
UPDATES=imapd                   \
        apache-php              \
        php                     \
        kolabd                  \
        pear/Horde_Notification \
        pear/Horde_Prefs        \
        php-kolab/Kolab_Filter  \
        php-kolab/Kolab_Server  \
        php-kolab/Kolab_Storage \
        kolab-webclient

PHPUNIT=$(HOME)/bin/phpunit

PHPUNIT_TESTS=$(HOME)/lib/php/test/Kolab_Format/Horde/Kolab/Format/AllTests.php \
              $(HOME)/lib/php/test/Kolab_Server/Horde/Kolab/Server/AllTests.php \
              $(HOME)/lib/php/test/Kolab_Storage/Horde/Kolab/Storage/AllTests.php \
              $(HOME)/lib/php/test/Kolab_Filter/Horde/Kolab/Filter/AllTests.php \
              $(HOME)/lib/php/test/Kolab_FreeBusy/Horde/Kolab/FreeBusy/AllTests.php

.PHONY: dist
dist: stage base kolab pear files

stage:
	mkdir stage

.PHONY: base
base: stage
	for PKG in $(BASE_PACKAGES);        \
	do                                  \
	  make -e -C $$PKG dist || exit $$?;\
	done

.PHONY: kolab
kolab: stage $(PERL_MAKEFILES)
	for PKG in $(KOLAB_PACKAGES);              \
	do                                         \
	  cd $$PKG && make dist || exit $$?; cd ..;\
	done

$(PERL_MAKEFILES): $(@:%=%.PL)
	cd $(@:%/Makefile=%) && perl Makefile.PL

.PHONY: pear
pear: stage
	for PKG in $(PEAR_PACKAGES);                   \
	do                                              \
	  make -C $$PKG dist || exit $$?;               \
	done

.PHONY: files
files: stage
	cp $(BASE_FILES) stage/
	echo 'Remember to update 00INDEX.rdf and install-kolab.sh!'

.PHONY: clean
clean: clean-base clean-kolab clean-pear clean-stage
	find . | grep "~$$" | xargs rm -rf

.PHONY: clean-stage
clean-stage:
	rm -rf stage

.PHONY: clean-base
clean-base:
	for PKG in $(BASE_PACKAGES);                    \
	do                                              \
	  make -C $$PKG clean || exit $$?;              \
	done

.PHONY: clean-kolab
clean-kolab: $(PERL_MAKEFILES)
	for PKG in $(KOLAB_PACKAGES);                   \
	do                                              \
	  make -C $$PKG clean_all || exit $$?;          \
	done

.PHONY: clean-pear
clean-pear:
	for PKG in $(PEAR_PACKAGES);                   \
	do                                              \
	  make -C $$PKG clean || exit $$?;              \
	done

.PHONY: update
update:
	for UPDATE in $(UPDATES);               \
	do                                      \
	  make -C $$UPDATE install || exit $$?; \
	done

.PHONY: test
test:
	for TEST in $(PHPUNIT_TESTS); \
	do                            \
		$(PHPUNIT) $$TEST;    \
	done