Makefile.am 18.5 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
78
79
80
81
82
83
84
85
86
NLSDIR		=	@NLSDIR@

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
101
102
## Settings used in src/etc/scripts/sympa
PIDPRE		=	pidof -x
PIDPOST		=	
LOCKDIR		=	/var/lock/subsys

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:	checkcpan sources checkperl checkmhonarc man
root's avatar
root committed
168
169
170
171
172
173

rpm: build_rh_rpm build_mdk_rpm

checkperl:
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
174
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
175
176
177
178
179
180
181
	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 "#############################################################################"; \
	fi
182
183
184
185
186
187
188
189
190
191
192
193
194
195
	@if [ ! -f $(SUIDPERL) ]; then \
		echo "##################################"; \
		echo "## You don't have suidperl installed."; \
		echo "## Suidperl is required to run WWSympa with SetUID."; \
		echo "#####################################################"; \
	fi

checkmhonarc:
	@if [ ! -f $(MHONARC) ]; then \
		echo "##################################"; \
		echo "## You don't have mhonarc installed."; \
		echo "## Mhonarc is required to manage web archives."; \
		echo "#####################################################"; \
	fi
root's avatar
root committed
196

197
sources: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
root's avatar
root committed
198
	@echo "Making src"
199
	@(cd src && echo "making in src..." && \
root's avatar
root committed
200
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
201
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
202
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' \
root's avatar
root committed
203
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
204
	USER='${USER}' GROUP='${GROUP}' \
205
206
207
208
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' \
	NEWALIASES='${NEWALIASES}' NEWALIASES_ARG='${NEWALIASES_ARG}' \
	POSTMAP='${POSTMAP}' POSTMAP_ARG='${POSTMAP_ARG}' \
209
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}');
root's avatar
root committed
210

211
212
213
documentation: doc/sympa.tex.tpl doc/Makefile 
	@echo "Making documentation"
	@(cd doc && echo "making in doc/..." && \
root's avatar
root committed
214
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
215
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
216
217
218
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' PIDDIR='${PIDDIR}' \
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' EXPL_DIR='${EXPL_DIR}' NLSDIR='${NLSDIR}' SPOOLDIR='${SPOOLDIR}' \
	SCRIPTDIR='${SCRIPTDIR}' \
root's avatar
root committed
219
220
	USER='${USER}' GROUP='${GROUP}');

221
222
man: doc/man8/Makefile
	@echo "Making man"
223
	@(cd doc/man8 && echo "making in doc/man8/..." && \
224
225
	$(MAKE) SYMPA_VERSION='$(SYMPA_VERSION)');

root's avatar
root committed
226
227
228
229
230
231
checkcpan: 
	@echo "Checking needed CPAN modules ..."
	$(PERL) ./check_perl_modules.pl

clean:
	find . \( -name ".#*" -o -name "*~" -o -name ".*~" -o -name "#*#" \) -exec  rm -f {} \;
232
	@for i in src wwsympa src/etc/sample;\
root's avatar
root committed
233
234
235
236
237
	do \
	(cd $$i && echo "making clean in $$i..." && \
	$(MAKE) PERL='${PERL}' clean) || exit 1; \
	done;

salaun's avatar
salaun committed
238
install: importantchanges installsrc installnls installwws installman installscript installsample installdir installconfig installdoc installsoap
239
240

importantchanges:
241
	@( 	PERL=$(PERL); export PERL; \
242
		UMASK=0600; export UMASK; \
243
244
245
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
246
247
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
248
	) ;
249

root's avatar
root committed
250
251

installsrc:
252
	@(cd src && echo "making in src..." && \
root's avatar
root committed
253
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
254
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
255
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' EXPL_DIR='${EXPL_DIR}' LIBEXECDIR='${LIBEXECDIR}' \
256
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' NLSDIR='${NLSDIR}' \
257
	ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
258
259
260
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}'  HOST='${HOST}' COOKIE='${COOKIE}' \
	SPOOLDIR='${SPOOLDIR}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
	SSLCERTDIR='${SSLCERTDIR}' \
root's avatar
root committed
261
262
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

