Makefile.am 12.8 KB
Newer Older
1
2
3
4
5
6
## Top-level Makefile.am for Sympa
#SUBDIRS = src doc wwsympa nls

ChangeLog:
	@CVS2CL@

root's avatar
root committed
7
## User Id and Group for Sympa (your httpd should have the same uid.gid)
8
9
USER	=	@USER@
GROUP	=	@GROUP@
root's avatar
root committed
10
11

## configuration file
12
CONFDIR	=	${sysconfdir}
root's avatar
root committed
13

salaun's avatar
salaun committed
14
15
16
## LC_ALL is set to this ; required to compile NLS
LANG	=	fr_FR

root's avatar
root committed
17
##  Perl path
18
PERL	=	@PERL@
root's avatar
root committed
19
20
21
22
23
24

## 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 $$]'`

25
SYMPA_VERSION	=	@VERSION@
root's avatar
root committed
26
27
28
29
30
31

## 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)
32
33
34
DIR	=	${prefix}

EXPL_DIR	=	${localstatedir}
root's avatar
root committed
35
36

## PID location
37
PIDDIR	=	${prefix}
root's avatar
root committed
38
39
40
41
42
43
44
45
46

## 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.  
MAILERPROGDIR	=	$(DIR)/bin

#RPMTOPDIR	=	`rpm --eval %_topdir`
RPMTOPDIR	=	/usr/src/redhat

47
MANDIR		=	${mandir}
salaun's avatar
salaun committed
48

root's avatar
root committed
49
50
51
## SYSV init scripts directory
INITDIR		=	$(DIR)/bin

52
53
54
55
56
## no more used ##
BINDIR		=	${bindir}

SBINDIR		=	${sbindir}
LIBDIR		=	${libdir}
root's avatar
root committed
57
58
59
60
61
62
63

## Spools directory
SPOOLDIR	=	$(DIR)/spool

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

64
## Web interface colors are now defined in sympa.conf
root's avatar
root committed
65
66
67
68

## Target directory for installing Icons
ICONSDIR	=	/home/httpd/icons

69
70
71
72
## Path to newaliases command (or what else may be called to rebuild
## Mail aliases database)
NEWALIASES    =       /usr/bin/newaliases

73
74
75
## Argument to newaliases command
# NEWALIASES_ARG	=	hash:/etc/mail/sympa_aliases

76
77
78
79
80
81
## The sendmail aliases file we use. Better use a seperate one for sympa.
## Of cause a extra alias file must be generated with proper permissions
## (owner sympa, write access for sympa, no write access for anyone else)
## and declared in sendmail.cf!
SENDMAIL_ALIASES=     /etc/mail/sympa_aliases

root's avatar
root committed
82
## Path to gencat program (creates the .cat catalog file using the .msg)
83
GENCAT	= 	@GENCAT@
root's avatar
root committed
84
85

## Path to OpenSSL
86
87
OPENSSL	=	@OPENSSL@
SSLCERTDIR =	$(EXPL_DIR)--/X509-user-certs
root's avatar
root committed
88

89
90
SH	=	@SH@
CC	=	@CC@
root's avatar
root committed
91
92
93
CFLAGS	=	-g

# Aix4.2 (and some others unix), use gnu make !
94
#MAKE	=	@MAKE@
root's avatar
root committed
95
96
97
98
99

##---------- STOP ---------- STOP ---------- STOP ---------- STOP ----------

CONFIG		=	$(CONFDIR)/sympa.conf
WWSCONFIG	=	$(CONFDIR)/wwsympa.conf
100
ETCBINDIR	=	${datadir}
root's avatar
root committed
101
102
103
104
105
106
107
108
NLSDIR		=	$(DIR)/nls

#ifeq ($(shell uname), Linux)
#	LOG_SOCKET_TYPE="inet"
#else
LOG_SOCKET_TYPE	=	"unix"
#endif

109
all:	checkcpan sources languages checkperl man
root's avatar
root committed
110
111
112
113

rpm: build_rh_rpm build_mdk_rpm

checkperl:
salaun's avatar
salaun committed
114
115
116
117
118
	@echo "#######################################"
	@echo "## Database structure has been extended"
	@echo "## You need to run the following command on your database :"
	@echo "## ALTER TABLE subscriber_table ADD comment_subscriber varchar (150);"
	@echo "## ";
119
	@echo "## Then run $(SBINDIR)/init_comment.pl"
root's avatar
root committed
120
121
	@if [ $(PERL_VERSION) = '5.006' ]; then \
	echo "##################################"; \
