X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Makefile.am;h=fa12f4e77a071f997875553f0cf81b3057558b33;hb=9c8ff8de089ed8f6f24b9c12ad7bc8abd310134b;hp=9ba352f5e1a87e42d8295098d72b05db67e75813;hpb=0608337a9ea0c318a331857cf6fdfeaf81784b79;p=network.git diff --git a/Makefile.am b/Makefile.am index 9ba352f5..fa12f4e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,9 +28,12 @@ AUTOMAKE_OPTIONS = color-tests # keep itermediate files .SECONDARY: +configdir = $(sysconfdir)/network +bashcompletiondir= $(datadir)/bash-completion/completions libexecdir = $(prefix)/lib -pkgconfigdatadir = $(datadir)/pkgconfig +pkgconfigdir = $(libdir)/pkgconfig pppdir = $(sysconfdir)/ppp +systemconfigdir = $(datadir)/network sysctldir = $(prefix)/lib/sysctl.d tmpfilesdir = $(prefix)/lib/tmpfiles.d udevrulesdir = $(udevdir)/rules.d @@ -45,6 +48,11 @@ hooks_configsdir = $(hooksdir)/configs hooks_portsdir = $(hooksdir)/ports hooks_zonesdir = $(hooksdir)/zones +triggersdir = $(networkdir)/triggers + +logdir = $(localestatedir)/log/network +utildir = $(networkdir) + CLEANFILES = DISTCLEANFILES = EXTRA_DIST = @@ -53,6 +61,22 @@ INSTALL_EXEC_HOOKS = UNINSTALL_EXEC_HOOKS = noinst_DATA = +AM_CPPFLAGS = \ + $(OUR_CPPFLAGS) \ + -include $(top_builddir)/config.h \ + -I${top_srcdir}/src/libnetwork + +AM_CFLAGS = \ + $(OUR_CFLAGS) \ + -fvisibility=hidden \ + -ffunction-sections \ + -fdata-sections + +AM_LDFLAGS = \ + $(OUR_LDFLAGS) \ + -Wl,--gc-sections \ + -Wl,--as-needed + DISTCHECK_CONFIGURE_FLAGS = \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \ --with-udevdir=$$dc_install_base/$(udevdir) @@ -65,6 +89,14 @@ INSTALL_EXEC_HOOKS += \ # ------------------------------------------------------------------------------ +AM_V_DOWNLOAD = $(AM_V_DOWNLOAD_$(V)) +AM_V_DOWNLOAD_ = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY)) +AM_V_DOWNLOAD_0 = @echo " LOAD " $@; + +AM_V_NITSI = $(AM_V_NITSI_$(V)) +AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY)) +AM_V_NITSI_0 = @echo " NITSI " $@; + AM_V_XSLT = $(AM_V_XSLT_$(V)) AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY)) AM_V_XSLT_0 = @echo " XSLT " $@; @@ -72,8 +104,9 @@ AM_V_XSLT_0 = @echo " XSLT " $@; # ------------------------------------------------------------------------------ dist_doc_DATA = \ - COPYING \ - README + README \ + docs/CODING_STYLE \ + docs/COPYING dist_sbin_SCRIPTS = \ src/dhclient-script \ @@ -82,7 +115,7 @@ dist_sbin_SCRIPTS = \ src/firewall6 \ src/network -network_SCRIPTS = \ +network_DATA = \ src/functions/functions CLEANFILES += \ @@ -91,11 +124,9 @@ CLEANFILES += \ EXTRA_DIST += \ src/functions/functions.in -dist_network_SCRIPTS = \ - src/functions/functions.aiccu \ +dist_network_DATA = \ src/functions/functions.at \ src/functions/functions.auth \ - src/functions/functions.batman-adv \ src/functions/functions.bonding \ src/functions/functions.bridge \ src/functions/functions.cli \ @@ -106,21 +137,26 @@ dist_network_SCRIPTS = \ src/functions/functions.constants \ src/functions/functions.constants-firewall \ src/functions/functions.db \ + src/functions/functions.description \ src/functions/functions.device \ src/functions/functions.dhclient \ src/functions/functions.dhcpd \ src/functions/functions.distro \ src/functions/functions.dns \ src/functions/functions.dummy \ - src/functions/functions.ethernet \ + src/functions/functions.editor \ src/functions/functions.firewall \ src/functions/functions.firewall-policy \ src/functions/functions.firewall-zones \ src/functions/functions.he \ src/functions/functions.hook \ src/functions/functions.hostapd \ + src/functions/functions.hotplug \ src/functions/functions.http \ + src/functions/functions.interrupts \ src/functions/functions.ip \ + src/functions/functions.ipsec \ + src/functions/functions.ipsec-pool \ src/functions/functions.iptables \ src/functions/functions.ip-tunnel \ src/functions/functions.ipv4 \ @@ -129,14 +165,12 @@ dist_network_SCRIPTS = \ src/functions/functions.lock \ src/functions/functions.logging \ src/functions/functions.macros \ - src/functions/functions.macvlan \ src/functions/functions.modem \ src/functions/functions.phy \ src/functions/functions.ports \ src/functions/functions.ppp \ src/functions/functions.pppoe-server \ src/functions/functions.radvd \ - src/functions/functions.red \ src/functions/functions.route \ src/functions/functions.routing \ src/functions/functions.serial \ @@ -144,10 +178,16 @@ dist_network_SCRIPTS = \ src/functions/functions.settings \ src/functions/functions.stp \ src/functions/functions.sysctl \ + src/functions/functions.system \ + src/functions/functions.triggers \ src/functions/functions.usb \ src/functions/functions.util \ src/functions/functions.vlan \ + src/functions/functions.vpn \ + src/functions/functions.vpn-security-policies \ src/functions/functions.wireless \ + src/functions/functions.wireless-mesh \ + src/functions/functions.wireless-networks \ src/functions/functions.wpa_supplicant \ src/functions/functions.zone \ src/network-radvd-config \ @@ -159,50 +199,109 @@ dist_network_SCRIPTS = \ src/ppp/pppoe-server dist_helpers_SCRIPTS = \ - src/helpers/aiccu-config-helper \ - src/helpers/bridge-stp \ src/helpers/dhcpd-config-helper \ src/helpers/firewall-kernel-init \ src/helpers/hostapd-config-helper \ + src/helpers/ipsec-updown \ src/helpers/pppd-angel \ - src/helpers/wpa_supplicant \ - src/helpers/wpa_supplicant-config-helper + src/helpers/wpa_supplicant -bridge-stp-install-hook: bridge-stp-uninstall-hook - ln -svf --relative $(DESTDIR)$(helpersdir)/bridge-stp $(DESTDIR)$(sbindir)/ +bin_PROGRAMS = \ + src/inetcalc -bridge-stp-uninstall-hook: - rm -f $(DESTDIR)$(sbindir)/bridge-stp +src_inetcalc_SOURCES = \ + src/inetcalc.c -INSTALL_EXEC_HOOKS += bridge-stp-install-hook -UNINSTALL_EXEC_HOOKS += bridge-stp-uninstall-hook +src_inetcalc_LDADD = \ + src/libnetwork.la dist_hooks_configs_SCRIPTS = \ - src/hooks/configs/ipv4-dhcp \ - src/hooks/configs/ipv6-static \ - src/hooks/configs/ipv4-static \ - src/hooks/configs/pppoe-server + src/hooks/configs/dhcp \ + src/hooks/configs/ipv6-auto \ + src/hooks/configs/pppoe-server \ + src/hooks/configs/static dist_hooks_ports_SCRIPTS = \ - src/hooks/ports/batman-adv \ - src/hooks/ports/batman-adv-port \ src/hooks/ports/bonding \ src/hooks/ports/dummy \ src/hooks/ports/ethernet \ - src/hooks/ports/macvlan \ src/hooks/ports/vlan \ - src/hooks/ports/wireless-ap + src/hooks/ports/wireless-ap \ + src/hooks/ports/wireless-mesh dist_hooks_zones_SCRIPTS = \ - src/hooks/zones/6rd \ src/hooks/zones/6to4-tunnel \ - src/hooks/zones/aiccu \ src/hooks/zones/bridge \ src/hooks/zones/modem \ src/hooks/zones/pppoe \ - src/hooks/zones/pptp \ src/hooks/zones/wireless +INSTALL_DIRS += \ + $(configdir) \ + $(configdir)/ports \ + $(configdir)/vpn \ + $(configdir)/vpn/ipsec/connections \ + $(configdir)/vpn/security-policies \ + $(configdir)/wireless \ + $(configdir)/wireless/networks \ + $(configdir)/zones + +# ------------------------------------------------------------------------------ + +LIBNETWORK_CURRENT=0 +LIBNETWORK_REVISION=0 +LIBNETWORK_AGE=0 + +pkginclude_HEADERS = \ + src/libnetwork/network/interface.h \ + src/libnetwork/network/libnetwork.h \ + src/libnetwork/network/logging.h \ + src/libnetwork/network/phy.h + +lib_LTLIBRARIES = \ + src/libnetwork.la + +src_libnetwork_la_SOURCES = \ + src/libnetwork/interface.c \ + src/libnetwork/libnetwork-private.h \ + src/libnetwork/libnetwork.c \ + src/libnetwork/phy.c + +src_libnetwork_la_LIBADD = \ + $(LIBNL_LIBS) + +src_libnetwork_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(LIBNL_CPPFLAGS) \ + -D_GNU_SOURCE \ + -DNETWORK_PRIVATE + +src_libnetwork_la_CFLAGS = \ + $(AM_CFLAGS) \ + $(LIBNL_CFLAGS) + +src_libnetwork_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -version-info $(LIBNETWORK_CURRENT):$(LIBNETWORK_REVISION):$(LIBNETWORK_AGE) \ + -Wl,--version-script=$(top_srcdir)/src/libnetwork/libnetwork.sym + +src_libnetwork_la_DEPENDENCIES = \ + src/libnetwork/libnetwork.sym + +EXTRA_DIST += \ + src/libnetwork/libnetwork.sym + +# ------------------------------------------------------------------------------ + +util_PROGRAMS = \ + src/utils/network-phy-list-ht-caps + +src_utils_network_phy_list_ht_caps_SOURCES = \ + src/utils/network-phy-list-ht-caps.c + +src_utils_network_phy_list_ht_caps_LDADD = \ + src/libnetwork.la + # ------------------------------------------------------------------------------ ppp_SCRIPTS = \ @@ -215,7 +314,8 @@ EXTRA_DIST += \ src/ppp/ip-updown.in INSTALL_DIRS += \ - $(pppdir) + $(pppdir) \ + $(logdir) ppp-install-hook: ln -svf ip-updown $(DESTDIR)$(pppdir)/ip-pre-up @@ -257,13 +357,28 @@ EXTRA_DIST += \ # ------------------------------------------------------------------------------ +systemconfig_vpndir = $(systemconfigdir)/vpn + +dist_systemconfig_vpn_security_policies_DATA = \ + config/vpn/security-policies/performance \ + config/vpn/security-policies/system + +systemconfig_vpn_security_policiesdir = $(systemconfig_vpndir)/security-policies + +# ------------------------------------------------------------------------------ + dist_sysctl_DATA = \ src/sysctl/network.conf # ------------------------------------------------------------------------------ +dist_bashcompletion_SCRIPTS = \ + src/bash-completion/network + +# ------------------------------------------------------------------------------ + dist_tmpfiles_DATA = \ - src/tmpfiles/network + src/tmpfiles/network.conf # ------------------------------------------------------------------------------ @@ -284,11 +399,11 @@ endif # ------------------------------------------------------------------------------ -pkgconfigdata_DATA = \ +pkgconfig_DATA = \ src/network.pc CLEANFILES += \ - $(pkgconfigdata_DATA) + $(pkgconfig_DATA) EXTRA_DIST += \ src/network.pc.in @@ -303,23 +418,34 @@ dist_macros_DATA = \ # ------------------------------------------------------------------------------ +INSTALL_DIRS += \ + $(triggersdir) + +# ------------------------------------------------------------------------------ + MANPAGES = \ man/firewall-settings.8 \ man/network.8 \ + man/network-color.8 \ + man/network-description.8 \ man/network-device.8 \ + man/network-dhcp.8 \ man/network-dns-server.8 \ - man/network-port-batman-adv.8 \ - man/network-port-batman-adv-port.8 \ + man/network-performance-tuning.8 \ + man/network-port.8 \ + man/network-quick-start.8 \ man/network-route.8 \ + man/network-route-static.8 \ man/network-settings.8 \ + man/network-vpn.8 \ + man/network-vpn-security-policies.8 \ man/network-zone.8 \ - man/network-zone-6rd.8 \ man/network-zone-6to4-tunnel.8 \ - man/network-zone-aiccu.8 \ man/network-zone-bridge.8 \ man/network-zone-config-pppoe-server.8 \ + man/network-zone-modem.8 \ man/network-zone-pppoe.8 \ - man/network-zone-pptp.8 + man/network-zone-wireless.8 MANPAGES_XML = $(patsubst %.8,%.xml,$(MANPAGES)) MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML)) @@ -368,27 +494,21 @@ substitutions = \ '|PACKAGE_NAME=$(PACKAGE_NAME)|' \ '|PACKAGE_URL=$(PACKAGE_URL)|' \ '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \ + '|builddir=$(abs_builddir)|' \ '|prefix=$(prefix)|' \ '|exec_prefix=$(exec_prefix)|' \ '|sbindir=$(sbindir)|' \ '|networkdir=$(networkdir)|' \ - '|helpersdir=$(helpersdir)|' + '|helpersdir=$(helpersdir)|' \ + '|utildir=$(utildir)|' \ + '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|' SED_PROCESS = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ < $< > $@ -src/functions/functions: src/functions/functions.in Makefile - $(SED_PROCESS) - -src/ppp/ip-updown: src/ppp/ip-updown.in Makefile - $(SED_PROCESS) - -src/systemd/%: src/systemd/%.in Makefile - $(SED_PROCESS) - -src/%.pc: src/%.pc.in Makefile +%: %.in Makefile $(SED_PROCESS) INSTALL_DIRS += \ @@ -401,11 +521,119 @@ uninstall-hook: $(UNINSTALL_EXEC_HOOKS) # - testsuite ------------------------------------------------------------------ TESTS_ENVIRONMENT = \ - topdir="$(shell pwd)" \ - networkdir="$(top_srcdir)/src/functions" + LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$(LD_LIBRARY_PATH) \ + PATH=$(top_builddir)/src:$(PATH) \ + functions=$(abs_builddir)/src/functions/functions \ + networkdir=$(abs_srcdir)/src/functions \ + testdir=$(top_srcdir)/test + +dist_check_DATA = \ + test/constants.sh \ + test/test-functions dist_check_SCRIPTS = \ - test/load-library + $(TESTS) TESTS = \ - test/load-library + test/load-library \ + test/functions/ip/ip_detect_protocol \ + test/functions/ip/ip_get_prefix \ + test/functions/ip/ip_net_is_valid \ + test/functions/ip/ip_is_valid \ + test/functions/ip/ip_network_is_subnet_of \ + test/functions/ip/ip_prefix_is_valid \ + test/functions/ip/ip_protocol_is_supported \ + test/functions/ip/ip_split_prefix + +# - NITSI tests ---------------------------------------------------------------- + +# Files for the virtual environment +VIRTUAL_ENVIRONMENT_FILES = \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ + test/nitsi/virtual-environment/basic/network/network1/network.xml \ + test/nitsi/virtual-environment/basic/network/network2/network.xml \ + test/nitsi/virtual-environment/basic/network/network3/network.xml \ + test/nitsi/virtual-environment/basic/network/network4/network.xml \ + test/nitsi/virtual-environment/basic/settings + +EXTRA_DIST += \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in \ + test/nitsi/virtual-environment/basic/settings.in + +CLEANFILES += \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ + test/nitsi/virtual-environment/basic/settings + +# Virtual Machine Images +VIRTUAL_ENVIRONMENT_IMAGES = \ + $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \ + $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2 + +DISTCLEANFILES += \ + $(VIRTUAL_ENVIRONMENT_IMAGES) + +VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images +VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \ + https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/ + +NITSI_INCLUDE_RECIPES = \ + test/nitsi/include/make-install \ + test/nitsi/include/network-reset \ + test/nitsi/include/network-settings + +EXTRA_DIST += \ + test/nitsi/include/make-install.in + test/nitsi/include/network-reset \ + test/nitsi/include/network-settings + +CLEANFILES += \ + test/nitsi/include/make-install + +NITSI_TESTS = \ + test/nitsi/test/hello-world \ + test/nitsi/test/make-check \ + test/nitsi/test/raw-device-get-by-mac \ + test/nitsi/test/zone-new-bridge \ + test/nitsi/test/zone-port-attach-bridge + +EXTRA_DIST += \ + test/nitsi/test/hello-world/recipe \ + test/nitsi/test/hello-world/settings \ + test/nitsi/test/make-check/recipe.in \ + test/nitsi/test/make-check/settings.in \ + test/nitsi/test/raw-device-get-by-mac/recipe \ + test/nitsi/test/raw-device-get-by-mac/settings.in \ + test/nitsi/test/zone-new-bridge/recipe \ + test/nitsi/test/zone-new-bridge/settings.in \ + test/nitsi/test/zone-port-attach-bridge/recipe \ + test/nitsi/test/zone-port-attach-bridge/settings.in + +CLEANFILES += \ + test/nitsi/test/make-check/recipe \ + test/nitsi/test/make-check/settings \ + test/nitsi/test/raw-device-get-by-mac/settings \ + test/nitsi/test/zone-new-bridge/settings \ + test/nitsi/test/zone-port-attach-bridge/settings + +NITSI_ENVIRONMENT = + +.PHONY: $(NITSI_TESTS) +$(NITSI_TESTS): % : %/recipe %/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES) + $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ + +.PHONY: nitsi +nitsi: dist $(NITSI_TESTS) + +# Downloads a virtual image file and extracts it +$(VIRTUAL_ENVIRONMENT_IMAGES): + $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \ + $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@