Makefile.am 20.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

## Target directory for installing Icons
96
ICONSDIR	=	@ICONSDIR@
root's avatar
root committed
97

98
99
100
## Settings used in src/etc/scripts/sympa
PIDPRE		=	pidof -x
PIDPOST		=	
101
LOCKDIR		=	@LOCKDIR@
102

103
104
## Path to newaliases command (or what else may be called to rebuild
## Mail aliases database)
105
NEWALIASES	=	@NEWALIASES@
106

107
108
## Argument to newaliases command
# NEWALIASES_ARG	=	hash:/etc/mail/sympa_aliases
109
NEWALIASES_ARG	=	@NEWALIASES_ARG@
110

111
112
113
114
115
116
117
118
## 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@

119
## The sendmail aliases file we use. Better use a seperate one for sympa.
120
## Of course an extra alias file must be generated with proper permissions
121
122
## (owner sympa, write access for sympa, no write access for anyone else)
## and declared in sendmail.cf!
123
124
125
126
127
128
129
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@
130

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

135
136
SH	=	@SH@
CC	=	@CC@
root's avatar
root committed
137
138
139
CFLAGS	=	-g

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

142
143
144
145
146
147
148
149
150
151
152
# 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
#	ICONSDIR	=	/usr/local/www/icons
#	RPMTOPDIR	=	/usr/local/src/redhat
#	OPENSSL	=	/usr/bin/openssl
#endif

root's avatar
root committed
153
154
155
156
##---------- STOP ---------- STOP ---------- STOP ---------- STOP ----------

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

159
160
main_SRC	=	AUTHORS COPYING ChangeLog INSTALL KNOWNBUGS NEWS README

root's avatar
root committed
161
162
163
#ifeq ($(shell uname), Linux)
#	LOG_SOCKET_TYPE="inet"
#else
164
LOG_SOCKET_TYPE	=	unix
root's avatar
root committed
165
166
#endif

167
all:	warning checkperl checkcpan sources man locale
root's avatar
root committed
168
169
170

rpm: build_rh_rpm build_mdk_rpm

171
172
173
174
175
176
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."; \
177
178
179
180
	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."; \
181
	echo "#############################################################"; \
182
	if [ "$(DESTDIR)" = "" ]; then read rep; fi
183

root's avatar
root committed
184
185
186
checkperl:
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
187
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
188
189
190
191
192
193
	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 "#############################################################################"; \
194
	if [ "$(DESTDIR)" = "" ]; then read rep; fi \
root's avatar
root committed
195
	fi
196
197
198
	@if [ ! -f $(SUIDPERL) ]; then \
		echo "##################################"; \
		echo "## You don't have suidperl installed."; \
199
200
201
		echo "## Suidperl is the default way to run WWSympa with SetUID."; \
		echo "## Among other options, you can use suExec with Apache"; \
		echo "## Check Sympa reference manual for more details"; \
202
		echo "#####################################################"; \
203
		if [ "$(DESTDIR)" = "" ]; then read rep; fi \
204
	fi
sympa-authors's avatar
sympa-authors committed
205
206
207
208
209
	@if [ ! -f $(MSGFMT) ]; then \
		echo "##################################"; \
		echo "## You don't have msgfmt installed. It is required to build message catalogues"; \
		echo "## msgfmt is provided with a 'gettest' package on most systems..."; \
		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
documentation: doc/sympa.tex.tpl doc/Makefile 
	@echo "Making documentation"
	@(cd doc && echo "making in doc/..." && \
231
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' CGIDIR='${CGIDIR}' \
232
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
233
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' PIDDIR='${PIDDIR}' \
234
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' EXPL_DIR='${EXPL_DIR}' LOCALEDIR='${LOCALEDIR}' SPOOLDIR='${SPOOLDIR}' \
235
	SCRIPTDIR='${SCRIPTDIR}' \
root's avatar
root committed
236
237
	USER='${USER}' GROUP='${GROUP}');

238
239
man: doc/man8/Makefile
	@echo "Making man"
240
	@(cd doc/man8 && echo "making in doc/man8/..." && \
241
242
	$(MAKE) SYMPA_VERSION='$(SYMPA_VERSION)');

