Makefile.am 16.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 gencat program (creates the .cat catalog file using the .msg)
132
GENCAT	= 	@GENCAT@
root's avatar
root committed
133
134

## Path to OpenSSL
135
OPENSSL	=	@OPENSSL@
salaun's avatar
salaun committed
136
SSLCERTDIR =	$(EXPL_DIR)/X509-user-certs
root's avatar
root committed
137

138
139
SH	=	@SH@
CC	=	@CC@
root's avatar
root committed
140
141
142
CFLAGS	=	-g

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

145
146
147
148
149
150
151
152
153
154
155
# 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
156
157
158
159
##---------- STOP ---------- STOP ---------- STOP ---------- STOP ----------

CONFIG		=	$(CONFDIR)/sympa.conf
WWSCONFIG	=	$(CONFDIR)/wwsympa.conf
160
ETCBINDIR	=	@DATADIR@
root's avatar
root committed
161
162
163
164

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

168
all:	checkcpan sources languages checkperl man
root's avatar
root committed
169
170
171
172
173
174

rpm: build_rh_rpm build_mdk_rpm

checkperl:
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
175
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
176
177
178
179
180
181
182
183
	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

184
sources: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
root's avatar
root committed
185
	@echo "Making src"
186
	@(cd src && echo "making in src..." && \
root's avatar
root committed
187
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
188
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
root's avatar
root committed
189
190
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' \
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
191
	USER='${USER}' GROUP='${GROUP}' \
192
193
194
195
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}' \
	NEWALIASES='${NEWALIASES}' NEWALIASES_ARG='${NEWALIASES_ARG}' \
	POSTMAP='${POSTMAP}' POSTMAP_ARG='${POSTMAP_ARG}' \
196
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}');
root's avatar
root committed
197

198
199
200
documentation: doc/sympa.tex.tpl doc/Makefile 
	@echo "Making documentation"
	@(cd doc && echo "making in doc/..." && \
root's avatar
root committed
201
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
202
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
root's avatar
root committed
203
204
205
206
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' \
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
	USER='${USER}' GROUP='${GROUP}');

207
208
man: doc/man8/Makefile
	@echo "Making man"
209
	@(cd doc/man8 && echo "making in doc/man8/..." && \
210
211
	$(MAKE) SYMPA_VERSION='$(SYMPA_VERSION)');

root's avatar
root committed
212
213
languages:
	@echo "Making nls"
214
	(cd nls && echo "making in nls..." && \
root's avatar
root committed
215
	$(MAKE) SH='${SH}' PERL='${PERL}' ETCBINDIR='${ETCBINDIR}' \
216
	DIR='${DIR}' NLSDIR='${NLSDIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
root's avatar
root committed
217
218
219
220
221
222
223
224
	USER='${USER}' GROUP='${GROUP}' GENCAT='${GENCAT}');

checkcpan: 
	@echo "Checking needed CPAN modules ..."
	$(PERL) ./check_perl_modules.pl

clean:
	find . \( -name ".#*" -o -name "*~" -o -name ".*~" -o -name "#*#" \) -exec  rm -f {} \;
225
	@for i in src nls wwsympa src/etc/sample;\
root's avatar
root committed
226
227
228
229
230
	do \
	(cd $$i && echo "making clean in $$i..." && \
	$(MAKE) PERL='${PERL}' clean) || exit 1; \
	done;

231
install: importantchanges installsrc installnls installwws installman installscript installsample installdir installconfig installdoc
232
233

importantchanges:
234
	@( 	PERL=$(PERL); export PERL; \
235
		UMASK=0600; export UMASK; \
236
237
238
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
239
240
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
241
	) ;
242

root's avatar
root committed
243
244

installsrc:
245
	@(cd src && echo "making in src..." && \
root's avatar
root committed
246
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
247
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
248
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' EXPL_DIR='${EXPL_DIR}' LIBEXECDIR='${LIBEXECDIR}' \
249
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
250
	ETCBINDIR='${ETCBINDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
251
252
253
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}'  HOST='${HOST}' COOKIE='${COOKIE}' \
	SPOOLDIR='${SPOOLDIR}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
	SSLCERTDIR='${SSLCERTDIR}' \
root's avatar
root committed
254
255
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

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

