Makefile.am 22.7 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
	echo -n "Please hit <Enter> to proceed"; \
183
	if [ "$(DESTDIR)" = "" ]; then read rep; fi
184

root's avatar
root committed
185
186
187
checkperl:
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
188
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
189
190
191
192
193
194
	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 "#############################################################################"; \
195
	if [ "$(DESTDIR)" = "" ]; then read rep; fi \
root's avatar
root committed
196
	fi
197
	@if [ ! -f $(SUIDPERL) ]; then \
sympa-authors's avatar
sympa-authors committed
198
199
200
201
202
203
204
		echo "#################################################################################"; \
		echo "## wwsympa.fcgi that provides Sympa's web interface needs to run as user $(USER)"; \
		echo "## There are many options to do so : "; \
		echo "##  1/ Installing 'suidperl' to run wwsympa.fcgi with SetUID. This is the default method,"; \
		echo "##     but it might be insecure."; \
		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
205
		echo "##     apache ALL = ($(USER))  NOPASSWD: $(CGIDIR)/wwsympa.fcgi"; \
sympa-authors's avatar
sympa-authors committed
206
207
208
209
		echo "##  3/ Use Apache's suExec mode."; \
		echo "## For (2) and (3) you should run Sympa's 'configure' with the '--enable-secure' option"; \
		echo "#######################################################################################"; \
		echo -n "Please hit <Enter> to continue"; \
210
		if [ "$(DESTDIR)" = "" ]; then read rep; fi \
211
	fi
sympa-authors's avatar
sympa-authors committed
212
213
214
	@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
215
		echo "## msgfmt is provided with a 'gettext' package on most systems..."; \
sympa-authors's avatar
sympa-authors committed
216
		echo "#####################################################"; \
217
		if [ "$(DESTDIR)" = "" ]; then read rep; fi \
sympa-authors's avatar
sympa-authors committed
218
219
	fi

220

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

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

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

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

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

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

nextstep: 
	@echo ""
	@echo "#########################################################"
	@echo "# If you install Sympa for the first time on this server"
	@echo "# you should check the INSTALL file."
	@echo "#######################################################"
270
271

importantchanges:
olivier.salaun's avatar
olivier.salaun committed
272
	@( 	PERL=$(PERL); export PERL; \
273
		UMASK=0600; export UMASK; \
274
		DESTDIR=$(DESTDIR); export DESTDIR; \
275
276
277
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
278
279
280
		ETCDIR=$(ETCDIR); export ETCDIR;\
		USER=$(USER); export USER;\
		GROUP=$(GROUP); export GROUP;\
281
282
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
283
	) ;
284

salaun's avatar
salaun committed
285
286
287
locale:
	@(cd po && echo "making in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
288
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
289
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
290
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
291
292
293
294
295
	USER='${USER}' GROUP='${GROUP}') || exit 1;

installlocale:
	@(cd po && echo "making install in po/...." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
296
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
297
298
299
300
301
302
	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}' \
303
	DIR='${DIR}' LOCALEDIR='${LOCALEDIR}' ETCBINDIR='${ETCBINDIR}' \
salaun's avatar
salaun committed
304
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
305
	SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
306
	USER='${USER}' GROUP='${GROUP}' update-po) || exit 1;
root's avatar
root committed
307
308