263
264
265
266
267
268
269
270
271
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
272
installnls:
273
	@(cd nls && echo "making in nls..." && \
root's avatar
root committed
274
275
276
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' NLSDIR='${NLSDIR}' ETCBINDIR='${ETCBINDIR}' \
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
277
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
278
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' \
279
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
root's avatar
root committed
280
281

installwws:
282
	@(cd wwsympa && echo "making in wwsympa..." && \
root's avatar
root committed
283
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
284
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
285
	USER='${USER}' GROUP='${GROUP}' \
286
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
287
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
288
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;
root's avatar
root committed
289

salaun's avatar
salaun committed
290
291
292
293
installsoap:
	@(cd soap && echo "making in soap/..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
294
	USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
295
296
297
298
	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
299
installsample:
300
	@(cd src/etc/sample && echo "making in src/etc/sample..." && \
root's avatar
root committed
301
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
302
303
	DESTDIR='${DESTDIR}' DIR='${DIR}' SAMPLEDIR='${SAMPLEDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
304
	EXPL_DIR='${EXPL_DIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
305
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
306
307
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
308

salaun's avatar
salaun committed
309
310
311
installman:
	mkdir -p $(DESTDIR)$(MANDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man8
312
	@for manfile in sympa.8 archived.8 bounced.8 alias_manager.8; do \
313
	echo "Installing man file man8/$$manfile..."; \
salaun's avatar
salaun committed
314
315
316
317
318
319
320
321
322
	( \
		cd doc/man8 ; \
		PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
		DIR=$(DIR); export DIR; \
		INSTALLDIR=$(MANDIR)/man8; export INSTALLDIR; \
		DESTDIR=$(DESTDIR); export DESTDIR; \
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		CONFDIR=$(CONFDIR); export CONFDIR; \
323
		SENDMAIL_ALIASES=$(SENDMAIL_ALIASES); export SENDMAIL_ALIASES; \
324
		VIRTUAL_ALIASES=$(VIRTUAL_ALIASES); export VIRTUAL_ALIASES; \
325
326
327
		MAILERPROGDIR=$(MAILERPROGDIR); export MAILERPROGDIR; \
		PIDDIR=$(PIDDIR); export PIDDIR; \
		SPOOLDIR=$(SPOOLDIR); export SPOOLDIR; \
salaun's avatar
salaun committed
328
329
330
331
332
333
334
335
		PIDDIR=$(PIDDIR); export PIDDIR; \
		$(PERL) ../../subst.pl $$manfile \
	) ;\
	chown $(USER) $(DESTDIR)$(MANDIR)/man8/$$manfile; \
	chgrp $(GROUP) $(DESTDIR)$(MANDIR)/man8/$$manfile; \
	done


root's avatar
root committed
336
installscript:
337
	@(cd src/etc/script && echo "making in src/etc/script..." && \
root's avatar
root committed
338
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
339
340
341
	DIR='${DIR}' DESTDIR='${DESTDIR}' SCRIPTDIR='${SCRIPTDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
342
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
aumont's avatar
aumont committed
343
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' \
344
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
345
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
346
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
root's avatar
root committed
347
348
349


installdir:
350
351
	@echo "Creating required directories"
	@for dir in $(DIR) $(EXPL_DIR) $(CONFDIR) $(SAMPLEDIR) ; do \
352
353
354
355
356
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			mkdir -p $(DESTDIR)$$dir; \
			chown $(USER) $(DESTDIR)$$dir; \
			chgrp $(GROUP) $(DESTDIR)$$dir; \
357
			chmod 755 $(DESTDIR)$$dir; \
root's avatar
root committed
358
		fi \
359
	done
root's avatar
root committed
360
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
361
	echo "First installation : installing conf directories..."; \
362
363
364
365
366
367
368
	for dir in create_list_templates templates wws_templates scenari \
	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
369
370
371
372
		fi \
	done \
	fi
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
373
	echo "First installation : installing spool directories..."; \
root's avatar
root committed
374
	for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
375
376
	$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
	$(SPOOLDIR)/task ; do \
root's avatar
root committed
377
378
379
380
381
382
383
384
385
386
387
388
		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
389
	@INITCONF='0'
salaun's avatar
no echo    
salaun committed
390
	@for cfile in sympa.conf wwsympa.conf ; do \
root's avatar
root committed
391
392
	if [ ! -f $(DESTDIR)$(CONFDIR)/$$cfile ] ; then \
	echo "Installing sample config file $$cfile..."; \
393
	DESTDIR=$(DESTDIR); export DESTDIR; \
394
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl -c $$cfile; \
root's avatar
root committed
395
396
	chown $(USER) $(DESTDIR)$(CONFDIR)/$$cfile; \
	chgrp $(GROUP) $(DESTDIR)$(CONFDIR)/$$cfile; \
397
	if [ "$(DESTDIR)" = "" ]; then \
salaun's avatar
salaun committed
398
	INITCONF='1'; \
root's avatar
root committed
399
	fi \
400
	fi \
salaun's avatar
salaun committed
401
402
403
	done; \
	if [ "$$INITCONF" ] ; then \
	echo "###############################################"; \
salaun's avatar
salaun committed
404
405
	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 :"; \
406
	DESTDIR=$(DESTDIR); export DESTDIR; \
407
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl; \
408
	fi
root's avatar
root committed
409
410
411
412
413
414
415
416
417
418
419

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; \
420
		MTA='smtpdaemon'; export MTA; \
421
		HOMEDIR='/var/sympa'; export HOMEDIR; \
422
		ICONSDIR='/var/www/icons/sympa'; export ICONSDIR; \
423
		PIDDIR='/var/run/sympa'; export PIDDIR; \
root's avatar
root committed
424
		VERSION=$(SYMPA_VERSION); export VERSION; \
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
                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; \
                NLSDIR='/usr/lib/sympa/nls'; export NLSDIR; \
		SCRIPTDIR='/var/sympa/bin'; export SCRIPTDIR; \
		LIBEXECDIR='/var/sympa/bin'; export LIBEXECDIR; \
		SAMPLEDIR='/usr/share/sympa/examples'; export SAMPLEDIR; \
                ETCDIR='/etc/sympa'; export ETCDIR; \
441
		$(PERL) ../../../subst.pl sympa.spec.rh80 \
root's avatar
root committed
442
	)
443
	mv $(RPMTOPDIR)/SPECS/sympa.spec.rh80 $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
444
445
446
447
448
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		gzip $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
449
	rpmbuild  -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
450
451
452
453
454
455
456
457
458
459
460

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; \
461
		MTA='MailTransportAgent'; export MTA; \
root's avatar
root committed
462
463
		HOMEDIR='/var/lib/sympa'; export HOMEDIR; \
		VERSION=$(SYMPA_VERSION); export VERSION; \
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
                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; \
                NLSDIR='/usr/lib/sympa/nls'; export NLSDIR; \
		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
482
483
484
485
486
487
488
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		bzip2 $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
489
	rpmbuild -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
490

salaun's avatar
salaun committed
491
492
tag:	ChangeLog
	@if [ ! $(NEW_VERSION) ]; then \
salaun's avatar
salaun committed
493
	echo "Current version is $(VERSION)"; \
salaun's avatar
salaun committed
494
	echo "You need to define NEW_VERSION"; \
salaun's avatar
salaun committed
495
	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
496
	fi