Makefile.am 22.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Makefile.am - Top-level Makefile.am for Sympa
# RCS Identication ; $Revision$ ; $Date$ 
#
# Sympa - SYsteme de Multi-Postage Automatique
# Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
# Copyright (c) 1997,1998, 1999 Institut Pasteur & Christophe Wolfhugel
#
# This program 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 program 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 program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

22
23
24
25
26
#SUBDIRS = src doc wwsympa nls

ChangeLog:
	@CVS2CL@

root's avatar
root committed
27
## User Id and Group for Sympa (your httpd should have the same uid.gid)
28
29
USER	=	@USER@
GROUP	=	@GROUP@
root's avatar
root committed
30
31

## configuration file
32
CONFDIR	=	@CONFDIR@
root's avatar
root committed
33
34

##  Perl path
35
PERL	=	@PERL@
root's avatar
root committed
36
37
38
39
40
41

## For preparing samples
HOST		=	`$(PERL) -MSys::Hostname -e "printf '%s', Sys::Hostname::hostname();"`
COOKIE		=	`$(PERL) -e " print int(rand ( time ))  "`
PERL_VERSION	=	`$(PERL) -e ' print $$]'`

42
SYMPA_VERSION	=	@VERSION@
root's avatar
root committed
43
44
45
46
47
48

## Root directory for Sympa ; use absolute path.
## Binaries are located under $DIR/bin ; this directory needs to be
## readable for everyone ; `queue' needs to be executable 
## You can also set DESTDIR to the place where everything should be
## installed (usefull for packagers of Sympa)
49
50
DIR	=	${prefix}

51
EXPL_DIR	=	@EXPLDIR@
root's avatar
root committed
52
53

## PID location
salaun's avatar
salaun committed
54
PIDDIR	=	@PIDDIR@
root's avatar
root committed
55
56
57
58

## Both queue and bouncequeue are lunched by sendmail. If sendmail
## is configured to used smrsh (check the mailer prog definition), thoses
## files needs to be installed in /etc/smrsh.  
59
MAILERPROGDIR	=	@BINDIR@
root's avatar
root committed
60

61
62
RPMTOPDIR	=	`rpm --eval %_topdir`
#RPMTOPDIR	=	/usr/src/redhat
root's avatar
root committed
63

64
MANDIR		=	@MANDIR@
salaun's avatar
salaun committed
65

root's avatar
root committed
66
## SYSV init scripts directory
salaun's avatar
salaun committed
67
INITDIR		=	@INITDIR@
root's avatar
root committed
68

69
BINDIR		=	@BINDIR@
70

71
SBINDIR		=	@SBINDIR@
72

73
CGIDIR		=	@CGIDIR@
74

75
LIBDIR		=	@LIBDIR@
root's avatar
root committed
76

77
LOCALEDIR	=	@LOCALEDIR@
78
79
80
81
82
83
84
85
86

DOCDIR		=	@DOCDIR@

ETCDIR		=	@ETCDIR@

SCRIPTDIR	=	@SCRIPTDIR@

SAMPLEDIR	=	@SAMPLEDIR@

root's avatar
root committed
87
## Spools directory
88
SPOOLDIR	=	@SPOOLDIR@
root's avatar
root committed
89
90
91
92

## Directory for installing WWSympa
WWSBINDIR	=	$(BINDIR)

93
## Web interface colors are now defined in sympa.conf
root's avatar
root committed
94

95
96
97
## Settings used in src/etc/scripts/sympa
PIDPRE		=	pidof -x
PIDPOST		=	
98
LOCKDIR		=	@LOCKDIR@
99

100
101
## Path to newaliases command (or what else may be called to rebuild
## Mail aliases database)
102
NEWALIASES	=	@NEWALIASES@
103

104
105
## Argument to newaliases command
# NEWALIASES_ARG	=	hash:/etc/mail/sympa_aliases
106
NEWALIASES_ARG	=	@NEWALIASES_ARG@
107

108
109
110
111
112
113
114
115
## Path to postmap command (or what else may be called to rebuild
## Mail virtual database)
POSTMAP		=	@POSTMAP@