root's avatar
root committed
243
244
245
246
247
248
checkcpan: 
	@echo "Checking needed CPAN modules ..."
	$(PERL) ./check_perl_modules.pl

clean:
	find . \( -name ".#*" -o -name "*~" -o -name ".*~" -o -name "#*#" \) -exec  rm -f {} \;
249
	@for i in src wwsympa src/etc/sample;\
root's avatar
root committed
250
251
252
253
254
	do \
	(cd $$i && echo "making clean in $$i..." && \
	$(MAKE) PERL='${PERL}' clean) || exit 1; \
	done;

255
install: importantchanges installsrc installwws installwebtt2 installmailtt2 installlocale installman installscript installsample installdir installconfig installdoc installsoap
256
257

importantchanges:
258
	( 	PERL=$(PERL); export PERL; \
259
		UMASK=0600; export UMASK; \
260
		DESTDIR=$(DESTDIR); export DESTDIR; \
261
262
263
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
264
265
266
		ETCDIR=$(ETCDIR); export ETCDIR;\
		USER=$(USER); export USER;\
		GROUP=$(GROUP); export GROUP;\
267
268
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
269
	) ;
270

salaun's avatar
salaun committed
271
272
273
locale:
	@(cd po && echo "making in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
274
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
275
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
276
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
277
278
279
280
281
	USER='${USER}' GROUP='${GROUP}') || exit 1;

installlocale:
	@(cd po && echo "making install in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
282
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
283
284
285
286
287
288
	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}' \
289
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
290
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
291
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
292
	USER='${USER}' GROUP='${GROUP}' update-po) || exit 1;
root's avatar
root committed
293
294

installsrc:
295
	@(cd src && echo "making in src..." && \
root's avatar
root committed
296
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
297
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
298
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' EXPL_DIR='${EXPL_DIR}' LIBEXECDIR='${LIBEXECDIR}' \
299
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' LOCALEDIR='${LOCALEDIR}' SCRIPTDIR='${SCRIPTDIR}' \
300
	ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
301
302
303
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}'  HOST='${HOST}' COOKIE='${COOKIE}' \
	SPOOLDIR='${SPOOLDIR}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
	SSLCERTDIR='${SSLCERTDIR}' \
salaun's avatar
salaun committed
304
	PODIR='${prefix}/po' \
root's avatar
root committed
305
306
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

307
308
309
310
311
312
313
314
315
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
316
installwws:
317
	@(cd wwsympa && echo "making in wwsympa..." && \
root's avatar
root committed
318
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
319
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
320
	USER='${USER}' GROUP='${GROUP}' \
321
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;

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}' \
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;

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}' \
340
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
341
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;
root's avatar
root committed
342

