Makefile.am 7.22 KB
Newer Older
1
# Sympa - SYsteme de Multi-Postage Automatique
2
3
4
5
#
# 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
6
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
IKEDA Soji's avatar
IKEDA Soji committed
7
8
# Copyright 2017, 2018, 2019, 2022 The Sympa Community. See the
# AUTHORS.md file at the top-level directory of this distribution and at
9
# <https://github.com/sympa-community/sympa.git>.
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

IKEDA Soji's avatar
IKEDA Soji committed
24
SUBDIRS = src default doc po service www
25

26
check_SCRIPTS = \
27
	t/01_Conf.t \
IKEDA Soji's avatar
IKEDA Soji committed
28
	t/Config_XML.t \
29
	t/DataSource_LDAP2.t \
IKEDA Soji's avatar
IKEDA Soji committed
30
31
	t/DatabaseManager.t \
	t/Database_LDAP.t \
32
33
	t/Language.t \
	t/LockedFile.t \
IKEDA Soji's avatar
IKEDA Soji committed
34
	t/Message_smime.t \
IKEDA Soji's avatar
IKEDA Soji committed
35
	t/Message_urlize.t \
36
	t/Regexps.t \
IKEDA Soji's avatar
IKEDA Soji committed
37
	t/Request_Handler_add+del.t \
IKEDA Soji's avatar
IKEDA Soji committed
38
	t/Scenario.t \
IKEDA Soji's avatar
IKEDA Soji committed
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 \
IKEDA Soji's avatar
IKEDA Soji committed
44
	t/Tools_Time.t \
45
	t/WWW_Tools.t \
46
	t/compile_executables.t \
IKEDA Soji's avatar
IKEDA Soji committed
47
	t/compile_modules.t \
48
	t/compile_scenarios.t \
49
	t/parse_templates.t \
IKEDA Soji's avatar
IKEDA Soji committed
50
	t/pod-syntax.t
51
check_DATA = \
IKEDA Soji's avatar
IKEDA Soji committed
52
	src/lib/Sympa/Test/MockLDAP.pm \
IKEDA Soji's avatar
IKEDA Soji committed
53
54
55
56
	t/data/list_data/test/config \
	t/data/sympa.conf \
	t/data/sympa.sqlite \
	t/data/etc/auth.conf \
57
58
59
60
61
62
63
64
65
66
	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 \
IKEDA Soji's avatar
IKEDA Soji committed
67
68
69
70
71
72
73
74
	t/samples/urlize-deep-nested-mixed.eml \
	t/samples/urlize-encoding.eml \
	t/samples/urlize-nested-alternative-and-related.eml \
	t/samples/urlize-nested-alternative.eml \
	t/samples/urlize-nested-mixed.eml \
	t/samples/urlize-nested-mutiple-attachments.eml \
	t/samples/urlize-simple-mutiple-attachments.eml \
	t/samples/urlize-simple.eml \
IKEDA Soji's avatar
IKEDA Soji committed
75
76
	t/samples/signed.eml \
	t/samples/unsigned.eml \
77
	t/stub/Sympa/Constants.pm \
78
79
	xt/perlcriticrc \
	xt/tidyallrc
80
noinst_SCRIPTS = \
81
	xt/critic.t \
82
83
	xt/fixme.t \
	xt/fixme-todo.t \
84
	xt/pod-coverage.t \
85
86
	xt/pod-spelling.t \
	xt/perltidy.t
IKEDA Soji's avatar
IKEDA Soji committed
87
88
nobase_modules_DATA = \
	cpanfile
89
90

EXTRA_DIST = \
91
	AUTHORS.md \
IKEDA Soji's avatar
IKEDA Soji committed
92
	CONTRIBUTING.md \
93
	INSTALL.md \
94
95
96
	NEWS.md \
	OChangeLog \
	ONEWS \
97
	README.md \
98
99
	etc_README \
	$(check_SCRIPTS) $(check_DATA) \
IKEDA Soji's avatar
IKEDA Soji committed
100
101
	$(noinst_SCRIPTS) \
	$(nobase_modules_DATA)
102

103
CLEANFILES =
104

105
106
107
108
MSGFMT=@MSGFMT@
.po.mo:
	$(MSGFMT) -o $@ $<

IKEDA Soji's avatar
IKEDA Soji committed
109
# Skip this with "make distcheck"
110
check-local: $(check_DATA)
IKEDA Soji's avatar
IKEDA Soji committed
111
112
	if test -d t; then \
		[ -z "$(TEST_FILES)" ] && TEST_FILES="$(check_SCRIPTS)"; \
113
		PERL5LIB=src/lib:$(PERL5LIB); export PERL5LIB; \
IKEDA Soji's avatar
IKEDA Soji committed
114
115
		$(PERL) -MTest::Harness -e 'runtests @ARGV' $$TEST_FILES; \
	fi
116

117
authorcheck:
118
	[ -z "$(TEST_FILES)" ] && TEST_FILES="$(noinst_SCRIPTS)"; \
119
	PERL5LIB=src/lib:$(PERL5LIB); export PERL5LIB; \
120
	$(PERL) -MTest::Harness -e 'runtests @ARGV' $$TEST_FILES
121

122
install-data-hook: installdir installconfig nextstep
root's avatar
root committed
123

