Makefile.am 6.27 KB
Newer Older
1
2
# $Id$

3
# Sympa - SYsteme de Multi-Postage Automatique
4
5
6
7
#
# 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
8
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
9
10
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
11
# <https://github.com/sympa-community/sympa.git>.
12
13
14
15
16
17
18
19
20
21
22
23
#
# 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
24
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
25

26
SUBDIRS = src default doc po www
27

28
check_SCRIPTS = \
29
30
	t/01_Conf.t \
	t/02_Sympa_DatabaseManager.t \
31
32
33
34
35
36
37
	t/Language.t \
	t/LockedFile.t \
	t/Regexps.t \
	t/compile_modules.t \
	t/compile_executables.t \
	t/Database_LDAP.t \
	t/parse_templates.t \
38
	t/pod-syntax.t \
39
40
	t/tools_data.t \
	t/tools_file.t \
41
	t/Tools_Password.t \
42
	t/Tools_SMIME.t \
43
	t/Tools_Text.t \
44
	t/tools_time.t
45
46
47
48
49
50
51
52
53
54
55
check_DATA = \
	t/locale/cs/LC_MESSAGES/sympa.mo \
	t/locale/cs/LC_MESSAGES/web_help.mo \
	t/locale/zh_TW/LC_MESSAGES/sympa.mo \
	t/pki/cnf/ca.cnf \
	t/pki/cnf/rousse.cnf \
	t/pki/crt/ca.pem \
	t/pki/crt/rousse.pem \
	t/pki/key/ca.pem \
	t/pki/key/rousse_nopassword.pem \
	t/pki/key/rousse_password.pem \
56
	t/stub/Sympa/Constants.pm \
57
	t/data/sympa.conf \
58
	t/data/sympa.sqlite \
59
	t/data/etc/auth.conf \
60
	xt/perlcriticrc
61
noinst_SCRIPTS = \
62
	xt/critic.t \
63
64
	xt/fixme.t \
	xt/fixme-todo.t \
65
	xt/pod-coverage.t \
66
67
	xt/pod-spelling.t \
	xt/perltidy.t
IKEDA Soji's avatar
IKEDA Soji committed
68
69
nobase_modules_DATA = \
	cpanfile
70
71

EXTRA_DIST = \
72
	AUTHORS.md \
IKEDA Soji's avatar
IKEDA Soji committed
73
	CONTRIBUTING.md \
74
	INSTALL.md \
75
76
77
	NEWS.md \
	OChangeLog \
	ONEWS \
78
	README.md \
79
80
	etc_README \
	$(check_SCRIPTS) $(check_DATA) \
IKEDA Soji's avatar
IKEDA Soji committed
81
82
	$(noinst_SCRIPTS) \
	$(nobase_modules_DATA)
83

84
CLEANFILES =
85

86
87
88
89
MSGFMT=@MSGFMT@
.po.mo:
	$(MSGFMT) -o $@ $<

IKEDA Soji's avatar
IKEDA Soji committed
90
# Skip this with "make distcheck"
91
check-local: $(check_DATA)
IKEDA Soji's avatar
IKEDA Soji committed
92
93
94
95
96
	if test -d t; then \
		[ -z "$(TEST_FILES)" ] && TEST_FILES="$(check_SCRIPTS)"; \
		PERL5LIB=src/lib; export PERL5LIB; \
		$(PERL) -MTest::Harness -e 'runtests @ARGV' $$TEST_FILES; \
	fi
97

98
authorcheck:
99
	[ -z "$(TEST_FILES)" ] && TEST_FILES="$(noinst_SCRIPTS)"; \
100
	PERL5LIB=src/lib; export PERL5LIB; \
101
	$(PERL) -MTest::Harness -e 'runtests @ARGV' $$TEST_FILES
102

103
install-data-hook: installdir installconfig nextstep
root's avatar
root committed
104

105
installdir:
106
107
108
109
	@echo "Creating plugin directory"
	@for dir in $(modulesdir)/Sympa/Template/Plugin; do \
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
110
			$(INSTALL) -d -m 755 $(DESTDIR)$$dir; \
111
112
		fi; \
	done
113
	@echo "Creating writable directories"
114
	-@for dir in $(expldir) $(spooldir) $(bouncedir) $(arcdir) $(piddir) \
115
		$(confdir) $(sysconfdir); do \
116
117
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
118
			$(INSTALL) -d -m 755 $(DESTDIR)$$dir; \
119
		fi; \
120
121
		chown $(USER) $(DESTDIR)$$dir; \
		chgrp $(GROUP) $(DESTDIR)$$dir; \
122
	done
