Merge pull request #16049 from nxhack/libuv_CVE-2021-22918
[feed/packages.git] / net / mwan3 / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mwan3
11 PKG_VERSION:=2.10.10
12 PKG_RELEASE:=1
13 PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
14 Aaron Goodman <aaronjg@alumni.stanford.edu>
15 PKG_LICENSE:=GPL-2.0
16 PKG_CONFIG_DEPENDS:=CONFIG_IPV6
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/mwan3
21 SECTION:=net
22 CATEGORY:=Network
23 SUBMENU:=Routing and Redirection
24 DEPENDS:= \
25 +ip \
26 +ipset \
27 +iptables \
28 +iptables-mod-conntrack-extra \
29 +iptables-mod-ipopt \
30 +jshn
31 TITLE:=Multiwan hotplug script with connection tracking support
32 MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
33 PKGARCH:=all
34 endef
35
36 define Package/mwan3/description
37 Hotplug script which makes configuration of multiple WAN interfaces simple
38 and manageable. With loadbalancing/failover support for up to 250 wan
39 interfaces, connection tracking and an easy to manage traffic ruleset.
40 endef
41
42 define Package/mwan3/conffiles
43 /etc/config/mwan3
44 /etc/mwan3.user
45 endef
46
47 define Package/mwan3/postinst
48 #!/bin/sh
49 if [ -z "$${IPKG_INSTROOT}" ] && [ -x /etc/init.d/rpcd ]; then
50 /etc/init.d/rpcd restart
51 fi
52 exit 0
53 endef
54
55 define Package/mwan3/postrm
56 #!/bin/sh
57 if [ -z "$${IPKG_INSTROOT}" ] && [ -x /etc/init.d/rpcd ]; then
58 /etc/init.d/rpcd restart
59 fi
60 exit 0
61 endef
62
63 define Build/Compile
64 $(TARGET_CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
65 -shared \
66 -o $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 \
67 $(if $(CONFIG_IPV6),-DCONFIG_IPV6) \
68 $(PKG_BUILD_DIR)/sockopt_wrap.c \
69 -ldl
70 endef
71
72 define Package/mwan3/install
73 $(INSTALL_DIR) $(1)/etc/config
74 $(INSTALL_CONF) ./files/etc/config/mwan3 \
75 $(1)/etc/config/
76
77 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
78 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/15-mwan3 \
79 $(1)/etc/hotplug.d/iface/
80 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/16-mwan3-user \
81 $(1)/etc/hotplug.d/iface/
82
83 $(INSTALL_DIR) $(1)/etc/init.d
84 $(INSTALL_BIN) ./files/etc/init.d/mwan3 \
85 $(1)/etc/init.d/
86
87 $(INSTALL_DIR) $(1)/lib/mwan3
88 $(INSTALL_DATA) ./files/lib/mwan3/common.sh \
89 $(1)/lib/mwan3/
90 $(INSTALL_DATA) ./files/lib/mwan3/mwan3.sh \
91 $(1)/lib/mwan3/
92
93 $(INSTALL_DIR) $(1)/usr/libexec/rpcd
94 $(INSTALL_BIN) ./files/usr/libexec/rpcd/mwan3 \
95 $(1)/usr/libexec/rpcd/
96
97 $(INSTALL_DIR) $(1)/usr/sbin
98 $(INSTALL_BIN) ./files/usr/sbin/mwan3 \
99 $(1)/usr/sbin/
100 $(INSTALL_BIN) ./files/usr/sbin/mwan3rtmon \
101 $(1)/usr/sbin/
102 $(INSTALL_BIN) ./files/usr/sbin/mwan3track \
103 $(1)/usr/sbin/
104
105 $(INSTALL_DIR) $(1)/etc
106 $(INSTALL_BIN) ./files/etc/mwan3.user \
107 $(1)/etc/
108
109 $(CP) $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 $(1)/lib/mwan3/
110
111 $(INSTALL_DIR) $(1)/etc/uci-defaults
112 $(INSTALL_DATA) ./files/etc/uci-defaults/mwan3-migrate-flush_conntrack \
113 $(1)/etc/uci-defaults/
114 endef
115
116 $(eval $(call BuildPackage,mwan3))