salaun's avatar
salaun committed
343
344
345
346
installsoap:
	@(cd soap && echo "making in soap/..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
347
	USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
348
349
350
351
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;

root's avatar
root committed
352
installsample:
353
	@(cd src/etc/sample && echo "making in src/etc/sample..." && \
root's avatar
root committed
354
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
355
356
	DESTDIR='${DESTDIR}' DIR='${DIR}' SAMPLEDIR='${SAMPLEDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
357
	EXPL_DIR='${EXPL_DIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
358
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
359
360
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
361

salaun's avatar
salaun committed
362

salaun's avatar
salaun committed
363
installman:
364
365
	@(cd doc/man8 && \
	$(MAKE) PERL='${PERL}' DIR='${DIR}' DESTDIR='${DESTDIR}' SYMPA_VERSION='${SYMPA_VERSION}' MANDIR='${MANDIR}' \
366
	USER='${USER}' GROUP='${GROUP}' \
367
368
369
	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
370

root's avatar
root committed
371
installscript:
372
	@(cd src/etc/script && echo "making in src/etc/script..." && \
root's avatar
root committed
373
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
374
375
376
	DIR='${DIR}' DESTDIR='${DESTDIR}' SCRIPTDIR='${SCRIPTDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
377
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
aumont's avatar
aumont committed
378
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' \
379
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
380
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
381
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
root's avatar
root committed
382
383
384


installdir:
385
386
	@echo "Creating required directories"
	@for dir in $(DIR) $(EXPL_DIR) $(CONFDIR) $(SAMPLEDIR) ; do \
387
388
389
390
391
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			mkdir -p $(DESTDIR)$$dir; \
			chown $(USER) $(DESTDIR)$$dir; \
			chgrp $(GROUP) $(DESTDIR)$$dir; \
392
			chmod 755 $(DESTDIR)$$dir; \
root's avatar
root committed
393
		fi \
394
	done
root's avatar
root committed
395
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
396
	echo "First installation : installing conf directories..."; \
397
	for dir in create_list_templates mail_tt2 web_tt2 scenari \
398
399
400
401
402
403
	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
404
405
406
407
		fi \
	done \
	fi
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
408
	echo "First installation : installing spool directories..."; \
root's avatar
root committed
409
	for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
410
411
	$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
	$(SPOOLDIR)/task ; do \
root's avatar
root committed
412
413
414
415
416
417
418
419
420
421
422
423
		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

installconfig:
	mkdir -p $(DESTDIR)$(CONFDIR)
salaun's avatar
salaun committed
424
	@INITCONF='0'
salaun's avatar
no echo    
salaun committed
425
	@for cfile in sympa.conf wwsympa.conf ; do \
root's avatar
root committed
426
427
	if [ ! -f $(DESTDIR)$(CONFDIR)/$$cfile ] ; then \
	echo "Installing sample config file $$cfile..."; \
428
	DESTDIR=$(DESTDIR); export DESTDIR; \
429
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl -c $$cfile; \
root's avatar
root committed
430
431
	chown $(USER) $(DESTDIR)$(CONFDIR)/$$cfile; \
	chgrp $(GROUP) $(DESTDIR)$(CONFDIR)/$$cfile; \
432
	if [ "$(DESTDIR)" = "" ]; then \
salaun's avatar
salaun committed
433
	INITCONF='1'; \
root's avatar
root committed
434
	fi \
435
	fi \
salaun's avatar
salaun committed
436
437
438
	done; \
	if [ "$$INITCONF" ] ; then \
	echo "###############################################"; \
salaun's avatar
salaun committed
439
440
	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 :"; \
441
	DESTDIR=$(DESTDIR); export DESTDIR; \
442
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl; \
443
	fi
root's avatar
root committed
444
445
446
447
448
449
450
451
452
453
454

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; \
455
		MTA='smtpdaemon'; export MTA; \
456
		HOMEDIR='/var/sympa'; export HOMEDIR; \
457
		ICONSDIR='/var/www/icons/sympa'; export ICONSDIR; \
458
		PIDDIR='/var/run/sympa'; export PIDDIR; \
root's avatar
root committed
459
		VERSION=$(SYMPA_VERSION); export VERSION; \
460
461
462
463
464
465
466
467
468
469
470
                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; \
471
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
472
473
474
475
		SCRIPTDIR='/var/sympa/bin'; export SCRIPTDIR; \
		LIBEXECDIR='/var/sympa/bin'; export LIBEXECDIR; \
		SAMPLEDIR='/usr/share/sympa/examples'; export SAMPLEDIR; \
                ETCDIR='/etc/sympa'; export ETCDIR; \
476
		$(PERL) ../../../subst.pl sympa.spec.rh80 \
root's avatar
root committed
477
	)
478
	mv $(RPMTOPDIR)/SPECS/sympa.spec.rh80 $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
479
480
481
482
483
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		gzip $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
484
	rpmbuild  -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
485
486
487
488
489
490
491
492
493
494
495

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; \
496
		MTA='MailTransportAgent'; export MTA; \
root's avatar
root committed
497
498
		HOMEDIR='/var/lib/sympa'; export HOMEDIR; \
		VERSION=$(SYMPA_VERSION); export VERSION; \
499
500
501
502
503
504
505
506
507
508
509
510
511
                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; \
		ICONSDIR='/var/www/icons/sympa'; export ICONSDIR; \
                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; \
512
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
513
514
515
516
		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
517
518
519
520
521
522
523
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		bzip2 $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
524
	rpmbuild -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
525

salaun's avatar
salaun committed
526
527
tag:	ChangeLog
	@if [ ! $(NEW_VERSION) ]; then \
salaun's avatar
salaun committed
528
	echo "Current version is $(VERSION)"; \
salaun's avatar
salaun committed
529
	echo "You need to define NEW_VERSION"; \
salaun's avatar
salaun committed
530
	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
531
	fi