salaun's avatar
salaun committed
122
	echo "## You are using Perl version $(PERL_VERSION) :"; \
root's avatar
root committed
123
124
125
126
127
128
129
130
	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

131
sources: src/Makefile src/queue.c src/bouncequeue.c src/aliaswrapper.c
root's avatar
root committed
132
133
134
	@echo "Making src"
	(cd src && echo "making in src..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
135
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
root's avatar
root committed
136
137
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' \
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
138
	USER='${USER}' GROUP='${GROUP}' \
139
140
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' NEWALIASES='${NEWALIASES}' \
	NEWALIASES_ARG='${NEWALIASES_ARG}');
root's avatar
root committed
141

142
doc: doc/sympa.tex.tpl doc/Makefile 
root's avatar
root committed
143
144
145
	@echo "Making doc"
	(cd doc && echo "making in doc..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
146
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
root's avatar
root committed
147
148
149
150
	MAILERPROGDIR='${MAILERPROGDIR}' ETCBINDIR='${ETCBINDIR}' \
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
	USER='${USER}' GROUP='${GROUP}');

151
152
153
154
155
man: doc/man8/Makefile
	@echo "Making man"
	(cd doc/man8 && echo "making in doc/man8/..." && \
	$(MAKE) SYMPA_VERSION='$(SYMPA_VERSION)');

root's avatar
root committed
156
157
languages:
	@echo "Making nls"
salaun's avatar
salaun committed
158
	(LC_ALL=$(LANG); export LC_ALL; cd nls && echo "making in nls..." && \
root's avatar
root committed
159
	$(MAKE) SH='${SH}' PERL='${PERL}' ETCBINDIR='${ETCBINDIR}' \
160
	DIR='${DIR}' NLSDIR='${NLSDIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
root's avatar
root committed
161
162
163
164
165
166
167
168
	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 {} \;
169
	@for i in src nls wwsympa src/etc/sample;\
root's avatar
root committed
170
171
172
173
174
	do \
	(cd $$i && echo "making clean in $$i..." && \
	$(MAKE) PERL='${PERL}' clean) || exit 1; \
	done;

175
176
177
178
179
install: importantchanges installsrc installnls installwws installman installscript installsample installdir installconfig

importantchanges:
	( 	PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
180
181
182
		BINDIR=$(SBINDIR); export BINDIR; \
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
183
184
		SYMPA_VERSION=$(SYMPA_VERSION); export SYMPA_VERSION; \
		$(PERL) ./important_changes.pl \
185
	) ;
186

root's avatar
root committed
187
188
189
190

installsrc:
	(cd src && echo "making in src..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' SYMPA_VERSION='${SYMPA_VERSION}' \
191
192
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' \
	DESTDIR='${DESTDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
salaun's avatar
salaun committed
193
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
194
	ETCBINDIR='${ETCBINDIR}' SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
root's avatar
root committed
195
196
197
198
199
200
201
	USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;

installnls:
	(cd nls && echo "making in nls..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
	DIR='${DIR}' NLSDIR='${NLSDIR}' ETCBINDIR='${ETCBINDIR}' \
	DESTDIR='${DESTDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' \
202
	SENDMAIL_ALIASES='${SENDMAIL_ALIASES}' \
root's avatar
root committed
203
204
205
206
207
	USER='${USER}' GROUP='${GROUP}' GENCAT='${GENCAT}' newinstall) || exit 1;

installwws:
	(cd wwsympa && echo "making in wwsympa..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
208
	DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
root's avatar
root committed
209
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
210
	DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' newinstall) || exit 1;
root's avatar
root committed
211
212
213
214

installsample:
	(cd src/etc/sample && echo "making in src/etc/sample..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' LOG_SOCKET_TYPE='${LOG_SOCKET_TYPE}' \
215
	DESTDIR='${DESTDIR}' DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
216
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
217
218
	COOKIE='${COOKIE}' OPENSSL='@OPENSSL@' SSLCERTDIR='${SSLCERTDIR}' \
	SPOOLDIR='${SPOOLDIR}' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' PIDDIR='${PIDDIR}' install) || exit 1;
root's avatar
root committed
219

salaun's avatar
salaun committed
220
221
222
installman:
	mkdir -p $(DESTDIR)$(MANDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man8
223
	@for manfile in sympa.8 archived.8 bounced.8 alias_manager.8; do \
salaun's avatar
salaun committed
224
225
226
227
228
229
230
231
232
233
	echo "Installing man file man8/$$manfile..."; \
	( \
		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; \
234
235
236
237
		SENDMAIL_ALIASES=$(SENDMAIL_ALIASES); export SENDMAIL_ALIASES; \
		MAILERPROGDIR=$(MAILERPROGDIR); export MAILERPROGDIR; \
		PIDDIR=$(PIDDIR); export PIDDIR; \
		SPOOLDIR=$(SPOOLDIR); export SPOOLDIR; \
salaun's avatar
salaun committed
238
239
240
241
242
243
244
245
		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
246
247
248
installscript:
	(cd src/etc/script && echo "making in src/etc/script..." && \
	$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
249
	DIR='${DIR}' DESTDIR='${DESTDIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' WWSBINDIR='${WWSBINDIR}' HOST='${HOST}' \
root's avatar
root committed
250
251
	CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
	MAILERPROGDIR='${MAILERPROGDIR}' \
252
253
	COOKIE='${COOKIE}' INITDIR='${INITDIR}' \
	OPENSSL='@OPENSSL@' USER='${USER}' GROUP='${GROUP}' ICONSDIR='${ICONSDIR}' install) || exit 1;
root's avatar
root committed
254
255
256


installdir:
257
258
259
	echo "Setting $(USER) owner of $(DESTDIR)$(DIR)"
	chown $(USER) $(DESTDIR)$(DIR)
	chgrp $(GROUP) $(DESTDIR)$(DIR)
root's avatar
root committed
260
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
261
	echo "First installation : installing directories..."; \
root's avatar
root committed
262
263
264
265
266
267
268
269
270
271
	for dir in expl etc sample ; 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
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
272
	echo "First installation : installing conf directories..."; \
273
274
	for dir in etc/create_list_templates etc/templates etc/wws_templates etc/scenari \
	etc/task_models etc/general_task_models; do \
root's avatar
root committed
275
276
277
278
279
280
281
282
283
		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
	@if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
284
	echo "First installation : installing spool directories..."; \
root's avatar
root committed
285
	for dir in $(SPOOLDIR) $(SPOOLDIR)/msg $(SPOOLDIR)/digest $(SPOOLDIR)/moderation \
286
287
	$(SPOOLDIR)/expire $(SPOOLDIR)/auth $(SPOOLDIR)/outgoing $(SPOOLDIR)/tmp \
	$(SPOOLDIR)/task ; do \
root's avatar
root committed
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
		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)
	@for cfile in sympa.conf wwsympa.conf ; do \
	if [ ! -f $(DESTDIR)$(CONFDIR)/$$cfile ] ; then \
	echo "Installing sample config file $$cfile..."; \
	( \
		cd src/etc/sample/ ; \
		PERL=$(PERL); export PERL; \
		UMASK=0600; export UMASK; \
		DIR=$(DIR); export DIR; \
308
		EXPL_DIR=$(EXPL_DIR); export EXPL_DIR; \
root's avatar
root committed
309
310
311
		INSTALLDIR=$(CONFDIR); export INSTALLDIR; \
		DESTDIR=$(DESTDIR); export DESTDIR; \
		BINDIR=$(BINDIR); export BINDIR; \
312
313
		SBINDIR=$(SBINDIR); export SBINDIR; \
		LIBDIR=$(LIBDIR); export LIBDIR; \
root's avatar
root committed
314
315
316
317
318
		ETCBINDIR=$(ETCBINDIR); export ETCBINDIR; \
		CONFIG=$(CONFIG); export CONFIG; \
		LOG_SOCKET_TYPE=$(LOG_SOCKET_TYPE); export LOG_SOCKET_TYPE; \
		COOKIE=$(COOKIE); export COOKIE; \
		HOST=$(HOST); export HOST; \
319
		OPENSSL=@OPENSSL@; export OPENSSL ; \
root's avatar
root committed
320
		SSLCERTDIR=$(SSLCERTDIR); export SSLCERTDIR ; \
321
322
		PIDDIR=$(PIDDIR); export PIDDIR; \
		SPOOLDIR=$(SPOOLDIR); export SPOOLDIR; \
root's avatar
root committed
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
		$(PERL) ../../../subst.pl $$cfile \
	) ;\
	chown $(USER) $(DESTDIR)$(CONFDIR)/$$cfile; \
	chgrp $(GROUP) $(DESTDIR)$(CONFDIR)/$$cfile; \
	fi \
	done

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; \
		HOMEDIR='/home/sympa'; export HOMEDIR; \
		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; \
		$(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