installsrc:
309
	@(cd src && echo "making in src..." && \
root's avatar
root committed
310
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
311
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
312
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' EXPL_DIR='${EXPL_DIR}' LIBEXECDIR='${LIBEXECDIR}' \
313
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' LOCALEDIR='${LOCALEDIR}' SCRIPTDIR='${SCRIPTDIR}' \
314
	ETCBINDIR='${ETCBINDIR}' ETCDIR='${ETCDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
315
316
317
	VIRTUAL_ALIASES='${VIRTUAL_ALIASES}'  HOST='${HOST}' COOKIE='${COOKIE}' \
	SPOOLDIR='${SPOOLDIR}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
	SSLCERTDIR='${SSLCERTDIR}' \
salaun's avatar
salaun committed
318
	PODIR='${prefix}/po' \
root's avatar
root committed
319
320
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

321
322
323
324
325
326
327
328
329
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
330
installwws:
331
	@(cd wwsympa && echo "making in wwsympa..." && \
root's avatar
root committed
332
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
333
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
sympa-authors's avatar
sympa-authors committed
334
	USER='${USER}' GROUP='${GROUP}' SUDO='${SUDO}' enable_secure='${enable_secure}' \
335
	CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
	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}' \
354
	PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
355
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;
root's avatar
root committed
356

salaun's avatar
salaun committed
357
358
359
360
installsoap:
	@(cd soap && echo "making in soap/..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
361
	USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' \
salaun's avatar
salaun committed
362
363
364
365
	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
366
installsample:
367
	@(cd src/etc/sample && echo "making in src/etc/sample..." && \
root's avatar
root committed
368
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
369
370
	DESTDIR='${DESTDIR}' DIR='${DIR}' SAMPLEDIR='${SAMPLEDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
371
	EXPL_DIR='${EXPL_DIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
372
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
373
374
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
375

salaun's avatar
salaun committed
376

salaun's avatar
salaun committed
377
installman:
378
379
	@(cd doc/man8 && \
	$(MAKE) PERL='${PERL}' DIR='${DIR}' DESTDIR='${DESTDIR}' SYMPA_VERSION='${SYMPA_VERSION}' MANDIR='${MANDIR}' \
380
	USER='${USER}' GROUP='${GROUP}' \
381
382
383
	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
384

root's avatar
root committed
385
installscript:
386
	@(cd src/etc/script && echo "making in src/etc/script..." && \
root's avatar
root committed
387
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
388
389
390
	DIR='${DIR}' DESTDIR='${DESTDIR}' SCRIPTDIR='${SCRIPTDIR}' \
	BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
	WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
391
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
aumont's avatar
aumont committed
392
	MAILERPROGDIR='${MAILERPROGDIR}' PIDDIR='${PIDDIR}' \
393
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
394
	PIDPRE='${PIDPRE}' PIDPOST='${PIDPOST}' LOCKDIR='${LOCKDIR}' \
395
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
root's avatar
root committed
396
397
398


installdir:
399
	@echo "Creating required directories"
olivier.salaun's avatar
olivier.salaun committed
400
	@for dir in $(DIR) $(EXPL_DIR) $(CONFDIR) $(SAMPLEDIR) $(ETCDIR) $(BINDIR) $(LOCALEDIR) $(DOCDIR) ; do \
401
402
403
404
405
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			mkdir -p $(DESTDIR)$$dir; \
			chown $(USER) $(DESTDIR)$$dir; \
			chgrp $(GROUP) $(DESTDIR)$$dir; \
406
			chmod 755 $(DESTDIR)$$dir; \
root's avatar
root committed
407
		fi \
408
	done
root's avatar
root committed
409
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
410
	echo "First installation : installing conf directories..."; \
411
	for dir in create_list_templates mail_tt2 web_tt2 scenari \
412
413
414
415
416
417
	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
418
		fi \
olivier.salaun's avatar
olivier.salaun committed
419
420
421
422
423
424
425
426
427
428
429
430
	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
431
432
	fi
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
433
	echo "First installation : installing spool directories..."; \
root's avatar
root committed
434
	for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
435
436
	$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
	$(SPOOLDIR)/task ; do \
root's avatar
root committed
437
438
439
440
441
442
443
444
445
		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
446
447
448
449
450
451
452
453
454
455
456
457
	@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
458
459
460

installconfig:
	mkdir -p $(DESTDIR)$(CONFDIR)
salaun's avatar
salaun committed
461
	@INITCONF='0'
salaun's avatar
no echo    
salaun committed
462
	@for cfile in sympa.conf wwsympa.conf ; do \
root's avatar
root committed
463
464
	if [ ! -f $(DESTDIR)$(CONFDIR)/$$cfile ] ; then \
	echo "Installing sample config file $$cfile..."; \
465
	DESTDIR=$(DESTDIR); export DESTDIR; \
466
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl -c $$cfile; \
root's avatar
root committed
467
468
	chown $(USER) $(DESTDIR)$(CONFDIR)/$$cfile; \
	chgrp $(GROUP) $(DESTDIR)$(CONFDIR)/$$cfile; \
469
	if [ "$(DESTDIR)" = "" ]; then \
salaun's avatar
salaun committed
470
	INITCONF='1'; \
root's avatar
root committed
471
	fi \
472
	fi \
salaun's avatar
salaun committed
473
474
475
	done; \
	if [ "$$INITCONF" ] ; then \
	echo "###############################################"; \
salaun's avatar
salaun committed
476
477
	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 :"; \
478
	DESTDIR=$(DESTDIR); export DESTDIR; \
479
	$(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl; \
480
	fi
root's avatar
root committed
481
482
483
484
485
486
487
488
489
490
491

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; \
492
		MTA='smtpdaemon'; export MTA; \
493
		HOMEDIR='/var/sympa'; export HOMEDIR; \
494
		ICONSDIR='/var/www/icons/sympa'; export ICONSDIR; \
495
		PIDDIR='/var/run/sympa'; export PIDDIR; \
root's avatar
root committed
496
		VERSION=$(SYMPA_VERSION); export VERSION; \
497
498
499
500
501
502
503
504
505
506
507
                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; \
508
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
509
510
511
512
		SCRIPTDIR='/var/sympa/bin'; export SCRIPTDIR; \
		LIBEXECDIR='/var/sympa/bin'; export LIBEXECDIR; \
		SAMPLEDIR='/usr/share/sympa/examples'; export SAMPLEDIR; \
                ETCDIR='/etc/sympa'; export ETCDIR; \
513
		$(PERL) ../../../subst.pl sympa.spec.rh80 \
root's avatar
root committed
514
	)
515
	mv $(RPMTOPDIR)/SPECS/sympa.spec.rh80 $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
516
517
518
519
520
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		gzip $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
521
	rpmbuild  -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
522
523
524
525
526
527
528
529
530
531
532

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; \
533
		MTA='MailTransportAgent'; export MTA; \
root's avatar
root committed
534
535
		HOMEDIR='/var/lib/sympa'; export HOMEDIR; \
		VERSION=$(SYMPA_VERSION); export VERSION; \
536
537
538
539
540
541
542
543
544
545
546
547
548
                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; \
549
                LOCALEDIR='/usr/lib/sympa/locale'; export LOCALEDIR; \
550
551
552
553
		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
554
555
556
557
558
559
560
		$(PERL) ../../../subst.pl sympa.spec \
	)
	@( \
		cd ..; \
		tar -cvf $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar sympa-$(SYMPA_VERSION); \
		bzip2 $(RPMTOPDIR)/SOURCES/sympa-$(SYMPA_VERSION).tar; \
	)
561
	rpmbuild -ba $(RPMTOPDIR)/SPECS/sympa.spec
root's avatar
root committed
562

salaun's avatar
salaun committed
563
564
tag:	ChangeLog
	@if [ ! $(NEW_VERSION) ]; then \
salaun's avatar
salaun committed
565
	echo "Current version is $(VERSION)"; \
salaun's avatar
salaun committed
566
	echo "You need to define NEW_VERSION"; \
salaun's avatar
salaun committed
567
	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
568
	fi