]>
Commit | Line | Data |
---|---|---|
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 | configdir = $(sysconfdir)/network | |
32 | bashcompletiondir= $(datadir)/bash-completion/completions | |
33 | libexecdir = $(prefix)/lib | |
34 | pkgconfigdir = $(libdir)/pkgconfig | |
35 | pppdir = $(sysconfdir)/ppp | |
36 | systemconfigdir = $(datadir)/network | |
37 | sysctldir = $(prefix)/lib/sysctl.d | |
38 | tmpfilesdir = $(prefix)/lib/tmpfiles.d | |
39 | udevrulesdir = $(udevdir)/rules.d | |
40 | ||
41 | networkdir = $(libexecdir)/network | |
42 | helpersdir = $(networkdir)/helpers | |
43 | ||
44 | macrosdir = $(libexecdir)/firewall/macros | |
45 | ||
46 | hooksdir = $(networkdir)/hooks | |
47 | hooks_configsdir = $(hooksdir)/configs | |
48 | hooks_portsdir = $(hooksdir)/ports | |
49 | hooks_zonesdir = $(hooksdir)/zones | |
50 | ||
51 | triggersdir = $(networkdir)/triggers | |
52 | ||
53 | logdir = $(localestatedir)/log/network | |
54 | utildir = $(networkdir) | |
55 | ||
56 | CLEANFILES = | |
57 | DISTCLEANFILES = | |
58 | EXTRA_DIST = | |
59 | INSTALL_DIRS = | |
60 | INSTALL_EXEC_HOOKS = | |
61 | UNINSTALL_EXEC_HOOKS = | |
62 | noinst_DATA = | |
63 | ||
64 | AM_CPPFLAGS = \ | |
65 | $(OUR_CPPFLAGS) \ | |
66 | -include $(top_builddir)/config.h \ | |
67 | -I${top_srcdir}/src/libnetwork | |
68 | ||
69 | AM_CFLAGS = \ | |
70 | $(OUR_CFLAGS) \ | |
71 | -fvisibility=hidden \ | |
72 | -ffunction-sections \ | |
73 | -fdata-sections | |
74 | ||
75 | AM_LDFLAGS = \ | |
76 | $(OUR_LDFLAGS) \ | |
77 | -Wl,--gc-sections \ | |
78 | -Wl,--as-needed | |
79 | ||
80 | DISTCHECK_CONFIGURE_FLAGS = \ | |
81 | --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \ | |
82 | --with-udevdir=$$dc_install_base/$(udevdir) | |
83 | ||
84 | install-directories-hook: | |
85 | $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS)) | |
86 | ||
87 | INSTALL_EXEC_HOOKS += \ | |
88 | install-directories-hook | |
89 | ||
90 | # ------------------------------------------------------------------------------ | |
91 | ||
92 | AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V)) | |
93 | AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY)) | |
94 | AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@; | |
95 | ||
96 | AM_V_DOWNLOAD = $(AM_V_DOWNLOAD_$(V)) | |
97 | AM_V_DOWNLOAD_ = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY)) | |
98 | AM_V_DOWNLOAD_0 = @echo " LOAD " $@; | |
99 | ||
100 | AM_V_NITSI = $(AM_V_NITSI_$(V)) | |
101 | AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY)) | |
102 | AM_V_NITSI_0 = @echo " NITSI " $@; | |
103 | ||
104 | AM_V_XSLT = $(AM_V_XSLT_$(V)) | |
105 | AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY)) | |
106 | AM_V_XSLT_0 = @echo " XSLT " $@; | |
107 | ||
108 | # ------------------------------------------------------------------------------ | |
109 | ||
110 | dist_doc_DATA = \ | |
111 | README \ | |
112 | docs/CODING_STYLE \ | |
113 | docs/COPYING | |
114 | ||
115 | dist_sbin_SCRIPTS = \ | |
116 | src/dhclient-script \ | |
117 | src/firewall \ | |
118 | src/network | |
119 | ||
120 | network_DATA = \ | |
121 | src/functions/functions | |
122 | ||
123 | CLEANFILES += \ | |
124 | src/functions/functions | |
125 | ||
126 | EXTRA_DIST += \ | |
127 | src/functions/functions.in | |
128 | ||
129 | dist_network_DATA = \ | |
130 | src/functions/functions.at \ | |
131 | src/functions/functions.auth \ | |
132 | src/functions/functions.bird \ | |
133 | src/functions/functions.bonding \ | |
134 | src/functions/functions.bridge \ | |
135 | src/functions/functions.cli \ | |
136 | src/functions/functions.cli.firewall \ | |
137 | src/functions/functions.colors \ | |
138 | src/functions/functions.config \ | |
139 | src/functions/functions.conntrack \ | |
140 | src/functions/functions.constants \ | |
141 | src/functions/functions.constants-firewall \ | |
142 | src/functions/functions.db \ | |
143 | src/functions/functions.description \ | |
144 | src/functions/functions.device \ | |
145 | src/functions/functions.dhclient \ | |
146 | src/functions/functions.dhcpd \ | |
147 | src/functions/functions.distro \ | |
148 | src/functions/functions.dns \ | |
149 | src/functions/functions.dummy \ | |
150 | src/functions/functions.editor \ | |
151 | src/functions/functions.firewall \ | |
152 | src/functions/functions.firewall-policy \ | |
153 | src/functions/functions.firewall-zones \ | |
154 | src/functions/functions.he \ | |
155 | src/functions/functions.hook \ | |
156 | src/functions/functions.hostapd \ | |
157 | src/functions/functions.hotplug \ | |
158 | src/functions/functions.http \ | |
159 | src/functions/functions.interrupts \ | |
160 | src/functions/functions.ip \ | |
161 | src/functions/functions.ipsec \ | |
162 | src/functions/functions.ipsec-pool \ | |
163 | src/functions/functions.iptables \ | |
164 | src/functions/functions.ip-tunnel \ | |
165 | src/functions/functions.ipv4 \ | |
166 | src/functions/functions.ipv6 \ | |
167 | src/functions/functions.leds \ | |
168 | src/functions/functions.list \ | |
169 | src/functions/functions.lock \ | |
170 | src/functions/functions.logging \ | |
171 | src/functions/functions.macros \ | |
172 | src/functions/functions.modem \ | |
173 | src/functions/functions.offloading \ | |
174 | src/functions/functions.phy \ | |
175 | src/functions/functions.ports \ | |
176 | src/functions/functions.ppp \ | |
177 | src/functions/functions.pppoe-server \ | |
178 | src/functions/functions.route \ | |
179 | src/functions/functions.routing \ | |
180 | src/functions/functions.serial \ | |
181 | src/functions/functions.service \ | |
182 | src/functions/functions.settings \ | |
183 | src/functions/functions.stp \ | |
184 | src/functions/functions.sysctl \ | |
185 | src/functions/functions.system \ | |
186 | src/functions/functions.triggers \ | |
187 | src/functions/functions.usb \ | |
188 | src/functions/functions.util \ | |
189 | src/functions/functions.vlan \ | |
190 | src/functions/functions.vpn \ | |
191 | src/functions/functions.vpn-security-policies \ | |
192 | src/functions/functions.wireless \ | |
193 | src/functions/functions.wireless-mesh \ | |
194 | src/functions/functions.wireless-networks \ | |
195 | src/functions/functions.wpa_supplicant \ | |
196 | src/functions/functions.zone \ | |
197 | src/header-config \ | |
198 | src/header-port \ | |
199 | src/header-zone | |
200 | ||
201 | dist_network_SCRIPTS = \ | |
202 | src/dhclient-helper \ | |
203 | src/ppp/dialer \ | |
204 | src/ppp/pppoe-server | |
205 | ||
206 | dist_helpers_SCRIPTS = \ | |
207 | src/helpers/dhcpd-config-helper \ | |
208 | src/helpers/hostapd-config-helper \ | |
209 | src/helpers/ipsec-updown \ | |
210 | src/helpers/pppd-angel \ | |
211 | src/helpers/wpa_supplicant | |
212 | ||
213 | bin_PROGRAMS = \ | |
214 | src/inetcalc | |
215 | ||
216 | src_inetcalc_SOURCES = \ | |
217 | src/inetcalc.c | |
218 | ||
219 | src_inetcalc_LDADD = \ | |
220 | src/libnetwork.la | |
221 | ||
222 | dist_hooks_configs_SCRIPTS = \ | |
223 | src/hooks/configs/dhcp \ | |
224 | src/hooks/configs/ipv6-auto \ | |
225 | src/hooks/configs/pppoe-server \ | |
226 | src/hooks/configs/static | |
227 | ||
228 | dist_hooks_ports_SCRIPTS = \ | |
229 | src/hooks/ports/bonding \ | |
230 | src/hooks/ports/dummy \ | |
231 | src/hooks/ports/ethernet \ | |
232 | src/hooks/ports/ip-tunnel \ | |
233 | src/hooks/ports/vlan \ | |
234 | src/hooks/ports/wireless-ap \ | |
235 | src/hooks/ports/wireless-mesh | |
236 | ||
237 | dist_hooks_zones_SCRIPTS = \ | |
238 | src/hooks/zones/bridge \ | |
239 | src/hooks/zones/ip-tunnel \ | |
240 | src/hooks/zones/modem \ | |
241 | src/hooks/zones/pppoe \ | |
242 | src/hooks/zones/wireless | |
243 | ||
244 | INSTALL_DIRS += \ | |
245 | $(configdir) \ | |
246 | $(configdir)/ports \ | |
247 | $(configdir)/vpn \ | |
248 | $(configdir)/vpn/ipsec/connections \ | |
249 | $(configdir)/vpn/security-policies \ | |
250 | $(configdir)/wireless \ | |
251 | $(configdir)/wireless/networks \ | |
252 | $(configdir)/zones | |
253 | ||
254 | # ------------------------------------------------------------------------------ | |
255 | ||
256 | LIBNETWORK_CURRENT=0 | |
257 | LIBNETWORK_REVISION=0 | |
258 | LIBNETWORK_AGE=0 | |
259 | ||
260 | pkginclude_HEADERS = \ | |
261 | src/libnetwork/network/interface.h \ | |
262 | src/libnetwork/network/libnetwork.h \ | |
263 | src/libnetwork/network/logging.h \ | |
264 | src/libnetwork/network/phy.h | |
265 | ||
266 | lib_LTLIBRARIES = \ | |
267 | src/libnetwork.la | |
268 | ||
269 | src_libnetwork_la_SOURCES = \ | |
270 | src/libnetwork/interface.c \ | |
271 | src/libnetwork/libnetwork-private.h \ | |
272 | src/libnetwork/libnetwork.c \ | |
273 | src/libnetwork/phy.c | |
274 | ||
275 | src_libnetwork_la_LIBADD = \ | |
276 | $(LIBNL_LIBS) | |
277 | ||
278 | src_libnetwork_la_CPPFLAGS = \ | |
279 | $(AM_CPPFLAGS) \ | |
280 | $(LIBNL_CPPFLAGS) \ | |
281 | -D_GNU_SOURCE \ | |
282 | -DNETWORK_PRIVATE | |
283 | ||
284 | src_libnetwork_la_CFLAGS = \ | |
285 | $(AM_CFLAGS) \ | |
286 | $(LIBNL_CFLAGS) | |
287 | ||
288 | src_libnetwork_la_LDFLAGS = \ | |
289 | $(AM_LDFLAGS) \ | |
290 | -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \ | |
291 | -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym | |
292 | ||
293 | src_libnetwork_la_DEPENDENCIES = \ | |
294 | src/libnetwork/libnetwork.sym | |
295 | ||
296 | EXTRA_DIST += \ | |
297 | src/libnetwork/libnetwork.sym | |
298 | ||
299 | # ------------------------------------------------------------------------------ | |
300 | ||
301 | util_PROGRAMS = \ | |
302 | src/utils/network-phy-list-channels \ | |
303 | src/utils/network-phy-list-ciphers \ | |
304 | src/utils/network-phy-list-ht-caps \ | |
305 | src/utils/network-phy-list-vht-caps | |
306 | ||
307 | src_utils_network_phy_list_channels_SOURCES = \ | |
308 | src/utils/network-phy-list-channels.c | |
309 | ||
310 | src_utils_network_phy_list_channels_LDADD = \ | |
311 | src/libnetwork.la | |
312 | ||
313 | src_utils_network_phy_list_ciphers_SOURCES = \ | |
314 | src/utils/network-phy-list-ciphers.c | |
315 | ||
316 | src_utils_network_phy_list_ciphers_LDADD = \ | |
317 | src/libnetwork.la | |
318 | ||
319 | src_utils_network_phy_list_ht_caps_SOURCES = \ | |
320 | src/utils/network-phy-list-ht-caps.c | |
321 | ||
322 | src_utils_network_phy_list_ht_caps_LDADD = \ | |
323 | src/libnetwork.la | |
324 | ||
325 | src_utils_network_phy_list_vht_caps_SOURCES = \ | |
326 | src/utils/network-phy-list-vht-caps.c | |
327 | ||
328 | src_utils_network_phy_list_vht_caps_LDADD = \ | |
329 | src/libnetwork.la | |
330 | ||
331 | # ------------------------------------------------------------------------------ | |
332 | ||
333 | ppp_SCRIPTS = \ | |
334 | src/ppp/ip-updown | |
335 | ||
336 | CLEANFILES += \ | |
337 | src/ppp/ip-updown | |
338 | ||
339 | EXTRA_DIST += \ | |
340 | src/ppp/ip-updown.in | |
341 | ||
342 | INSTALL_DIRS += \ | |
343 | $(pppdir) \ | |
344 | $(logdir) | |
345 | ||
346 | ppp-install-hook: | |
347 | ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up | |
348 | ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up | |
349 | ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down | |
350 | ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up | |
351 | ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down | |
352 | ||
353 | ppp-uninstall-hook: | |
354 | rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up} | |
355 | rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up} | |
356 | ||
357 | INSTALL_EXEC_HOOKS += ppp-install-hook | |
358 | UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook | |
359 | ||
360 | # ------------------------------------------------------------------------------ | |
361 | ||
362 | if HAVE_SYSTEMD | |
363 | systemdsystemunit_DATA = \ | |
364 | src/systemd/firewall.service \ | |
365 | src/systemd/firewall-init.service \ | |
366 | src/systemd/network-init.service \ | |
367 | src/systemd/network@.service | |
368 | ||
369 | CLEANFILES += \ | |
370 | $(systemdsystemunit_DATA) | |
371 | ||
372 | INSTALL_DIRS += \ | |
373 | $(systemdsystemunitdir) | |
374 | endif | |
375 | ||
376 | EXTRA_DIST += \ | |
377 | src/systemd/firewall.service.in \ | |
378 | src/systemd/firewall-init.service.in \ | |
379 | src/systemd/network-init.service.in \ | |
380 | src/systemd/network@.service.in | |
381 | ||
382 | # ------------------------------------------------------------------------------ | |
383 | ||
384 | systemconfig_vpndir = $(systemconfigdir)/vpn | |
385 | ||
386 | dist_systemconfig_vpn_security_policies_DATA = \ | |
387 | config/vpn/security-policies/performance \ | |
388 | config/vpn/security-policies/system | |
389 | ||
390 | systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies | |
391 | ||
392 | # ------------------------------------------------------------------------------ | |
393 | ||
394 | dist_sysctl_DATA = \ | |
395 | src/sysctl/network.conf | |
396 | ||
397 | # ------------------------------------------------------------------------------ | |
398 | ||
399 | dist_bashcompletion_SCRIPTS = \ | |
400 | src/bash-completion/network | |
401 | ||
402 | # ------------------------------------------------------------------------------ | |
403 | ||
404 | dist_tmpfiles_DATA = \ | |
405 | src/tmpfiles/network.conf | |
406 | ||
407 | # ------------------------------------------------------------------------------ | |
408 | ||
409 | if HAVE_UDEV | |
410 | dist_udev_SCRIPTS = \ | |
411 | src/udev/network-hotplug \ | |
412 | src/udev/network-hotplug-rename \ | |
413 | src/udev/network-hotplug-serial | |
414 | ||
415 | dist_udevrules_DATA = \ | |
416 | src/udev/rules.d/50-serial-whitelist.rules \ | |
417 | src/udev/rules.d/60-net.rules | |
418 | ||
419 | INSTALL_DIRS += \ | |
420 | $(udevdir) \ | |
421 | $(udevrulesdir) | |
422 | endif | |
423 | ||
424 | # ------------------------------------------------------------------------------ | |
425 | ||
426 | pkgconfig_DATA = \ | |
427 | src/network.pc | |
428 | ||
429 | CLEANFILES += \ | |
430 | $(pkgconfig_DATA) | |
431 | ||
432 | EXTRA_DIST += \ | |
433 | src/network.pc.in | |
434 | ||
435 | # ------------------------------------------------------------------------------ | |
436 | ||
437 | dist_macros_DATA = \ | |
438 | src/macros/DHCP \ | |
439 | src/macros/HTTP \ | |
440 | src/macros/HTTPS \ | |
441 | src/macros/WWW | |
442 | ||
443 | # ------------------------------------------------------------------------------ | |
444 | ||
445 | INSTALL_DIRS += \ | |
446 | $(triggersdir) | |
447 | ||
448 | # ------------------------------------------------------------------------------ | |
449 | ||
450 | MANPAGES = \ | |
451 | man/firewall-settings.8 \ | |
452 | man/network.8 \ | |
453 | man/network-device.8 \ | |
454 | man/network-dhcp.8 \ | |
455 | man/network-dns-server.8 \ | |
456 | man/network-performance-tuning.8 \ | |
457 | man/network-port.8 \ | |
458 | man/network-quick-start.8 \ | |
459 | man/network-route.8 \ | |
460 | man/network-route-static.8 \ | |
461 | man/network-settings.8 \ | |
462 | man/network-vpn.8 \ | |
463 | man/network-vpn-ipsec.8 \ | |
464 | man/network-vpn-security-policies.8 \ | |
465 | man/network-zone.8 \ | |
466 | man/network-zone-bridge.8 \ | |
467 | man/network-zone-config-pppoe-server.8 \ | |
468 | man/network-zone-ip-tunnel.8 \ | |
469 | man/network-zone-modem.8 \ | |
470 | man/network-zone-pppoe.8 \ | |
471 | man/network-zone-wireless.8 | |
472 | ||
473 | EXTRA_DIST += \ | |
474 | man/include-color.txt \ | |
475 | man/include-description.txt | |
476 | ||
477 | MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES)) | |
478 | MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT)) | |
479 | MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT)) | |
480 | ||
481 | .PHONY: man | |
482 | man: $(MANPAGES) $(MANPAGES_HTML) | |
483 | ||
484 | if ENABLE_MANPAGES | |
485 | man_MANS = \ | |
486 | $(MANPAGES) | |
487 | endif | |
488 | ||
489 | CLEANFILES += \ | |
490 | $(MANPAGES) \ | |
491 | $(MANPAGES_HTML) \ | |
492 | $(MANPAGES_XML) | |
493 | ||
494 | EXTRA_DIST += \ | |
495 | man/asciidoc.conf \ | |
496 | $(MANPAGES_TXT) | |
497 | ||
498 | XSLTPROC_FLAGS = \ | |
499 | --nonet \ | |
500 | --stringparam man.output.quietly 1 \ | |
501 | --stringparam funcsynopsis.style ansi \ | |
502 | --stringparam man.th.extra1.suppress 1 \ | |
503 | --stringparam man.authors.section.enabled 1 \ | |
504 | --stringparam man.copyright.section.enabled 1 | |
505 | ||
506 | XSLTPROC_COMMAND_MAN = \ | |
507 | $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \ | |
508 | $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \ | |
509 | http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< | |
510 | ||
511 | man/%.xml: man/%.txt man/asciidoc.conf | |
512 | $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \ | |
513 | $(ASCIIDOC) \ | |
514 | -f $(abs_srcdir)/man/asciidoc.conf \ | |
515 | -d manpage -b docbook -o $@ $< | |
516 | ||
517 | man/%.8: man/%.xml | |
518 | $(XSLTPROC_COMMAND_MAN) | |
519 | ||
520 | man/%.html: man/%.txt man/asciidoc.conf | |
521 | $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \ | |
522 | $(ASCIIDOC) \ | |
523 | -f $(abs_srcdir)/man/asciidoc.conf \ | |
524 | -b html5 -a icons -a theme=flask -o $@ $< | |
525 | ||
526 | .PHONY: upload-man | |
527 | upload-man: $(MANPAGES_HTML) | |
528 | rsync -avHz --delete --progress $(MANPAGES_HTML) ms@people.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/ | |
529 | ||
530 | # ------------------------------------------------------------------------------ | |
531 | ||
532 | substitutions = \ | |
533 | '|PACKAGE_NAME=$(PACKAGE_NAME)|' \ | |
534 | '|PACKAGE_URL=$(PACKAGE_URL)|' \ | |
535 | '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \ | |
536 | '|builddir=$(abs_builddir)|' \ | |
537 | '|prefix=$(prefix)|' \ | |
538 | '|exec_prefix=$(exec_prefix)|' \ | |
539 | '|sbindir=$(sbindir)|' \ | |
540 | '|networkdir=$(networkdir)|' \ | |
541 | '|helpersdir=$(helpersdir)|' \ | |
542 | '|utildir=$(utildir)|' \ | |
543 | '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|' | |
544 | ||
545 | SED_PROCESS = \ | |
546 | $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ | |
547 | $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ | |
548 | < $< > $@ | |
549 | ||
550 | %: %.in Makefile | |
551 | $(SED_PROCESS) | |
552 | ||
553 | INSTALL_DIRS += \ | |
554 | $(sbindir) | |
555 | ||
556 | install-exec-hook: $(INSTALL_EXEC_HOOKS) | |
557 | ||
558 | uninstall-hook: $(UNINSTALL_EXEC_HOOKS) | |
559 | ||
560 | # - testsuite ------------------------------------------------------------------ | |
561 | ||
562 | TESTS_ENVIRONMENT = \ | |
563 | LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \ | |
564 | PATH=$(top_builddir)/src:$(PATH) \ | |
565 | functions=$(abs_builddir)/src/functions/functions \ | |
566 | networkdir=$(abs_srcdir)/src/functions \ | |
567 | testdir=$(top_srcdir)/test | |
568 | ||
569 | dist_check_DATA = \ | |
570 | test/constants.sh \ | |
571 | test/test-functions | |
572 | ||
573 | dist_check_SCRIPTS = \ | |
574 | $(TESTS) | |
575 | ||
576 | TESTS = \ | |
577 | test/load-library \ | |
578 | test/functions/ip/ip_detect_protocol \ | |
579 | test/functions/ip/ip_get_prefix \ | |
580 | test/functions/ip/ip_net_is_valid \ | |
581 | test/functions/ip/ip_is_valid \ | |
582 | test/functions/ip/ip_network_is_subnet_of \ | |
583 | test/functions/ip/ip_prefix_is_valid \ | |
584 | test/functions/ip/ip_protocol_is_supported \ | |
585 | test/functions/ip/ip_split_prefix | |
586 | ||
587 | # - NITSI tests ---------------------------------------------------------------- | |
588 | ||
589 | # Files for the virtual environment | |
590 | VIRTUAL_ENVIRONMENT_FILES = \ | |
591 | test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ | |
592 | test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ | |
593 | test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ | |
594 | test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ | |
595 | test/nitsi/virtual-environment/basic/network/network1/network.xml \ | |
596 | test/nitsi/virtual-environment/basic/network/network2/network.xml \ | |
597 | test/nitsi/virtual-environment/basic/network/network3/network.xml \ | |
598 | test/nitsi/virtual-environment/basic/network/network4/network.xml \ | |
599 | test/nitsi/virtual-environment/basic/settings | |
600 | ||
601 | EXTRA_DIST += \ | |
602 | test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \ | |
603 | test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \ | |
604 | test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \ | |
605 | test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \ | |
606 | test/nitsi/virtual-environment/basic/settings.in | |
607 | ||
608 | CLEANFILES += \ | |
609 | test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ | |
610 | test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ | |
611 | test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ | |
612 | test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ | |
613 | test/nitsi/virtual-environment/basic/settings | |
614 | ||
615 | # Virtual Machine Images | |
616 | VIRTUAL_ENVIRONMENT_IMAGES = \ | |
617 | $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \ | |
618 | $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2 | |
619 | ||
620 | DISTCLEANFILES += \ | |
621 | $(VIRTUAL_ENVIRONMENT_IMAGES) | |
622 | ||
623 | VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images | |
624 | VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \ | |
625 | https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/ | |
626 | ||
627 | NITSI_INCLUDE_RECIPES = \ | |
628 | test/nitsi/include/setup | |
629 | ||
630 | EXTRA_DIST += \ | |
631 | test/nitsi/include/setup.in | |
632 | ||
633 | CLEANFILES += \ | |
634 | test/nitsi/include/setup | |
635 | ||
636 | NITSI_TESTS = \ | |
637 | test/nitsi/test/make-check \ | |
638 | test/nitsi/test/phase1 \ | |
639 | test/nitsi/test/pppoe \ | |
640 | test/nitsi/test/raw-device-get-by-mac \ | |
641 | test/nitsi/test/zone-new-bridge \ | |
642 | test/nitsi/test/zone-port-attach-bridge \ | |
643 | test/nitsi/test/zone/ip-tunnel/gre6 \ | |
644 | test/nitsi/test/zone/ip-tunnel/gre4 \ | |
645 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4 \ | |
646 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6 \ | |
647 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4 \ | |
648 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6 \ | |
649 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4 \ | |
650 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6 \ | |
651 | test/nitsi/test/port-vlan | |
652 | ||
653 | EXTRA_DIST += \ | |
654 | test/nitsi/test/settings.in \ | |
655 | test/nitsi/test/make-check/recipe.in \ | |
656 | test/nitsi/test/make-check/settings.in \ | |
657 | test/nitsi/test/raw-device-get-by-mac/recipe \ | |
658 | test/nitsi/test/raw-device-get-by-mac/settings.in \ | |
659 | test/nitsi/test/zone-new-bridge/recipe \ | |
660 | test/nitsi/test/zone-new-bridge/settings.in \ | |
661 | test/nitsi/test/zone-port-attach-bridge/recipe \ | |
662 | test/nitsi/test/zone-port-attach-bridge/settings.in \ | |
663 | test/nitsi/test/zone/ip-tunnel/gre6/recipe \ | |
664 | test/nitsi/test/zone/ip-tunnel/gre6/settings \ | |
665 | test/nitsi/test/zone/ip-tunnel/gre4/recipe \ | |
666 | test/nitsi/test/zone/ip-tunnel/gre4/settings \ | |
667 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/recipe \ | |
668 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/settings \ | |
669 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/recipe \ | |
670 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/settings \ | |
671 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/recipe \ | |
672 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/settings \ | |
673 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/recipe \ | |
674 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/settings \ | |
675 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/recipe \ | |
676 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/settings \ | |
677 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/recipe \ | |
678 | test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/settings \ | |
679 | test/nitsi/test/port-vlan/recipe \ | |
680 | test/nitsi/test/port-vlan/settings | |
681 | ||
682 | CLEANFILES += \ | |
683 | test/nitsi/test/settings \ | |
684 | test/nitsi/test/make-check/recipe \ | |
685 | test/nitsi/test/make-check/settings \ | |
686 | test/nitsi/test/raw-device-get-by-mac/settings \ | |
687 | test/nitsi/test/zone-new-bridge/settings \ | |
688 | test/nitsi/test/zone-port-attach-bridge/settings | |
689 | ||
690 | NITSI_ENVIRONMENT = | |
691 | ||
692 | .PHONY: $(NITSI_TESTS) | |
693 | $(NITSI_TESTS): % : dist %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES) | |
694 | $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ \ | |
695 | --default-settings $(abs_builddir)/test/nitsi/test/settings --interactive-error-handling | |
696 | ||
697 | .PHONY: nitsi | |
698 | nitsi: $(NITSI_TESTS) | |
699 | ||
700 | # Downloads a virtual image file and extracts it | |
701 | $(VIRTUAL_ENVIRONMENT_IMAGES): | |
702 | $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \ | |
703 | $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@ |