]> git.ipfire.org Git - network.git/blame - Makefile.am
networkd: Collect stats regulary and emit them on dbus
[network.git] / Makefile.am
CommitLineData
5ca9dc30
MT
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
21ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22AM_MAKEFLAGS = --no-print-directory
23AUTOMAKE_OPTIONS = color-tests
24
25# remove target it the command fails
26.DELETE_ON_ERROR:
27
28# keep itermediate files
29.SECONDARY:
30
f166708b 31configdir = $(sysconfdir)/network
bae37360 32bashcompletiondir= $(datadir)/bash-completion/completions
5ca9dc30 33libexecdir = $(prefix)/lib
ea4abb82 34modprobedir = $(prefix)/lib/modprobe.d
01f2b2e4 35pkgconfigdir = $(libdir)/pkgconfig
5ca9dc30 36pppdir = $(sysconfdir)/ppp
5e84cd41 37systemconfigdir = $(datadir)/network
5ca9dc30
MT
38sysctldir = $(prefix)/lib/sysctl.d
39tmpfilesdir = $(prefix)/lib/tmpfiles.d
40udevrulesdir = $(udevdir)/rules.d
41
42networkdir = $(libexecdir)/network
43helpersdir = $(networkdir)/helpers
44
45macrosdir = $(libexecdir)/firewall/macros
46
47hooksdir = $(networkdir)/hooks
7d2cb6d3 48hooks_configsdir = $(hooksdir)/configs
5ca9dc30
MT
49hooks_portsdir = $(hooksdir)/ports
50hooks_zonesdir = $(hooksdir)/zones
51
de3cecef
MT
52triggersdir = $(networkdir)/triggers
53
9c9d0585 54logdir = $(localestatedir)/log/network
e145b2f3 55utildir = $(networkdir)
9c9d0585 56
5ca9dc30
MT
57CLEANFILES =
58DISTCLEANFILES =
59EXTRA_DIST =
60INSTALL_DIRS =
61INSTALL_EXEC_HOOKS =
62UNINSTALL_EXEC_HOOKS =
63noinst_DATA =
ac0188ee 64network_PROGRAMS =
d5fab986
MT
65dist_dbuspolicy_DATA =
66dist_dbussystembus_DATA =
bf98bd65 67dist_polkitpolicy_DATA =
5d968c01 68systemdsystemunit_DATA =
5ca9dc30 69
01f2b2e4
MT
70AM_CPPFLAGS = \
71 $(OUR_CPPFLAGS) \
72 -include $(top_builddir)/config.h \
73 -I${top_srcdir}/src/libnetwork
74
75AM_CFLAGS = \
76 $(OUR_CFLAGS) \
77 -fvisibility=hidden \
78 -ffunction-sections \
79 -fdata-sections
80
81AM_LDFLAGS = \
82 $(OUR_LDFLAGS) \
83 -Wl,--gc-sections \
84 -Wl,--as-needed
e708653f 85
5ca9dc30
MT
86DISTCHECK_CONFIGURE_FLAGS = \
87 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
88 --with-udevdir=$$dc_install_base/$(udevdir)
89
90install-directories-hook:
91 $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
92
93INSTALL_EXEC_HOOKS += \
94 install-directories-hook
95
96# ------------------------------------------------------------------------------
97
8f591cfc
MT
98AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
99AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
100AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
101
c4966dd6
MT
102AM_V_DOWNLOAD = $(AM_V_DOWNLOAD_$(V))
103AM_V_DOWNLOAD_ = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY))
104AM_V_DOWNLOAD_0 = @echo " LOAD " $@;
105
1908d2b3
MT
106AM_V_NITSI = $(AM_V_NITSI_$(V))
107AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY))
108AM_V_NITSI_0 = @echo " NITSI " $@;
109
5ca9dc30
MT
110AM_V_XSLT = $(AM_V_XSLT_$(V))
111AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
112AM_V_XSLT_0 = @echo " XSLT " $@;
113
114# ------------------------------------------------------------------------------
115
116dist_doc_DATA = \
1337eee2 117 README \
dd46582c 118 docs/CODING_STYLE \
1337eee2 119 docs/COPYING
5ca9dc30
MT
120
121dist_sbin_SCRIPTS = \
122 src/dhclient-script \
0c5d22de 123 src/firewall \
5ca9dc30
MT
124 src/network
125
a62e991a 126network_DATA = \
5ca9dc30
MT
127 src/functions/functions
128
129CLEANFILES += \
130 src/functions/functions
131
132EXTRA_DIST += \
133 src/functions/functions.in
134
a62e991a 135dist_network_DATA = \
5ca9dc30
MT
136 src/functions/functions.at \
137 src/functions/functions.auth \
6a1b0fb1 138 src/functions/functions.bird \
5ca9dc30
MT
139 src/functions/functions.bonding \
140 src/functions/functions.bridge \
141 src/functions/functions.cli \
142 src/functions/functions.cli.firewall \
143 src/functions/functions.colors \
144 src/functions/functions.config \
145 src/functions/functions.conntrack \
146 src/functions/functions.constants \
147 src/functions/functions.constants-firewall \
148 src/functions/functions.db \
5ccc7299 149 src/functions/functions.description \
5ca9dc30
MT
150 src/functions/functions.device \
151 src/functions/functions.dhclient \
152 src/functions/functions.dhcpd \
153 src/functions/functions.distro \
154 src/functions/functions.dns \
155 src/functions/functions.dummy \
e524986c 156 src/functions/functions.editor \
5ca9dc30
MT
157 src/functions/functions.firewall \
158 src/functions/functions.firewall-policy \
159 src/functions/functions.firewall-zones \
160 src/functions/functions.he \
161 src/functions/functions.hook \
162 src/functions/functions.hostapd \
b8026986 163 src/functions/functions.hotplug \
5ca9dc30 164 src/functions/functions.http \
de72bd91 165 src/functions/functions.interrupts \
5ca9dc30 166 src/functions/functions.ip \
be844b7b 167 src/functions/functions.ipsec \
4e78b7ad 168 src/functions/functions.ipsec-pool \
5ca9dc30
MT
169 src/functions/functions.iptables \
170 src/functions/functions.ip-tunnel \
171 src/functions/functions.ipv4 \
172 src/functions/functions.ipv6 \
208f7452 173 src/functions/functions.leds \
5ca9dc30
MT
174 src/functions/functions.list \
175 src/functions/functions.lock \
176 src/functions/functions.logging \
177 src/functions/functions.macros \
5ca9dc30 178 src/functions/functions.modem \
3608f641 179 src/functions/functions.offloading \
5ca9dc30
MT
180 src/functions/functions.phy \
181 src/functions/functions.ports \
182 src/functions/functions.ppp \
183 src/functions/functions.pppoe-server \
5ca9dc30
MT
184 src/functions/functions.route \
185 src/functions/functions.routing \
186 src/functions/functions.serial \
187 src/functions/functions.service \
e9df08ad 188 src/functions/functions.settings \
5ca9dc30 189 src/functions/functions.stp \
5ca9dc30 190 src/functions/functions.sysctl \
de72bd91 191 src/functions/functions.system \
de3cecef 192 src/functions/functions.triggers \
5ca9dc30
MT
193 src/functions/functions.usb \
194 src/functions/functions.util \
195 src/functions/functions.vlan \
2da98f56 196 src/functions/functions.vpn \
3eae7bed 197 src/functions/functions.vpn-security-policies \
5ca9dc30 198 src/functions/functions.wireless \
81bf9898 199 src/functions/functions.wireless-mesh \
49958b8c 200 src/functions/functions.wireless-networks \
5ca9dc30
MT
201 src/functions/functions.wpa_supplicant \
202 src/functions/functions.zone \
5ca9dc30
MT
203 src/header-config \
204 src/header-port \
f9217f83 205 src/header-zone
5ca9dc30 206
b719b3f7 207dist_network_SCRIPTS = \
f9217f83
MT
208 src/dhclient-helper \
209 src/ppp/dialer \
210 src/ppp/pppoe-server
b719b3f7 211
5ca9dc30 212dist_helpers_SCRIPTS = \
5ca9dc30 213 src/helpers/dhcpd-config-helper \
5ca9dc30 214 src/helpers/hostapd-config-helper \
67baa452 215 src/helpers/ipsec-updown \
5ca9dc30 216 src/helpers/pppd-angel \
02807ad2 217 src/helpers/wpa_supplicant
5ca9dc30 218
13a6e69f
MT
219bin_PROGRAMS = \
220 src/inetcalc
221
222src_inetcalc_SOURCES = \
223 src/inetcalc.c
224
01f2b2e4
MT
225src_inetcalc_LDADD = \
226 src/libnetwork.la
227
7d2cb6d3 228dist_hooks_configs_SCRIPTS = \
9353a4e4 229 src/hooks/configs/dhcp \
b73e9d43 230 src/hooks/configs/ipv6-auto \
46a28dcd
MT
231 src/hooks/configs/pppoe-server \
232 src/hooks/configs/static
7d2cb6d3 233
5ca9dc30 234dist_hooks_ports_SCRIPTS = \
5ca9dc30
MT
235 src/hooks/ports/bonding \
236 src/hooks/ports/dummy \
237 src/hooks/ports/ethernet \
8032884d 238 src/hooks/ports/ip-tunnel \
5ca9dc30 239 src/hooks/ports/vlan \
727248f0
MT
240 src/hooks/ports/wireless-ap \
241 src/hooks/ports/wireless-mesh
5ca9dc30
MT
242
243dist_hooks_zones_SCRIPTS = \
5ca9dc30 244 src/hooks/zones/bridge \
85de251d 245 src/hooks/zones/ip-tunnel \
5ca9dc30
MT
246 src/hooks/zones/modem \
247 src/hooks/zones/pppoe \
5ca9dc30
MT
248 src/hooks/zones/wireless
249
f166708b
MT
250INSTALL_DIRS += \
251 $(configdir) \
252 $(configdir)/ports \
253 $(configdir)/vpn \
254 $(configdir)/vpn/ipsec/connections \
255 $(configdir)/vpn/security-policies \
256 $(configdir)/wireless \
257 $(configdir)/wireless/networks \
258 $(configdir)/zones
259
5ca9dc30
MT
260# ------------------------------------------------------------------------------
261
01f2b2e4
MT
262LIBNETWORK_CURRENT=0
263LIBNETWORK_REVISION=0
264LIBNETWORK_AGE=0
265
266pkginclude_HEADERS = \
248629ae 267 src/libnetwork/network/interface.h \
6f4814db 268 src/libnetwork/network/libnetwork.h \
9cb2f0c0
MT
269 src/libnetwork/network/logging.h \
270 src/libnetwork/network/phy.h
01f2b2e4
MT
271
272lib_LTLIBRARIES = \
273 src/libnetwork.la
274
275src_libnetwork_la_SOURCES = \
248629ae 276 src/libnetwork/interface.c \
01f2b2e4 277 src/libnetwork/libnetwork-private.h \
9cb2f0c0
MT
278 src/libnetwork/libnetwork.c \
279 src/libnetwork/phy.c
01f2b2e4 280
db0a2d76
MT
281src_libnetwork_la_LIBADD = \
282 $(LIBNL_LIBS)
283
6f4814db
MT
284src_libnetwork_la_CPPFLAGS = \
285 $(AM_CPPFLAGS) \
db0a2d76 286 $(LIBNL_CPPFLAGS) \
6f4814db
MT
287 -D_GNU_SOURCE \
288 -DNETWORK_PRIVATE
289
db0a2d76
MT
290src_libnetwork_la_CFLAGS = \
291 $(AM_CFLAGS) \
292 $(LIBNL_CFLAGS)
293
01f2b2e4
MT
294src_libnetwork_la_LDFLAGS = \
295 $(AM_LDFLAGS) \
296 -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \
297 -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym
298
299src_libnetwork_la_DEPENDENCIES = \
300 src/libnetwork/libnetwork.sym
301
302EXTRA_DIST += \
303 src/libnetwork/libnetwork.sym
304
305# ------------------------------------------------------------------------------
050f4ece 306
ac0188ee 307network_PROGRAMS += \
050f4ece
MT
308 networkd
309
310dist_networkd_SOURCES = \
2e7f4705 311 src/networkd/address.h \
09a6af17
MT
312 src/networkd/bus.c \
313 src/networkd/bus.h \
6b666d62
MT
314 src/networkd/config.c \
315 src/networkd/config.h \
112358f3
MT
316 src/networkd/daemon.c \
317 src/networkd/daemon.h \
d6edaf63
MT
318 src/networkd/daemon-bus.c \
319 src/networkd/daemon-bus.h \
b286cd83
MT
320 src/networkd/devmon.c \
321 src/networkd/devmon.h \
87a1e1e0
MT
322 src/networkd/link.c \
323 src/networkd/link.h \
18b8c841
MT
324 src/networkd/links.c \
325 src/networkd/links.h \
1a70a686 326 src/networkd/logging.c \
c251a9dd 327 src/networkd/logging.h \
4237caa2 328 src/networkd/main.c \
b8db2713
MT
329 src/networkd/ports.c \
330 src/networkd/ports.h \
7297ba7f
MT
331 src/networkd/port.c \
332 src/networkd/port.h \
333 src/networkd/port-bus.c \
334 src/networkd/port-bus.h \
15240e08
MT
335 src/networkd/stats-collector.c \
336 src/networkd/stats-collector.h \
e4eebc6e 337 src/networkd/string.h \
c791afc8
MT
338 src/networkd/util.c \
339 src/networkd/util.h \
0c8e7342
MT
340 src/networkd/zones.c \
341 src/networkd/zones.h \
e4eebc6e 342 src/networkd/zone.c \
ed00ef20
MT
343 src/networkd/zone.h \
344 src/networkd/zone-bus.c \
345 src/networkd/zone-bus.h
050f4ece
MT
346
347networkd_CPPFLAGS = \
5c1452a4
MT
348 $(AM_CPPFLAGS) \
349 -DCONFIG_DIR="\"$(configdir)\""
050f4ece
MT
350
351networkd_CFLAGS = \
5d326bbb 352 $(AM_CFLAGS) \
dabf344d 353 $(CAP_CFLAGS) \
5d326bbb 354 $(SYSTEMD_CFLAGS)
050f4ece
MT
355
356networkd_LDFLAGS = \
357 $(AM_LDFLAGS)
358
5d326bbb 359networkd_LDADD = \
b53b186e 360 src/libnetwork.la \
dabf344d 361 $(CAP_LIBS) \
5d326bbb
MT
362 $(SYSTEMD_LIBS)
363
d5fab986
MT
364dist_dbuspolicy_DATA += \
365 src/networkd/org.ipfire.network1.conf
366
367dist_dbussystembus_DATA += \
063eb4d8
MT
368 src/networkd/org.ipfire.network1.service
369
bf98bd65
MT
370dist_polkitpolicy_DATA += \
371 src/networkd/org.ipfire.network1.policy
372
5d968c01
MT
373systemdsystemunit_DATA += \
374 src/networkd/networkd.service
375
376EXTRA_DIST += \
377 src/networkd/networkd.service.in
378
379CLEANFILES += \
380 src/networkd/networkd.service
381
050f4ece 382# ------------------------------------------------------------------------------
e145b2f3 383
840738f6
MT
384bin_PROGRAMS += \
385 networkctl
386
387dist_networkctl_SOURCES = \
f3bb976c
MT
388 src/networkctl/command.c \
389 src/networkctl/command.h \
537fae0b
MT
390 src/networkctl/main.c \
391 src/networkctl/zone.c \
392 src/networkctl/zone.h
840738f6
MT
393
394networkctl_CFLAGS = \
395 $(AM_CFLAGS) \
396 $(SYSTEMD_CFLAGS)
397
398networkctl_LDFLAGS = \
399 $(AM_LDFLAGS)
400
401networkctl_LDADD = \
402 $(SYSTEMD_LIBS)
403
404# ------------------------------------------------------------------------------
405
e145b2f3 406util_PROGRAMS = \
394cff53 407 src/utils/network-phy-list-channels \
2e4e3c88 408 src/utils/network-phy-list-ciphers \
b2323e58
MT
409 src/utils/network-phy-list-ht-caps \
410 src/utils/network-phy-list-vht-caps
e145b2f3 411
394cff53
MT
412src_utils_network_phy_list_channels_SOURCES = \
413 src/utils/network-phy-list-channels.c
414
415src_utils_network_phy_list_channels_LDADD = \
416 src/libnetwork.la
417
2e4e3c88
MT
418src_utils_network_phy_list_ciphers_SOURCES = \
419 src/utils/network-phy-list-ciphers.c
420
421src_utils_network_phy_list_ciphers_LDADD = \
422 src/libnetwork.la
423
e145b2f3
MT
424src_utils_network_phy_list_ht_caps_SOURCES = \
425 src/utils/network-phy-list-ht-caps.c
426
427src_utils_network_phy_list_ht_caps_LDADD = \
428 src/libnetwork.la
429
b2323e58
MT
430src_utils_network_phy_list_vht_caps_SOURCES = \
431 src/utils/network-phy-list-vht-caps.c
432
433src_utils_network_phy_list_vht_caps_LDADD = \
434 src/libnetwork.la
435
e145b2f3 436# ------------------------------------------------------------------------------
01f2b2e4 437
5ca9dc30
MT
438ppp_SCRIPTS = \
439 src/ppp/ip-updown
440
441CLEANFILES += \
442 src/ppp/ip-updown
443
444EXTRA_DIST += \
445 src/ppp/ip-updown.in
446
447INSTALL_DIRS += \
9c9d0585
SS
448 $(pppdir) \
449 $(logdir)
5ca9dc30
MT
450
451ppp-install-hook:
452 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up
453 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-up
454 ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-down
455 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-up
456 ln -svf ip-updown $(DESTDIR)$(pppdir)/ipv6-down
457
458ppp-uninstall-hook:
459 rm -f $(DESTDIR)$(pppdir)/ip-{down,pre-up,up}
460 rm -f $(DESTDIR)$(pppdir)/ipv6-{down,up}
461
462INSTALL_EXEC_HOOKS += ppp-install-hook
463UNINSTALL_EXEC_HOOKS += ppp-uninstall-hook
464
465# ------------------------------------------------------------------------------
466
467if HAVE_SYSTEMD
5d968c01 468systemdsystemunit_DATA += \
67131768 469 src/systemd/firewall.service \
5ca9dc30
MT
470 src/systemd/firewall-init.service \
471 src/systemd/network-init.service \
472 src/systemd/network@.service
473
474CLEANFILES += \
475 $(systemdsystemunit_DATA)
476
477INSTALL_DIRS += \
478 $(systemdsystemunitdir)
479endif
480
481EXTRA_DIST += \
b41f1f86 482 src/systemd/firewall.service.in \
5ca9dc30
MT
483 src/systemd/firewall-init.service.in \
484 src/systemd/network-init.service.in \
485 src/systemd/network@.service.in
486
487# ------------------------------------------------------------------------------
488
5e84cd41
MT
489systemconfig_vpndir = $(systemconfigdir)/vpn
490
491dist_systemconfig_vpn_security_policies_DATA = \
56d5efa7 492 config/vpn/security-policies/performance \
5e84cd41
MT
493 config/vpn/security-policies/system
494
495systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies
496
497# ------------------------------------------------------------------------------
498
5ca9dc30
MT
499dist_sysctl_DATA = \
500 src/sysctl/network.conf
501
502# ------------------------------------------------------------------------------
503
ea4abb82
MT
504dist_modprobe_DATA = \
505 src/modprobe.d/no-copybreak.conf
506
507# ------------------------------------------------------------------------------
508
bae37360
MT
509dist_bashcompletion_SCRIPTS = \
510 src/bash-completion/network
511
512# ------------------------------------------------------------------------------
513
5ca9dc30 514dist_tmpfiles_DATA = \
f9dac5a0 515 src/tmpfiles/network.conf
5ca9dc30
MT
516
517# ------------------------------------------------------------------------------
518
519if HAVE_UDEV
520dist_udev_SCRIPTS = \
521 src/udev/network-hotplug \
522 src/udev/network-hotplug-rename \
523 src/udev/network-hotplug-serial
524
525dist_udevrules_DATA = \
526 src/udev/rules.d/50-serial-whitelist.rules \
527 src/udev/rules.d/60-net.rules
528
529INSTALL_DIRS += \
530 $(udevdir) \
531 $(udevrulesdir)
532endif
533
534# ------------------------------------------------------------------------------
535
01f2b2e4 536pkgconfig_DATA = \
5ca9dc30
MT
537 src/network.pc
538
539CLEANFILES += \
01f2b2e4 540 $(pkgconfig_DATA)
5ca9dc30
MT
541
542EXTRA_DIST += \
543 src/network.pc.in
544
545# ------------------------------------------------------------------------------
546
547dist_macros_DATA = \
548 src/macros/DHCP \
549 src/macros/HTTP \
550 src/macros/HTTPS \
551 src/macros/WWW
552
553# ------------------------------------------------------------------------------
554
ec3fe5b7 555INSTALL_DIRS += \
de3cecef
MT
556 $(triggersdir)
557
558# ------------------------------------------------------------------------------
559
5ca9dc30 560MANPAGES = \
2b0ff832 561 man/firewall-settings.8 \
5ca9dc30 562 man/network.8 \
5ca9dc30 563 man/network-device.8 \
427f5ae2 564 man/network-dhcp.8 \
5ca9dc30 565 man/network-dns-server.8 \
de72bd91 566 man/network-performance-tuning.8 \
7a302fa7 567 man/network-port.8 \
94eab754 568 man/network-quick-start.8 \
5ca9dc30 569 man/network-route.8 \
e023191b 570 man/network-route-static.8 \
2b0ff832 571 man/network-settings.8 \
bec94f95 572 man/network-vpn.8 \
2612a6f4 573 man/network-vpn-ipsec.8 \
bec94f95 574 man/network-vpn-security-policies.8 \
5ca9dc30 575 man/network-zone.8 \
5ca9dc30
MT
576 man/network-zone-bridge.8 \
577 man/network-zone-config-pppoe-server.8 \
bd767a3e 578 man/network-zone-ip-tunnel.8 \
7a302fa7 579 man/network-zone-modem.8 \
2fb7ae4d
MT
580 man/network-zone-pppoe.8 \
581 man/network-zone-wireless.8
5ca9dc30 582
ff435238
MT
583EXTRA_DIST += \
584 man/include-color.txt \
585 man/include-description.txt
586
8f591cfc 587MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES))
d746901b
MT
588MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
589MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
5ca9dc30
MT
590
591.PHONY: man
592man: $(MANPAGES) $(MANPAGES_HTML)
593
dbe28a05 594if ENABLE_MANPAGES
5ca9dc30
MT
595man_MANS = \
596 $(MANPAGES)
dbe28a05 597endif
5ca9dc30 598
5ca9dc30 599CLEANFILES += \
dbe28a05 600 $(MANPAGES) \
d746901b
MT
601 $(MANPAGES_HTML) \
602 $(MANPAGES_XML)
5ca9dc30
MT
603
604EXTRA_DIST += \
5d881996 605 man/asciidoc.conf \
a7d2fef7 606 $(MANPAGES_TXT)
5ca9dc30
MT
607
608XSLTPROC_FLAGS = \
609 --nonet \
610 --stringparam man.output.quietly 1 \
611 --stringparam funcsynopsis.style ansi \
612 --stringparam man.th.extra1.suppress 1 \
613 --stringparam man.authors.section.enabled 1 \
614 --stringparam man.copyright.section.enabled 1
615
616XSLTPROC_COMMAND_MAN = \
5d881996
MT
617 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
618 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
5ca9dc30
MT
619 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
620
baf429f1 621man/%.xml: man/%.txt man/asciidoc.conf
5d881996
MT
622 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
623 $(ASCIIDOC) \
624 -f $(abs_srcdir)/man/asciidoc.conf \
baf429f1 625 -d manpage -b docbook -o $@ $<
8f591cfc 626
5ca9dc30
MT
627man/%.8: man/%.xml
628 $(XSLTPROC_COMMAND_MAN)
629
baf429f1 630man/%.html: man/%.txt man/asciidoc.conf
5d881996
MT
631 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
632 $(ASCIIDOC) \
633 -f $(abs_srcdir)/man/asciidoc.conf \
baf429f1 634 -b html5 -a icons -a theme=flask -o $@ $<
5ca9dc30 635
2d2e9626
MT
636.PHONY: upload-man
637upload-man: $(MANPAGES_HTML)
638 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@people.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
639
5ca9dc30
MT
640# ------------------------------------------------------------------------------
641
642substitutions = \
643 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
644 '|PACKAGE_URL=$(PACKAGE_URL)|' \
645 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
a35f416c 646 '|builddir=$(abs_builddir)|' \
5ca9dc30
MT
647 '|prefix=$(prefix)|' \
648 '|exec_prefix=$(exec_prefix)|' \
840738f6 649 '|bindir=$(bindir)|' \
5ca9dc30 650 '|sbindir=$(sbindir)|' \
c6525a63 651 '|networkdir=$(networkdir)|' \
96275aa1 652 '|helpersdir=$(helpersdir)|' \
c4966dd6
MT
653 '|utildir=$(utildir)|' \
654 '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|'
5ca9dc30
MT
655
656SED_PROCESS = \
657 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
658 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
659 < $< > $@
660
3431f712 661%: %.in Makefile
5ca9dc30
MT
662 $(SED_PROCESS)
663
664INSTALL_DIRS += \
665 $(sbindir)
666
667install-exec-hook: $(INSTALL_EXEC_HOOKS)
668
669uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
670
671# - testsuite ------------------------------------------------------------------
672
673TESTS_ENVIRONMENT = \
071d3416 674 LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \
8744a476
MT
675 PATH=$(top_builddir)/src:$(PATH) \
676 functions=$(abs_builddir)/src/functions/functions \
677 networkdir=$(abs_srcdir)/src/functions \
678 testdir=$(top_srcdir)/test
679
680dist_check_DATA = \
ee86c73f
MT
681 test/constants.sh \
682 test/test-functions
5ca9dc30
MT
683
684dist_check_SCRIPTS = \
8744a476 685 $(TESTS)
5ca9dc30
MT
686
687TESTS = \
bb8304ec 688 test/load-library \
bb8304ec 689 test/functions/ip/ip_detect_protocol \
bb8304ec 690 test/functions/ip/ip_get_prefix \
8b0958b2 691 test/functions/ip/ip_net_is_valid \
b7fd8067 692 test/functions/ip/ip_is_valid \
b862734c 693 test/functions/ip/ip_network_is_subnet_of \
b7fd8067
MT
694 test/functions/ip/ip_prefix_is_valid \
695 test/functions/ip/ip_protocol_is_supported \
696 test/functions/ip/ip_split_prefix
1908d2b3
MT
697
698# - NITSI tests ----------------------------------------------------------------
699
232d01c8 700# Files for the virtual environment
c4966dd6 701VIRTUAL_ENVIRONMENT_FILES = \
232d01c8
MT
702 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
703 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
704 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
705 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
706 test/nitsi/virtual-environment/basic/network/network1/network.xml \
707 test/nitsi/virtual-environment/basic/network/network2/network.xml \
708 test/nitsi/virtual-environment/basic/network/network3/network.xml \
709 test/nitsi/virtual-environment/basic/network/network4/network.xml \
232d01c8
MT
710 test/nitsi/virtual-environment/basic/settings
711
c4966dd6
MT
712EXTRA_DIST += \
713 test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \
714 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \
715 test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \
43d82e80
JS
716 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \
717 test/nitsi/virtual-environment/basic/settings.in
c4966dd6
MT
718
719CLEANFILES += \
720 test/nitsi/virtual-environment/basic/machines/alice/machine.xml \
721 test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \
722 test/nitsi/virtual-environment/basic/machines/bob/machine.xml \
43d82e80
JS
723 test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \
724 test/nitsi/virtual-environment/basic/settings
c4966dd6
MT
725
726# Virtual Machine Images
727VIRTUAL_ENVIRONMENT_IMAGES = \
728 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \
729 $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2
730
731DISTCLEANFILES += \
732 $(VIRTUAL_ENVIRONMENT_IMAGES)
733
734VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images
735VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \
736 https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/
737
60dbefba 738NITSI_INCLUDE_RECIPES = \
fb99a6c7 739 test/nitsi/include/setup
60dbefba
JS
740
741EXTRA_DIST += \
fb99a6c7 742 test/nitsi/include/setup.in
60dbefba
JS
743
744CLEANFILES += \
fb99a6c7 745 test/nitsi/include/setup
60dbefba 746
1908d2b3 747NITSI_TESTS = \
4c769bb2 748 test/nitsi/test/make-check \
ae7a79da 749 test/nitsi/test/phase1 \
7808dbf2 750 test/nitsi/test/pppoe \
07c82cd3 751 test/nitsi/test/raw-device-get-by-mac \
9c8ff8de 752 test/nitsi/test/zone-new-bridge \
283ad5b0 753 test/nitsi/test/zone-port-attach-bridge \
8c929286
MT
754 test/nitsi/test/zone/ip-tunnel/gre6 \
755 test/nitsi/test/zone/ip-tunnel/gre4 \
60b6dd44
JS
756 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4 \
757 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6 \
758 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4 \
759 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6 \
760 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4 \
761 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6 \
87ad62bc 762 test/nitsi/test/port-vlan
1908d2b3
MT
763
764EXTRA_DIST += \
91ee6559 765 test/nitsi/test/settings.in \
a35f416c 766 test/nitsi/test/make-check/recipe.in \
07c82cd3
JS
767 test/nitsi/test/make-check/settings.in \
768 test/nitsi/test/raw-device-get-by-mac/recipe \
769 test/nitsi/test/raw-device-get-by-mac/settings.in \
770 test/nitsi/test/zone-new-bridge/recipe \
9c8ff8de
JS
771 test/nitsi/test/zone-new-bridge/settings.in \
772 test/nitsi/test/zone-port-attach-bridge/recipe \
283ad5b0 773 test/nitsi/test/zone-port-attach-bridge/settings.in \
8c929286
MT
774 test/nitsi/test/zone/ip-tunnel/gre6/recipe \
775 test/nitsi/test/zone/ip-tunnel/gre6/settings \
776 test/nitsi/test/zone/ip-tunnel/gre4/recipe \
777 test/nitsi/test/zone/ip-tunnel/gre4/settings \
60b6dd44
JS
778 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/recipe \
779 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv4/settings \
780 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/recipe \
781 test/nitsi/test/vpn/ipsec/n2n/vti/ipv4-via-ipv6/settings \
782 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/recipe \
783 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv4/settings \
784 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/recipe \
785 test/nitsi/test/vpn/ipsec/n2n/vti/ipv6-via-ipv6/settings \
786 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/recipe \
787 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv4/settings \
788 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/recipe \
789 test/nitsi/test/vpn/ipsec/n2n/vti/ipv64-via-ipv6/settings \
790 test/nitsi/test/port-vlan/recipe \
791 test/nitsi/test/port-vlan/settings
a35f416c
MT
792
793CLEANFILES += \
91ee6559 794 test/nitsi/test/settings \
a35f416c 795 test/nitsi/test/make-check/recipe \
4c769bb2 796 test/nitsi/test/make-check/settings \
07c82cd3 797 test/nitsi/test/raw-device-get-by-mac/settings \
9c8ff8de 798 test/nitsi/test/zone-new-bridge/settings \
9b01a925 799 test/nitsi/test/zone-port-attach-bridge/settings
1908d2b3
MT
800
801NITSI_ENVIRONMENT =
802
803.PHONY: $(NITSI_TESTS)
59281a53 804$(NITSI_TESTS): % : dist %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES)
91ee6559 805 $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ \
e3e44ab6 806 --default-settings $(abs_builddir)/test/nitsi/test/settings --interactive-error-handling
1908d2b3
MT
807
808.PHONY: nitsi
59281a53 809nitsi: $(NITSI_TESTS)
c4966dd6
MT
810
811# Downloads a virtual image file and extracts it
812$(VIRTUAL_ENVIRONMENT_IMAGES):
813 $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \
814 $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@