## Argument to postmap command
# POSTMAP_ARG	=	hash:/etc/mail/sympa_virtual
POSTMAP_ARG	=	@POSTMAP_ARG@

116
## The sendmail aliases file we use. Better use a seperate one for sympa.
117
## Of course an extra alias file must be generated with proper permissions
118
119
## (owner sympa, write access for sympa, no write access for anyone else)
## and declared in sendmail.cf!
120
121
122
123
124
125
126
SENDMAIL_ALIASES=	@SENDMAIL_ALIASES@

## The postfix virtual file we use. Better use a seperate one for sympa.
## Of course an extra alias file must be generated with proper permissions
## (owner sympa, write access for sympa, no write access for anyone else)
## and declared in main.cf!
VIRTUAL_ALIASES=	@VIRTUAL_ALIASES@
127

root's avatar
root committed
128
## Path to OpenSSL
129
OPENSSL	=	@OPENSSL@
salaun's avatar
salaun committed
130
SSLCERTDIR =	$(EXPL_DIR)/X509-user-certs
root's avatar
root committed
131

132
CC	=	@CC@
root's avatar
root committed
133
134
135
CFLAGS	=	-g

# Aix4.2 (and some others unix), use gnu make !
136
#MAKE	=	@MAKE@
root's avatar
root committed
137

138
139
140
141
142
143
144
145
146
147
# FreeBSD hier(7) structure and locations
# by Autrijus Tang 2001/10/11
#ifeq ($(shell uname), FreeBSD)
#	PIDPRE	= 	ps -ax | grep
#	PIDPOST	= 	| grep perl | head -n 1 | cut -f 2 -d " "
#	LOCKDIR	= 	/var/spool/lock
#	RPMTOPDIR	=	/usr/local/src/redhat
#	OPENSSL	=	/usr/bin/openssl
#endif

root's avatar
root committed
148
149
150
151
##---------- STOP ---------- STOP ---------- STOP ---------- STOP ----------

CONFIG		=	$(CONFDIR)/sympa.conf
WWSCONFIG	=	$(CONFDIR)/wwsympa.conf
152
ETCBINDIR	=	@DATADIR@
root's avatar
root committed
153

154
155
main_SRC	=	AUTHORS COPYING ChangeLog INSTALL KNOWNBUGS NEWS README

root's avatar
root committed
156
157
158
#ifeq ($(shell uname), Linux)
#	LOG_SOCKET_TYPE="inet"
#else
159
LOG_SOCKET_TYPE	=	unix
root's avatar
root committed
160
161
#endif

162
all:	warning checkperl checkcpan sources wrapper soap_wrapper man locale
root's avatar
root committed
163
164
165

rpm: build_rh_rpm build_mdk_rpm

166
167
168
169
170
171
warning:
	@echo "######################## W A R N I N G ######################"; \
	echo "## If it is the first time you install Sympa on this server :"; \
	echo "##        It may take a while...."; \
	echo "## The reason is that Sympa requires many Perl modules that"; \
	echo "## are not distributed with the standard Perl distribution."; \
172
173
174
175
	echo "## We'll try to install these modules automatically..."; \
	echo "## If some modules cannot be installed automatically, (probably" ; \
	echo "## because of the 'make test'), try downloading them from the"; \
	echo "## CPAN website (http://search.cpan.org) and install them manually."; \
176
	echo "#############################################################"; \
177
	echo -n "Please hit <Enter> to proceed"; \
178
	if [ "$(DESTDIR)" = "" ]; then read rep; fi
179

root's avatar
root committed
180
181
182
checkperl:
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
183
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
184
185
186
187
188
189
	echo "## You need to patch your syslog.pm "; \
	echo "## See http://bugs.perl.org/perlbug.cgi?req=bidmids&bidmids=20000712.003"; \
	echo "##"; \
	echo "## If your Perl version is 5.6.0 AND if your system is Solaris :"; \
	echo "## See also http://bugs.perl.org/perlbug.cgi?req=bidmids&bidmids=20000522.003"; \
	echo "#############################################################################"; \