installwws:
275
	@(cd wwsympa && echo "making in wwsympa..." && \
root's avatar
root committed
276
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
277
278
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
279
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
280
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;
root's avatar
root committed
281
282

installsample:
283
	@(cd src/etc/sample && echo "making in src/etc/sample..." && \
root's avatar
root committed
284
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
285
286
	DESTDIR='${DESTDIR}' DIR='${DIR}' SAMPLEDIR='${SAMPLEDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
287
	EXPL_DIR='${EXPL_DIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
288
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
289
290
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
291

salaun's avatar
salaun committed
292
293
294
installman:
	mkdir -p $(DESTDIR)$(MANDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man8
295
	@for manfile in sympa.8 archived.8 bounced.8 alias_manager.8; do \
296
	echo "Installing man file man8/$$manfile..."; \
salaun's avatar
salaun committed
297
298
299
300
301
302
303
304
305
	( \
		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; \
306
		SENDMAIL_ALIASES=$(SENDMAIL_ALIASES); export SENDMAIL_ALIASES; \
307
		VIRTUAL_ALIASES=$(VIRTUAL_ALIASES); export VIRTUAL_ALIASES; \
308
309
310
		MAILERPROGDIR=$(MAILERPROGDIR); export MAILERPROGDIR; \
		PIDDIR=$(PIDDIR); export PIDDIR; \
		SPOOLDIR=$(SPOOLDIR); export SPOOLDIR; \
salaun's avatar
salaun committed
311
312
313
314
315
316
317
318
		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
319
installscript:
320
	@(cd src/etc/script && echo "making in src/etc/script..." && \
root's avatar
root committed
321
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
322
323
324
	DIR='${DIR}' DESTDIR='${DESTDIR}' SCRIPTDIR='${SCRIPTDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
325
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
aumont's avatar
aumont committed
326
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' \
327
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
328
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
329
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
root's avatar
root committed
330
331
332


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

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; \
411
412
		HOMEDIR='/var/sympa'; export HOMEDIR; \
		ICONSDIR='/var/www/icons'; export ICONSDIR; \
413
		PIDDIR='/var/run/sympa'; export PIDDIR; \
root's avatar
root committed
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
		VERSION=$(SYMPA_VERSION); export VERSION; \
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		gzip $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
	rpm -ba $(RPMTOPDIR)/SPECS/sympa.spec

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; \
		HOMEDIR='/var/lib/sympa'; export HOMEDIR; \
		VERSION=$(SYMPA_VERSION); export VERSION; \
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
                CONFDIR=$(CONFDIR); export CONFDIR; \
                SENDMAIL_ALIASES=$(SENDMAIL_ALIASES); export SENDMAIL_ALIASES; \
                MAILERPROGDIR=$(MAILERPROGDIR); export MAILERPROGDIR; \
                PIDDIR=$(PIDDIR); export PIDDIR; \
                SPOOLDIR=$(SPOOLDIR); export SPOOLDIR; \
		ICONSDIR=$(ICONSDIR); export ICONSDIR; \
                BINDIR=$(BINDIR); export BINDIR; \
                SBINDIR=$(SBINDIR); export SBINDIR; \
                DATADIR=$(DATADIR); export DATADIR; \
                EXPLDIR=$(EXPLDIR); export EXPLDIR; \
                LIBDIR=$(LIBDIR); export LIBDIR; \
                CGIDIR=$(CGIDIR); export CGIDIR; \
                NLSDIR=$(NLSDIR); export NLSDIR; \
		SCRIPTDIR=$(SCRIPTDIR); export SCRIPTDIR; \
		SAMPLEDIR=$(SAMPLEDIR); export SAMPLEDIR; \
                ETCDIR=$(ETCDIR); export ETCDIR; \
root's avatar
root committed
452
453
454
455
456
457
458
459
460
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		bzip2 $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
	rpm -ba $(RPMTOPDIR)/SPECS/sympa.spec

salaun's avatar
salaun committed
461
462
tag:	ChangeLog
	@if [ ! $(NEW_VERSION) ]; then \
salaun's avatar
salaun committed
463
	echo "Current version is $(VERSION)"; \
salaun's avatar
salaun committed
464
	echo "You need to define NEW_VERSION"; \
salaun's avatar
salaun committed
465
	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
466
	fi