Makefile.am 5.41 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
check_SCRIPTS = t/LockedFile.t \
		t/compile_modules.t \
		t/compile_executables.t
29

30
31
32
EXTRA_DIST = important_changes.pl \
	     sympa.spec.in \
	     sympa.spec \
33
	     README.charset \
34
35
	     etc_README \
	     $(check_SCRIPTS)
36
CLEANFILES = previous_sympa_version
37

38
check-local:
39
40
41
	[ -z "$(TEST_FILES)" ] && TEST_FILES="$(check_SCRIPTS)"; \
	PERL5LIB=src/lib:wwsympa:soap; export PERL5LIB; \
	$(PERL) -MTest::Harness -e 'runtests @ARGV' $$TEST_FILES
42

43
install-data-hook: installdir installconfig nextstep importantchanges
root's avatar
root committed
44

45
installdir:
46
47
48
49
50
51
52
	@echo "Creating plugin directory"
	@for dir in $(modulesdir)/Sympa/Template/Plugin; do \
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			install -d -m 755 $(DESTDIR)$$dir; \
		fi; \
	done
53
54
55
56
	@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 \
57
		$(bouncedir) $(arcdir) $(piddir) $(staticdir) $(staticdir)/js $(sysconfdir); do \
58
59
60
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
			install -d -m 755 $(DESTDIR)$$dir; \
61
62
63
		fi; \
		chown $(USER) $(DESTDIR)$$dir || /bin/true; \
		chgrp $(GROUP) $(DESTDIR)$$dir || /bin/true; \
64
	done
65

66
installconfig: installdir
67
68
	@echo "Installing basic configuration ..."
	export PERL5LIB=$(DESTDIR)$(modulesdir); \
69
	if [ ! -f  $(DESTDIR)$(confdir)/sympa.conf ]; then \
olivier.salaun's avatar
olivier.salaun committed
70
		echo "This looks like your first Sympa installation. The following wizard will assist you to create your first Sympa configuration.";\
71
72
73
		if [ ! -d $(DESTDIR)$(confdir) ]; then \
			$(INSTALL) -d -m 755 $(DESTDIR)$(confdir); \
		fi; \
74
		$(SED) \
75
76
77
78
79
80
			-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 \
81
			--create sympa.conf \
82
			--target $(DESTDIR)$(confdir)/sympa.conf \
83
			|| /bin/true; \
84
		rm -f $(top_srcdir)/src/sympa_wizard.pl.install; \
85
	fi; \
86
87
	if [ ! -f $(DESTDIR)$(sysconfdir)/data_structure.version ]; then \
		cd $(DESTDIR)$(sysconfdir); \
88
89
90
		echo "# automatically created file" >> data_structure.version; \
		echo "# you should not modify it" >> data_structure.version; \
		echo $(VERSION) >> data_structure.version; \
91
92
		chown $(USER) data_structure.version || /bin/true; \
		chgrp $(GROUP) data_structure.version || /bin/true; \
sympa-authors's avatar
sympa-authors committed
93
	fi
94
	@for dir in create_list_templates custom_actions families \
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
		global_task_models list_task_models scenari search_filters \
		mail_tt2 web_tt2; do \
		if [ ! -d $(DESTDIR)$(sysconfdir)/$$dir ] ; then \
			echo "Creating $(DESTDIR)$(sysconfdir)/$$dir"; \
			install -d -m 755 $(DESTDIR)$(sysconfdir)/$$dir; \
		fi; \
		chown $(USER) $(DESTDIR)$(sysconfdir)/$$dir || /bin/true; \
		chgrp $(GROUP) $(DESTDIR)$(sysconfdir)/$$dir || /bin/true; \
	done
	@if [ ! -e $(DESTDIR)$(sysconfdir)/README ]; then \
		echo "Creating $(DESTDIR)$(sysconfdir)/README"; \
		$(SED) \
			-e 's|--sysconfdir--|$(sysconfdir)|' \
			-e 's|--defaultdir--|$(defaultdir)|' \
			etc_README > $(DESTDIR)$(sysconfdir)/README; \
		chmod 444 $(DESTDIR)$(sysconfdir)/README; \
	fi
sympa-authors's avatar
sympa-authors committed
112

olivier.salaun's avatar
olivier.salaun committed
113
nextstep: 
114
115
	@echo ""
	@echo "** You can find documentation at:"
116
	@echo "** http://www.sympa.org/documentation/manual/sympa-$(VERSION).pdf"
olivier.salaun's avatar
olivier.salaun committed
117
118
	@echo ""
	@echo "#########################################################"
119
120
121
122
	@echo "# CHECK YOU HAVE ALL THE NEEDED MODULES:"
	@echo "#    * Check the required perl modules are installed:"
	@echo "#        $(sbindir)/sympa_wizard.pl --check"
	@echo "#"
123
124
125
126
	@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"
127
	@echo "#"
128
129
130
	@echo "# UPGRADING"
	@echo "#    * Run this script to upgrade your data structures:"
	@echo "#        $(sbindir)/sympa.pl --upgrade"
olivier.salaun's avatar
olivier.salaun committed
131
	@echo "#######################################################"
132
133

importantchanges:
134
135
	if test -f $(top_srcdir)/previous_sympa_version; then \
		export PREVIOUS=`$(CAT) $(top_srcdir)/previous_sympa_version`; \
136
	fi; \
137
138
139
		$(PERL) $(top_srcdir)/important_changes.pl \
			--current=$(VERSION) \
			--previous=$${PREVIOUS};
140
141

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