]> git.ipfire.org Git - people/stevee/network.git/blob - Makefile.am
Move config hooks into a separate directory
[people/stevee/network.git] / Makefile.am
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2012-2013 IPFire Network Development Team #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22 AM_MAKEFLAGS = --no-print-directory
23 AUTOMAKE_OPTIONS = color-tests
24
25 # remove target it the command fails
26 .DELETE_ON_ERROR:
27
28 # keep itermediate files
29 .SECONDARY:
30
31 libexecdir = $(prefix)/lib
32 pkgconfigdatadir = $(datadir)/pkgconfig
33 pppdir = $(sysconfdir)/ppp
34 sysctldir = $(prefix)/lib/sysctl.d
35 tmpfilesdir = $(prefix)/lib/tmpfiles.d
36 udevrulesdir = $(udevdir)/rules.d
37
38 networkdir = $(libexecdir)/network
39 helpersdir = $(networkdir)/helpers
40
41 macrosdir = $(libexecdir)/firewall/macros
42
43 hooksdir = $(networkdir)/hooks
44 hooks_configsdir = $(hooksdir)/configs
45 hooks_portsdir = $(hooksdir)/ports
46 hooks_zonesdir = $(hooksdir)/zones
47
48 CLEANFILES =
49 DISTCLEANFILES =
50 EXTRA_DIST =
51 INSTALL_DIRS =
52 INSTALL_EXEC_HOOKS =
53 UNINSTALL_EXEC_HOOKS =
54 noinst_DATA =
55
56 DISTCHECK_CONFIGURE_FLAGS = \
57 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
58 --with-udevdir=$$dc_install_base/$(udevdir)
59
60 install-directories-hook:
61 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
62
63 INSTALL_EXEC_HOOKS += \
64 install-directories-hook
65
66 # ------------------------------------------------------------------------------
67
68 AM_V_XSLT = $(AM_V_XSLT_$(V))
69 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
70 AM_V_XSLT_0 = @echo " XSLT " $@;
71
72 # ------------------------------------------------------------------------------
73
74 dist_doc_DATA = \
75 COPYING \
76 README
77
78 dist_sbin_SCRIPTS = \
79 src/dhclient-script \
80 src/firewall-config \
81 src/firewall4 \
82 src/firewall6 \
83 src/network
84
85 network_SCRIPTS = \
86 src/functions/functions
87
88 CLEANFILES += \
89 src/functions/functions
90
91 EXTRA_DIST += \
92 src/functions/functions.in
93
94 dist_network_SCRIPTS = \
95 src/functions/functions.aiccu \
96 src/functions/functions.at \
97 src/functions/functions.auth \
98 src/functions/functions.batman-adv \
99 src/functions/functions.bonding \
100 src/functions/functions.bridge \
101 src/functions/functions.cli \
102 src/functions/functions.cli.firewall \
103 src/functions/functions.colors \
104 src/functions/functions.config \
105 src/functions/functions.conntrack \
106 src/functions/functions.constants \
107 src/functions/functions.constants-firewall \
108 src/functions/functions.db \
109 src/functions/functions.device \
110 src/functions/functions.dhclient \
111 src/functions/functions.dhcpd \
112 src/functions/functions.distro \
113 src/functions/functions.dns \
114 src/functions/functions.dummy \
115 src/functions/functions.ethernet \
116 src/functions/functions.firewall \
117 src/functions/functions.firewall-policy \
118 src/functions/functions.firewall-zones \
119 src/functions/functions.he \
120 src/functions/functions.hook \
121 src/functions/functions.hostapd \
122 src/functions/functions.http \
123 src/functions/functions.ip \
124 src/functions/functions.iptables \
125 src/functions/functions.ip-tunnel \
126 src/functions/functions.ipv4 \
127 src/functions/functions.ipv6 \
128 src/functions/functions.isdn \
129 src/functions/functions.list \
130 src/functions/functions.lock \
131 src/functions/functions.logging \
132 src/functions/functions.macros \
133 src/functions/functions.macvlan \
134 src/functions/functions.modem \
135 src/functions/functions.phy \
136 src/functions/functions.ports \
137 src/functions/functions.ppp \
138 src/functions/functions.pppoe-server \
139 src/functions/functions.radvd \
140 src/functions/functions.red \
141 src/functions/functions.route \
142 src/functions/functions.routing \
143 src/functions/functions.serial \
144 src/functions/functions.service \
145 src/functions/functions.stp \
146 src/functions/functions.sysctl \
147 src/functions/functions.teredo \
148 src/functions/functions.usb \
149 src/functions/functions.util \
150 src/functions/functions.vlan \
151 src/functions/functions.wireless \
152 src/functions/functions.wpa_supplicant \
153 src/functions/functions.zone \
154 src/network-radvd-config \
155 src/dhclient-helper \
156 src/header-config \
157 src/header-port \
158 src/header-zone \
159 src/ppp/dialer \
160 src/ppp/pppoe-server
161
162 dist_helpers_SCRIPTS = \
163 src/helpers/aiccu-config-helper \
164 src/helpers/bridge-stp \
165 src/helpers/dhcpd-config-helper \
166 src/helpers/firewall-kernel-init \
167 src/helpers/hostapd-config-helper \
168 src/helpers/miredo-config-helper \
169 src/helpers/miredo-helper \
170 src/helpers/pppd-angel \
171 src/helpers/wpa_supplicant \
172 src/helpers/wpa_supplicant-config-helper
173
174 bridge-stp-install-hook: bridge-stp-uninstall-hook
175 ln -svf --relative $(DESTDIR)$(helpersdir)/bridge-stp $(DESTDIR)$(sbindir)/
176
177 bridge-stp-uninstall-hook:
178 rm -f $(DESTDIR)$(sbindir)/bridge-stp
179
180 INSTALL_EXEC_HOOKS += bridge-stp-install-hook
181 UNINSTALL_EXEC_HOOKS += bridge-stp-uninstall-hook
182
183 dist_hooks_configs_SCRIPTS = \
184 src/hooks/configs/ipv4-dhcp \
185 src/hooks/configs/ipv6-static \
186 src/hooks/configs/ipv4-static \
187 src/hooks/configs/pppoe-server
188
189 dist_hooks_ports_SCRIPTS = \
190 src/hooks/ports/batman-adv \
191 src/hooks/ports/batman-adv-port \
192 src/hooks/ports/bonding \
193 src/hooks/ports/dummy \
194 src/hooks/ports/ethernet \
195 src/hooks/ports/macvlan \
196 src/hooks/ports/vlan \
197 src/hooks/ports/wireless-ap
198
199 dist_hooks_zones_SCRIPTS = \
200 src/hooks/zones/6rd \
201 src/hooks/zones/6to4-tunnel \
202 src/hooks/zones/aiccu \
203 src/hooks/zones/bridge \
204 src/hooks/zones/isdn \
205 src/hooks/zones/isdn-server \
206 src/hooks/zones/modem \
207 src/hooks/zones/pppoe \
208 src/hooks/zones/pptp \
209 src/hooks/zones/teredo \
210 src/hooks/zones/wireless
211
212 # ------------------------------------------------------------------------------
213
214 ppp_SCRIPTS = \
215 src/ppp/ip-updown
216
217 CLEANFILES += \
218 src/ppp/ip-updown
219
220 EXTRA_DIST += \
221 src/ppp/ip-updown.in
222
223 INSTALL_DIRS += \
224 $(pppdir)
225
226 ppp-install-hook:
227 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
228 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
229 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
230 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
231 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
232
233 ppp-uninstall-hook:
234 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
235 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
236
237 INSTALL_EXEC_HOOKS += ppp-install-hook
238 UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
239
240 # ------------------------------------------------------------------------------
241
242 if HAVE_SYSTEMD
243 systemdsystemunit_DATA = \
244 src/systemd/firewall4.service \
245 src/systemd/firewall6.service \
246 src/systemd/firewall-init.service \
247 src/systemd/network-init.service \
248 src/systemd/network@.service
249
250 CLEANFILES += \
251 $(systemdsystemunit_DATA)
252
253 INSTALL_DIRS += \
254 $(systemdsystemunitdir)
255 endif
256
257 EXTRA_DIST += \
258 src/systemd/firewall4.service.in \
259 src/systemd/firewall6.service.in \
260 src/systemd/firewall-init.service.in \
261 src/systemd/network-init.service.in \
262 src/systemd/network@.service.in
263
264 # ------------------------------------------------------------------------------
265
266 dist_sysctl_DATA = \
267 src/sysctl/network.conf
268
269 # ------------------------------------------------------------------------------
270
271 dist_tmpfiles_DATA = \
272 src/tmpfiles/network
273
274 # ------------------------------------------------------------------------------
275
276 if HAVE_UDEV
277 dist_udev_SCRIPTS = \
278 src/udev/network-hotplug \
279 src/udev/network-hotplug-rename \
280 src/udev/network-hotplug-serial
281
282 dist_udevrules_DATA = \
283 src/udev/rules.d/50-serial-whitelist.rules \
284 src/udev/rules.d/60-net.rules
285
286 INSTALL_DIRS += \
287 $(udevdir) \
288 $(udevrulesdir)
289 endif
290
291 # ------------------------------------------------------------------------------
292
293 pkgconfigdata_DATA = \
294 src/network.pc
295
296 CLEANFILES += \
297 $(pkgconfigdata_DATA)
298
299 EXTRA_DIST += \
300 src/network.pc.in
301
302 # ------------------------------------------------------------------------------
303
304 dist_macros_DATA = \
305 src/macros/DHCP \
306 src/macros/HTTP \
307 src/macros/HTTPS \
308 src/macros/WWW
309
310 # ------------------------------------------------------------------------------
311
312 MANPAGES = \
313 man/firewall-config.8 \
314 man/network.8 \
315 man/network-config.8 \
316 man/network-device.8 \
317 man/network-dns-server.8 \
318 man/network-port-batman-adv.8 \
319 man/network-port-batman-adv-port.8 \
320 man/network-route.8 \
321 man/network-zone.8 \
322 man/network-zone-6rd.8 \
323 man/network-zone-6to4-tunnel.8 \
324 man/network-zone-aiccu.8 \
325 man/network-zone-bridge.8 \
326 man/network-zone-config-pppoe-server.8 \
327 man/network-zone-pppoe.8 \
328 man/network-zone-pptp.8
329
330 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES))
331 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
332
333 .PHONY: man
334 man: $(MANPAGES) $(MANPAGES_HTML)
335
336 man_MANS = \
337 $(MANPAGES)
338
339 noinst_DATA += \
340 $(MANPAGES_HTML)
341
342 CLEANFILES += \
343 $(man_MANS) \
344 $(MANPAGES_HTML)
345
346 EXTRA_DIST += \
347 $(MANPAGES_XML) \
348 man/custom-html.xsl
349
350 XSLTPROC_FLAGS = \
351 --nonet \
352 --stringparam man.output.quietly 1 \
353 --stringparam funcsynopsis.style ansi \
354 --stringparam man.th.extra1.suppress 1 \
355 --stringparam man.authors.section.enabled 1 \
356 --stringparam man.copyright.section.enabled 1
357
358 XSLTPROC_COMMAND_MAN = \
359 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
360 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
361
362 XSLTPROC_COMMAND_HTML = \
363 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
364
365 man/%.8: man/%.xml
366 $(XSLTPROC_COMMAND_MAN)
367
368 man/%.html: man/%.xml man/custom-html.xsl
369 $(XSLTPROC_COMMAND_HTML)
370
371 # ------------------------------------------------------------------------------
372
373 substitutions = \
374 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
375 '|PACKAGE_URL=$(PACKAGE_URL)|' \
376 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
377 '|prefix=$(prefix)|' \
378 '|exec_prefix=$(exec_prefix)|' \
379 '|sbindir=$(sbindir)|' \
380 '|networkdir=$(networkdir)|'
381
382 SED_PROCESS = \
383 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
384 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
385 < $< > $@
386
387 src/functions/functions: src/functions/functions.in Makefile
388 $(SED_PROCESS)
389
390 src/ppp/ip-updown: src/ppp/ip-updown.in Makefile
391 $(SED_PROCESS)
392
393 src/systemd/%: src/systemd/%.in Makefile
394 $(SED_PROCESS)
395
396 src/%.pc: src/%.pc.in Makefile
397 $(SED_PROCESS)
398
399 INSTALL_DIRS += \
400 $(sbindir)
401
402 install-exec-hook: $(INSTALL_EXEC_HOOKS)
403
404 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
405
406 # - testsuite ------------------------------------------------------------------
407
408 TESTS_ENVIRONMENT = \
409 topdir="$(shell pwd)" \
410 networkdir="$(top_srcdir)/src/functions"
411
412 dist_check_SCRIPTS = \
413 test/load-library
414
415 TESTS = \
416 test/load-library