123
124
125
126
127
128
129
130
	-@for subdir in automatic bounce msg task tmp; do \
		if [ ! -d $(DESTDIR)$(spooldir)/$$subdir ] ; then \
			echo "Creating $(DESTDIR)$(spooldir)/$$subdir"; \
			$(INSTALL) -d -m 750 $(DESTDIR)$(spooldir)/$$subdir; \
		fi; \
		chown $(USER) $(DESTDIR)$(spooldir)/$$subdir; \
		chgrp $(GROUP) $(DESTDIR)$(spooldir)/$$subdir; \
	done
131

132
installconfig: installdir
133
	@echo "Installing basic configuration ..."
134
135
136
	-@if [ ! -f  $(DESTDIR)$(confdir)/sympa.conf ]; then \
		echo "installing sympa.conf"; \
		$(INSTALL) -m 640 sympa.conf $(DESTDIR)$(confdir); \
137
138
139
140
		chown $(USER) $(DESTDIR)$(confdir)/sympa.conf; \
		chgrp $(GROUP) $(DESTDIR)$(confdir)/sympa.conf; \
	fi
	-@if [ ! -f $(DESTDIR)$(sysconfdir)/data_structure.version ]; then \
141
		cd $(DESTDIR)$(sysconfdir); \
142
143
144
		echo "# automatically created file" >> data_structure.version; \
		echo "# you should not modify it" >> data_structure.version; \
		echo $(VERSION) >> data_structure.version; \
145
146
		chown $(USER) data_structure.version; \
		chgrp $(GROUP) data_structure.version; \
sympa-authors's avatar
sympa-authors committed
147
	fi
148
	-@for dir in create_list_templates custom_actions custom_conditions \
149
		data_sources families tasks \
150
		mail_tt2 scenari search_filters web_tt2; do \
151
152
		if [ ! -d $(DESTDIR)$(sysconfdir)/$$dir ] ; then \
			echo "Creating $(DESTDIR)$(sysconfdir)/$$dir"; \
153
			$(INSTALL) -d -m 755 $(DESTDIR)$(sysconfdir)/$$dir; \
154
		fi; \
155
156
		chown $(USER) $(DESTDIR)$(sysconfdir)/$$dir; \
		chgrp $(GROUP) $(DESTDIR)$(sysconfdir)/$$dir; \
157
158
159
160
161
162
	done
	@if [ ! -e $(DESTDIR)$(sysconfdir)/README ]; then \
		echo "Creating $(DESTDIR)$(sysconfdir)/README"; \
		$(SED) \
			-e 's|--sysconfdir--|$(sysconfdir)|' \
			-e 's|--defaultdir--|$(defaultdir)|' \
IKEDA Soji's avatar
IKEDA Soji committed
163
			$(srcdir)/etc_README > $(DESTDIR)$(sysconfdir)/README; \
164
		chmod 644 $(DESTDIR)$(sysconfdir)/README; \
165
	fi
sympa-authors's avatar
sympa-authors committed
166

olivier.salaun's avatar
olivier.salaun committed
167
nextstep: 
168
169
	@echo ""
	@echo "** You can find documentation at:"
IKEDA Soji's avatar
IKEDA Soji committed
170
	@echo "** https://sympa-community.github.io/manual/"
olivier.salaun's avatar
olivier.salaun committed
171
172
	@echo ""
	@echo "#########################################################"
173
	@echo "# CHECK YOU HAVE ALL THE NEEDED MODULES:"
174
175
	@echo "#    * Install or upgrade required perl modules. If you have cpanminus:"
	@echo "#        cpanm --installdeps --with-recommends ."
176
	@echo "#"
177
	@echo "# FIRST INSTALLATION:"
178
179
	@echo "#    * Edit this file to define initial configuration:"
	@echo "#        $(confdir)/sympa.conf"
180
	@echo "#"
181
182
183
	@echo "# UPGRADING"
	@echo "#    * Run this script to upgrade your data structures:"
	@echo "#        $(sbindir)/sympa.pl --upgrade"
olivier.salaun's avatar
olivier.salaun committed
184
	@echo "#######################################################"
185

186
uninstall-hook:
IKEDA Soji's avatar
IKEDA Soji committed
187
188
189
190
191
192
	cd $(DESTDIR)$(confdir) && rm -f sympa.conf
	cd $(DESTDIR)$(confdir) && rm -f wwsympa.conf
	cd $(DESTDIR)$(sysconfdir) && rm -f data_structure.version
	cd $(DESTDIR)$(sysconfdir) && rm -f README

DISTCHECK_CONFIGURE_FLAGS = --enable-fhs --with-perl=$(PERL)
193

194
195
196
dist-hook:
	$(MAKE) check

IKEDA Soji's avatar
IKEDA Soji committed
197
198
199
200
distcheck-hook:
	-md5sum $(DIST_ARCHIVES) > $(DIST_ARCHIVES).md5
	-sha256sum $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sha256

Luc Didry's avatar
Luc Didry committed
201
202
tidyall:
	tidyall --conf-file doc/dot.tidyallrc --root-dir . -r src t xt