124
installdir:
125
126
127
128
	@echo "Creating plugin directory"
	@for dir in $(modulesdir)/Sympa/Template/Plugin; do \
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
129
			$(INSTALL) -d -m 755 $(DESTDIR)$$dir; \
130
131
		fi; \
	done
132
	@echo "Creating writable directories"
133
	-@for dir in $(expldir) $(spooldir) $(bouncedir) $(arcdir) $(piddir) \
134
		$(confdir) $(sysconfdir); do \
135
136
		if [ ! -d $(DESTDIR)$$dir ] ; then \
			echo "Creating $(DESTDIR)$$dir"; \
137
			$(INSTALL) -d -m 755 $(DESTDIR)$$dir; \
138
		fi; \
139
140
		chown $(USER) $(DESTDIR)$$dir; \
		chgrp $(GROUP) $(DESTDIR)$$dir; \
141
	done
142
143
144
145
146
147
148
149
	-@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
150

151
installconfig: installdir
152
	@echo "Installing basic configuration ..."
153
154
155
	-@if [ ! -f  $(DESTDIR)$(confdir)/sympa.conf ]; then \
		echo "installing sympa.conf"; \
		$(INSTALL) -m 640 sympa.conf $(DESTDIR)$(confdir); \
156
157
158
159
		chown $(USER) $(DESTDIR)$(confdir)/sympa.conf; \
		chgrp $(GROUP) $(DESTDIR)$(confdir)/sympa.conf; \
	fi
	-@if [ ! -f $(DESTDIR)$(sysconfdir)/data_structure.version ]; then \
160
		cd $(DESTDIR)$(sysconfdir); \
161
162
163
		echo "# automatically created file" >> data_structure.version; \
		echo "# you should not modify it" >> data_structure.version; \
		echo $(VERSION) >> data_structure.version; \
164
165
		chown $(USER) data_structure.version; \
		chgrp $(GROUP) data_structure.version; \
sympa-authors's avatar
sympa-authors committed
166
	fi
167
	-@for dir in create_list_templates custom_actions custom_conditions \
168
		data_sources families tasks \
169
		mail_tt2 scenari search_filters web_tt2; do \
170
171
		if [ ! -d $(DESTDIR)$(sysconfdir)/$$dir ] ; then \
			echo "Creating $(DESTDIR)$(sysconfdir)/$$dir"; \
172
			$(INSTALL) -d -m 755 $(DESTDIR)$(sysconfdir)/$$dir; \
173
		fi; \
174
175
		chown $(USER) $(DESTDIR)$(sysconfdir)/$$dir; \
		chgrp $(GROUP) $(DESTDIR)$(sysconfdir)/$$dir; \
176
177
178
179
180
181
	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
182
			$(srcdir)/etc_README > $(DESTDIR)$(sysconfdir)/README; \
183
		chmod 644 $(DESTDIR)$(sysconfdir)/README; \
184
	fi
sympa-authors's avatar
sympa-authors committed
185

olivier.salaun's avatar
olivier.salaun committed
186
nextstep: 
187
188
	@echo ""
	@echo "** You can find documentation at:"
IKEDA Soji's avatar
IKEDA Soji committed
189
	@echo "** https://sympa-community.github.io/manual/"
olivier.salaun's avatar
olivier.salaun committed
190
191
	@echo ""
	@echo "#########################################################"
192
	@echo "# CHECK YOU HAVE ALL THE NEEDED MODULES:"
193
194
	@echo "#    * Install or upgrade required perl modules. If you have cpanminus:"
	@echo "#        cpanm --installdeps --with-recommends ."
195
	@echo "#"
196
	@echo "# FIRST INSTALLATION:"
197
198
	@echo "#    * Edit this file to define initial configuration:"
	@echo "#        $(confdir)/sympa.conf"
199
	@echo "#"
200
201
	@echo "# UPGRADING"
	@echo "#    * Run this script to upgrade your data structures:"
IKEDA Soji's avatar
IKEDA Soji committed
202
	@echo "#        $(sbindir)/sympa upgrade"
olivier.salaun's avatar
olivier.salaun committed
203
	@echo "#######################################################"
204

205
uninstall-hook:
IKEDA Soji's avatar
IKEDA Soji committed
206
207
208
209
210
211
	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)
212

213
214
215
dist-hook:
	$(MAKE) check

IKEDA Soji's avatar
IKEDA Soji committed
216
217
218
distcheck-hook:
	-md5sum $(DIST_ARCHIVES) > $(DIST_ARCHIVES).md5
	-sha256sum $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sha256
IKEDA Soji's avatar
IKEDA Soji committed
219
	-openssl sha512 $(DIST_ARCHIVES) > $(DIST_ARCHIVES).sha512
IKEDA Soji's avatar
IKEDA Soji committed
220

221
# tidyall --conf-file xt/tidyallrc --root-dir . --recursive src t xt
Luc Didry's avatar
Luc Didry committed
222
tidyall:
223
224
	@ ( echo 'exit 1 if grep { $$_->error }'; \
	    echo 'Code::TidyAll->new_from_conf_file('; \
225
226
	    echo '  "xt/tidyallrc", root_dir => ".", recursive => 1'; \
	    echo ')->process_paths(qw(src t xt))' \
227
	) | $(PERL) -MCode::TidyAll
Luc Didry's avatar
Luc Didry committed
228