190
	if [ "$(DESTDIR)" = "" ]; then read rep; fi \
root's avatar
root committed
191
	fi
192
	@if [ ! -f $(SUIDPERL) ]; then \
sympa-authors's avatar
sympa-authors committed
193
194
195
		echo "#################################################################################"; \
		echo "## wwsympa.fcgi that provides Sympa's web interface needs to run as user $(USER)"; \
		echo "## There are many options to do so : "; \
196
		echo "##  1/ Use the C wrapper provided with Sympa. this is the default behaviour."\
sympa-authors's avatar
sympa-authors committed
197
198
		echo "##  2/ Use 'sudo' to run wwsympa.fcgi as user $(USER). Your Apache configuration should use wwsympa_sudo_wrapper.pl"; \
		echo "##     You should edit your /etc/sudoers file (with visudo command) as follows :"; \
sympa-authors's avatar
sympa-authors committed
199
		echo "##     apache ALL = ($(USER))  NOPASSWD: $(CGIDIR)/wwsympa.fcgi"; \
sympa-authors's avatar
sympa-authors committed
200
201
202
		echo "##  3/ Use Apache's suExec mode."; \
		echo "#######################################################################################"; \
		echo -n "Please hit <Enter> to continue"; \
203
		if [ "$(DESTDIR)" = "" ]; then read rep; fi \
204
	fi
sympa-authors's avatar
sympa-authors committed
205
206
207
	@if [ ! -f $(MSGFMT) ]; then \
		echo "##################################"; \
		echo "## You don't have msgfmt installed. It is required to build message catalogues"; \
olivier.salaun's avatar
olivier.salaun committed
208
		echo "## msgfmt is provided with a 'gettext' package on most systems..."; \
sympa-authors's avatar
sympa-authors committed
209
		echo "#####################################################"; \
210
		if [ "$(DESTDIR)" = "" ]; then read rep; fi \
sympa-authors's avatar
sympa-authors committed
211
212
	fi

213

214
sources: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
root's avatar
root committed
215
	@echo "Making src"
216
	@(cd src && echo "making in src..." && \
root's avatar
root committed
217
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
218
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
219
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' \
root's avatar
root committed
220
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
221
	USER='${USER}' GROUP='${GROUP}' \
222
223
224
225
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' \
	NEWALIASES='${NEWALIASES}' NEWALIASES_ARG='${NEWALIASES_ARG}' \
	POSTMAP='${POSTMAP}' POSTMAP_ARG='${POSTMAP_ARG}' \
226
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}');
root's avatar
root committed
227

