Makefile.am 4.29 KB
Newer Older
1
# Makefile.am - Top-level Makefile.am for Sympa
2
3
4
# RCS Identication ; $Revision$ ; $Date$ 
#
# Sympa - SYsteme de Multi-Postage Automatique
5
6
7
8
9
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014 GIP RENATER
10
11
12
13
14
15
16
17
18
19
20
21
#
# 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
22
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23

24
SUBDIRS = src wwsympa soap web_tt2 mail_tt2 doc po po-wwsympa
25

26
27
28
29
EXTRA_DIST = important_changes.pl \
	     sympa.spec.in \
	     sympa.spec \
	     README.charset
30
CLEANFILES = previous_sympa_version
31

32
install-data-hook: installdir installconfig nextstep importantchanges
root's avatar
root committed
33

34
35
36
37
38
installdir:
	@echo "Creating writable directories"
	@for dir in $(expldir) $(spooldir) $(spooldir)/msg $(spooldir)/digest \
		$(spooldir)/moderation $(spooldir)/expire $(spooldir)/auth \
		$(spooldir)/outgoing $(spooldir)/tmp $(spooldir)/task \
39
		$(bouncedir) $(arcdir) $(piddir) $(staticdir) $(staticdir)/js $(sysconfdir); do \
40
41
42
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			install -d -m 755 $(DESTDIR)$$dir; \
43
44
45
		fi; \
		chown $(USER) $(DESTDIR)$$dir || /bin/true; \
		chgrp $(GROUP) $(DESTDIR)$$dir || /bin/true; \
46
	done
47

48
installconfig: installdir
49
50
	@echo "Installing basic configuration ..."
	export PERL5LIB=$(DESTDIR)$(modulesdir); \
51
	if [ ! -f  $(DESTDIR)$(confdir)/sympa.conf ]; then \
olivier.salaun's avatar
olivier.salaun committed
52
		echo "This looks like your first Sympa installation. The following wizard will assist you to create your first Sympa configuration.";\
53
54
55
		if [ ! -d $(DESTDIR)$(confdir) ]; then \
			$(INSTALL) -d -m 755 $(DESTDIR)$(confdir); \
		fi; \
56
		$(SED) \
57
58
59
60
61
62
			-e 's|--PERL--|$(PERL)|' \
			-e 's|--modulesdir--|$(top_srcdir)/src/lib|' \
			< $(top_srcdir)/src/sympa_wizard.pl.in > \
			$(top_srcdir)/src/sympa_wizard.pl.install; \
		chmod +x $(top_srcdir)/src/sympa_wizard.pl.install; \
		$(top_srcdir)/src/sympa_wizard.pl.install \
63
			--create sympa.conf \
64
			--target $(DESTDIR)$(confdir)/sympa.conf \
65
			|| /bin/true; \
66
		$(top_srcdir)/src/sympa_wizard.pl.install \
67
			--create wwsympa.conf \
68
			--target $(DESTDIR)$(confdir)/wwsympa.conf \
69
			|| /bin/true; \
70
		rm -f $(top_srcdir)/src/sympa_wizard.pl.install; \
71
	fi; \
72
73
	if [ ! -f $(DESTDIR)$(sysconfdir)/data_structure.version ]; then \
		cd $(DESTDIR)$(sysconfdir); \
74
75
76
		echo "# automatically created file" >> data_structure.version; \
		echo "# you should not modify it" >> data_structure.version; \
		echo $(VERSION) >> data_structure.version; \
77
78
		chown $(USER) data_structure.version || /bin/true; \
		chgrp $(GROUP) data_structure.version || /bin/true; \
sympa-authors's avatar
sympa-authors committed
79
80
	fi

olivier.salaun's avatar
olivier.salaun committed
81
nextstep: 
82
83
	@echo ""
	@echo "** You can find documentation at:"
84
	@echo "** http://www.sympa.org/documentation/manual/sympa-$(VERSION).pdf"
olivier.salaun's avatar
olivier.salaun committed
85
86
	@echo ""
	@echo "#########################################################"
87
88
89
90
	@echo "# CHECK YOU HAVE ALL THE NEEDED MODULES:"
	@echo "#    * Check the required perl modules are installed:"
	@echo "#        $(sbindir)/sympa_wizard.pl --check"
	@echo "#"
91
92
93
94
	@echo "# FIRST INSTALLATION:"
	@echo "#    * Check the INSTALL file."
	@echo "#    * Run the wizard to define some required parameters that can't be guessed."
	@echo "#        $(sbindir)/sympa_wizard.pl"
95
	@echo "#"
96
97
98
	@echo "# UPGRADING"
	@echo "#    * Run this script to upgrade your data structures:"
	@echo "#        $(sbindir)/sympa.pl --upgrade"
olivier.salaun's avatar
olivier.salaun committed
99
	@echo "#######################################################"
100
101

importantchanges:
102
103
	if test -f $(top_srcdir)/previous_sympa_version; then \
		export PREVIOUS=`$(CAT) $(top_srcdir)/previous_sympa_version`; \
104
	fi; \
105
106
107
		$(PERL) $(top_srcdir)/important_changes.pl \
			--current=$(VERSION) \
			--previous=$${PREVIOUS};
108
109

uninstall-hook:
110
111
	rm -f $(DESTDIR)$(confdir)/sympa.conf
	rm -f $(DESTDIR)$(confdir)/wwsympa.conf