228
229
230
231
232
wrapper: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
	@echo "Making wwsympa"
	@(cd wwsympa && echo "making in wwsympa..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' WWSYMPA='${CGIDIR}/wwsympa.fcgi');

233
234
235
236
237
soap_wrapper: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
	@echo "Making sympa_soap"
	@(cd soap && echo "making in soap..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' SYMPASOAP='${CGIDIR}/sympa_soap_server.fcgi');

238
239
240
documentation: doc/sympa.tex.tpl doc/Makefile 
	@echo "Making documentation"
	@(cd doc && echo "making in doc/..." && \
241
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' CGIDIR='${CGIDIR}' \
242
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
243
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' PIDDIR='${PIDDIR}' \
244
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' EXPL_DIR='${EXPL_DIR}' LOCALEDIR='${LOCALEDIR}' SPOOLDIR='${SPOOLDIR}' \
245
	SCRIPTDIR='${SCRIPTDIR}' \
root's avatar
root committed
246
247
	USER='${USER}' GROUP='${GROUP}');

248
249
man: doc/man8/Makefile
	@echo "Making man"
250
	@(cd doc/man8 && echo "making in doc/man8/..." && \
251
252
	$(MAKE) SYMPA_VERSION='$(SYMPA_VERSION)');

root's avatar
root committed
253
254
255
256
257
258
checkcpan: 
	@echo "Checking needed CPAN modules ..."
	$(PERL) ./check_perl_modules.pl

clean:
	find . \( -name ".#*" -o -name "*~" -o -name ".*~" -o -name "#*#" \) -exec  rm -f {} \;
259
	@for i in src wwsympa src/etc/sample;\
root's avatar
root committed
260
261
262
263
264
	do \
	(cd $$i && echo "making clean in $$i..." && \
	$(MAKE) PERL='${PERL}' clean) || exit 1; \
	done;

olivier.salaun's avatar
olivier.salaun committed
265
266
267
install: importantchanges installdir installsrc installwws installwebtt2 installmailtt2 installlocale installman installscript installsample installconfig installdoc installsoap nextstep

nextstep: 
268
269
270
	@echo ""
	@echo "** You can find documentation at:"
	@echo "** http://www.sympa.org/documentation/manual/sympa-$(SYMPA_VERSION).pdf"
olivier.salaun's avatar
olivier.salaun committed
271
272
273
274
	@echo ""
	@echo "#########################################################"
	@echo "# If you install Sympa for the first time on this server"
	@echo "# you should check the INSTALL file."
275
276
	@echo "#"
	@echo "# If you are upgrading, you now need to run"
olivier.salaun's avatar
olivier.salaun committed
277
	@echo "#    $(SBINDIR)/sympa.pl --upgrade"
olivier.salaun's avatar
olivier.salaun committed
278
	@echo "#######################################################"
279
280

importantchanges:
olivier.salaun's avatar
olivier.salaun committed
281
	@( 	PERL=$(PERL); export PERL; \
282
		UMASK=0600; export UMASK; \
283
		DESTDIR=$(DESTDIR); export DESTDIR; \
284
285
286
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
287
288
289
		ETCDIR=$(ETCDIR); export ETCDIR;\
		USER=$(USER); export USER;\
		GROUP=$(GROUP); export GROUP;\
290
291
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
292
	) ;
293

salaun's avatar
salaun committed
294
295
296
locale:
	@(cd po && echo "making in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
297
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
298
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
299
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
300
301
302
303
304
	USER='${USER}' GROUP='${GROUP}') || exit 1;

installlocale:
	@(cd po && echo "making install in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
305
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
306
307
308
309
310
311
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
	USER='${USER}' GROUP='${GROUP}' install) || exit 1;

updatelocale:
	@(cd po && echo "make update-po in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
312
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
313
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
314
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
315
	USER='${USER}' GROUP='${GROUP}' update-po) || exit 1;
root's avatar
root committed
316
317

installsrc:
318
	@(cd src && echo "making in src..." && \
root's avatar
root committed
319
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
320
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
321
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' EXPL_DIR='${EXPL_DIR}' LIBEXECDIR='${LIBEXECDIR}' \
322
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' LOCALEDIR='${LOCALEDIR}' SCRIPTDIR='${SCRIPTDIR}' \
323
	ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
324
325
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}'  HOST='${HOST}' COOKIE='${COOKIE}' \
	SPOOLDIR='${SPOOLDIR}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
326
	SSLCERTDIR='${SSLCERTDIR}' OPENSSL='${OPENSSL}' \
salaun's avatar
salaun committed
327
	PODIR='${prefix}/po' \
root's avatar
root committed
328
329
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

330
331
332
333
334
335
336
337
338
installdoc:
	@(cd doc && echo "make install in doc..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' DOCDIR='${DOCDIR}' ETCBINDIR='${ETCBINDIR}' \
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' \
	USER='${USER}' GROUP='${GROUP}' install) || exit 1;

root's avatar
root committed
339
installwws:
340
	@(cd wwsympa && echo "making in wwsympa..." && \
root's avatar
root committed
341
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
342
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
343
	USER='${USER}' GROUP='${GROUP}' SUDO='${SUDO}' \
344
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
345
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
346
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
347
348
349
350
351
352
353
354

installwebtt2:
	@(cd web_tt2 && echo "making in web_tt2..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	USER='${USER}' GROUP='${GROUP}' \
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
355
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
356
357
358
359
360
361
362

installmailtt2:
	@(cd mail_tt2 && echo "making in mail_tt2..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	USER='${USER}' GROUP='${GROUP}' \
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
363
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
364
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
root's avatar
root committed
365

salaun's avatar
salaun committed
366
367
368
369
installsoap:
	@(cd soap && echo "making in soap/..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
370
	USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
371
372
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
373
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
salaun's avatar
salaun committed
374

root's avatar
root committed
375
installsample:
376
	@(cd src/etc/sample && echo "making in src/etc/sample..." && \
root's avatar
root committed
377
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
378
379
	DESTDIR='${DESTDIR}' DIR='${DIR}' SAMPLEDIR='${SAMPLEDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
380
	EXPL_DIR='${EXPL_DIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
381
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
382
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
383
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
384

salaun's avatar
salaun committed
385

salaun's avatar
salaun committed
386
installman:
387
388
	@(cd doc/man8 && \
	$(MAKE) PERL='${PERL}' DIR='${DIR}' DESTDIR='${DESTDIR}' SYMPA_VERSION='${SYMPA_VERSION}' MANDIR='${MANDIR}' \
389
	USER='${USER}' GROUP='${GROUP}' \
390
391
392
	CONFDIR='${CONFDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' UMASK='${UMASK}'  \
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' SPOOLDIR='${SPOOLDIR}' PIDDIR='${PIDDIR}' ETCBINDIR='${ETCBINDIR}' \
	newinstall) || exit 1;
salaun's avatar
salaun committed
393

root's avatar
root committed
394
installscript:
395
	@(cd src/etc/script && echo "making in src/etc/script..." && \
root's avatar
root committed
396
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
397
398
399
	DIR='${DIR}' DESTDIR='${DESTDIR}' SCRIPTDIR='${SCRIPTDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
400
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
aumont's avatar
aumont committed
401
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' \
402
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
403
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
404
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' install) || exit 1;
root's avatar
root committed
405
406
407


installdir:
408
	@echo "Creating required directories"
409
	@for dir in $(DIR) $(EXPL_DIR) $(CONFDIR) $(SAMPLEDIR) $(ETCDIR) $(BINDIR) $(LOCALEDIR) $(DOCDIR) $(DIR)/static_content $(DIR)/static_content/icons ; do \
410
411
412
413
414
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			mkdir -p $(DESTDIR)$$dir; \
			chown $(USER) $(DESTDIR)$$dir; \
			chgrp $(GROUP) $(DESTDIR)$$dir; \
415
			chmod 755 $(DESTDIR)$$dir; \
root's avatar
root committed
416
		fi \
417
	done
root's avatar
root committed
418
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
419
	echo "First installation : installing conf directories..."; \
420
	for dir in create_list_templates mail_tt2 web_tt2 scenari \
421
422
423
424
425
426
	task_models general_task_models; do \
		if [ ! -d $(DESTDIR)$(ETCDIR)/$$dir ] ; then \
			echo "Creating $(DESTDIR)$(ETCDIR)/$$dir"; \
			mkdir -p $(DESTDIR)$(ETCDIR)/$$dir; \
			chown $(USER) $(DESTDIR)$(ETCDIR)/$$dir; \
			chgrp $(GROUP) $(DESTDIR)$(ETCDIR)/$$dir; \
root's avatar
root committed
427
		fi \
olivier.salaun's avatar
olivier.salaun committed
428
429
430
431
432
433
434
435
436
437
438
439
	done; \
	( \
		PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
		INSTALLDIR=$(ETCDIR); export INSTALLDIR; \
		USER=$(USER); export USER;\
		GROUP=$(GROUP); export GROUP;\
		INSTALLNAME='README'; export INSTALLNAME; \
                ETCDIR=$(ETCDIR); export ETCDIR; \
                ETCBINDIR=$(ETCBINDIR); export ETCBINDIR; \
		$(PERL) ./subst.pl src/etc/README_etc \
	) \
root's avatar
root committed
440
441
	fi
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
442
	echo "First installation : installing spool directories..."; \
root's avatar
root committed
443
	for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
444
445
	$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
	$(SPOOLDIR)/task ; do \
root's avatar
root committed
446
447
448
449
450
451
452
453
454
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			mkdir -p $(DESTDIR)$$dir; \
			chown $(USER) $(DESTDIR)$$dir; \
			chgrp $(GROUP) $(DESTDIR)$$dir; \
			chmod 770 $(DESTDIR)$$dir; \
		fi \
	done \
	fi
olivier.salaun's avatar
olivier.salaun committed
455
456
457
458
459
460
461
462
463
464
465
466
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
	echo "First installation : creating archives and bounce directories..."; \
	for dir in bounce arc ; do \
		if [ ! -d $(DESTDIR)$(DIR)/$$dir ] ; then \
			echo "Creating $(DESTDIR)$(DIR)/$$dir"; \
			mkdir -p $(DESTDIR)$(DIR)/$$dir; \
			chown $(USER) $(DESTDIR)$(DIR)/$$dir; \
			chgrp $(GROUP) $(DESTDIR)$(DIR)/$$dir; \
		fi \
	done \
	fi

root's avatar
root committed
467
468
469

installconfig:
	mkdir -p $(DESTDIR)$(CONFDIR)
salaun's avatar
salaun committed
470
	@INITCONF='0'
salaun's avatar
no echo    
salaun committed
471
	@for cfile in sympa.conf wwsympa.conf ; do \
root's avatar
root committed
472
473
	if [ ! -f $(DESTDIR)$(CONFDIR)/$$cfile ] ; then \
	echo "Installing sample config file $$cfile..."; \
474
	DESTDIR=$(DESTDIR); export DESTDIR; \
475
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl -c $$cfile; \
root's avatar
root committed
476
477
	chown $(USER) $(DESTDIR)$(CONFDIR)/$$cfile; \
	chgrp $(GROUP) $(DESTDIR)$(CONFDIR)/$$cfile; \
478
	if [ "$(DESTDIR)" = "" ]; then \
salaun's avatar
salaun committed
479
	INITCONF='1'; \
root's avatar
root committed
480
	fi \
481
	fi \
salaun's avatar
salaun committed
482
483
484
	done; \
	if [ "$$INITCONF" ] ; then \
	echo "###############################################"; \
salaun's avatar
salaun committed
485
486
	echo "It seems to be your first installation of Sympa"; \
	echo "The following wizard will help you create your $(CONFDIR)/sympa.conf and $(CONFDIR)/wwsympa.conf :"; \
487
	DESTDIR=$(DESTDIR); export DESTDIR; \
488
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl; \
489
	fi
root's avatar
root committed
490
491
492
493
494
495
496
497
498
499
500

build_rh_rpm: clean
	@echo "Building RedHat RPM in $(RPMTOPDIR) ..."
	@( \
		cd src/etc/script/ ; \
		PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
		INSTALLDIR=$(RPMTOPDIR)/SPECS; export INSTALLDIR; \
		SUFFIX=''; export SUFFIX; \
		ZIPEXT='gz'; export ZIPEXT; \
		APPGROUP='System Environment/Daemons'; export APPGROUP; \
501
		MTA='smtpdaemon'; export MTA; \
502
		HOMEDIR='/var/sympa'; export HOMEDIR; \
503
		PIDDIR='/var/run/sympa'; export PIDDIR; \
root's avatar
root committed
504
		VERSION=$(SYMPA_VERSION); export VERSION; \
505
506
507
508
509
510
511
512
513
514
515
                CONFDIR='/etc'; export CONFDIR; \
                SENDMAIL_ALIASES='/etc/mail/sympa_aliases'; export SENDMAIL_ALIASES; \
                MAILERPROGDIR='/etc/smrsh'; export MAILERPROGDIR; \
		INITDIR='/etc/rc.d/init.d';  export INITDIR; \
                SPOOLDIR='/var/sympa/spool'; export SPOOLDIR; \
                BINDIR='/etc/smrsh'; export BINDIR; \
                SBINDIR='/var/sympa/sbin'; export SBINDIR; \
                DATADIR='/usr/share/sympa'; export DATADIR; \
                EXPLDIR='/var/sympa/expl'; export EXPLDIR; \
                LIBDIR='/usr/lib/sympa/bin'; export LIBDIR; \
                CGIDIR='/var/www/cgi-bin'; export CGIDIR; \
516
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
517
518
519
520
		SCRIPTDIR='/var/sympa/bin'; export SCRIPTDIR; \
		LIBEXECDIR='/var/sympa/bin'; export LIBEXECDIR; \
		SAMPLEDIR='/usr/share/sympa/examples'; export SAMPLEDIR; \
                ETCDIR='/etc/sympa'; export ETCDIR; \
521
		$(PERL) ../../../subst.pl sympa.spec.rh80 \
root's avatar
root committed
522
	)
523
	mv $(RPMTOPDIR)/SPECS/sympa.spec.rh80 $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
524
525
526
527
528
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		gzip $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
529
	rpmbuild  -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
530
531
532
533
534
535
536
537
538
539
540

build_mdk_rpm: clean
	@echo "Building Mandrake RPM in $(RPMTOPDIR) ..."
	@( \
		cd src/etc/script/ ; \
		PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
		INSTALLDIR=$(RPMTOPDIR)/SPECS; export INSTALLDIR; \
		SUFFIX='mdk'; export SUFFIX; \
		ZIPEXT='bz2'; export ZIPEXT; \
		APPGROUP='System/Servers'; export APPGROUP; \
541
		MTA='MailTransportAgent'; export MTA; \
root's avatar
root committed
542
543
		HOMEDIR='/var/lib/sympa'; export HOMEDIR; \
		VERSION=$(SYMPA_VERSION); export VERSION; \
544
545
546
547
548
549
550
551
552
553
554
555
                CONFDIR='/etc/sympa'; export CONFDIR; \
                SENDMAIL_ALIASES='/etc/mail/sympa_aliases'; export SENDMAIL_ALIASES; \
                MAILERPROGDIR='/usr/lib/sympa/bin'; export MAILERPROGDIR; \
                PIDDIR='/var/run/sympa'; export PIDDIR; \
		INITDIR='/etc/rc.d/init.d';  export INITDIR; \
                SPOOLDIR='/var/spool/sympa'; export SPOOLDIR; \
                BINDIR='/usr/lib/sympa/bin'; export BINDIR; \
                SBINDIR='/usr/lib/sympa/bin'; export SBINDIR; \
                DATADIR='/usr/share/sympa'; export DATADIR; \
                EXPLDIR='/var/lib/sympa/expl'; export EXPLDIR; \
                LIBDIR='/usr/lib/sympa/bin'; export LIBDIR; \
                CGIDIR='/var/www/cgi-bin'; export CGIDIR; \
556
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
557
558
559
560
		SCRIPTDIR='/usr/lib/sympa/bin'; export SCRIPTDIR; \
		LIBEXECDIR='/usr/lib/sympa/bin'; export LIBEXECDIR; \
		SAMPLEDIR='/usr/share/sympa/examples'; export SAMPLEDIR; \
                ETCDIR='/etc/sympa'; export ETCDIR; \
root's avatar
root committed
561
562
563
564
565
566
567
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		bzip2 $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
568
	rpmbuild -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
569

salaun's avatar
salaun committed
570
571
tag:	ChangeLog
	@if [ ! $(NEW_VERSION) ]; then \
salaun's avatar
salaun committed
572
	echo "Current version is $(VERSION)"; \
salaun's avatar
salaun committed
573
	echo "You need to define NEW_VERSION"; \
salaun's avatar
salaun committed
574
	else echo $(NEW_VERSION) > .version; cvs ci -m 'preparing $(NEW_VERSION)' .version ChangeLog; cvs tag -F `echo sympa-$(NEW_VERSION)|sed 's/\./_/g'`; \
salaun's avatar
salaun committed
575
	fi