banip: release 0.9.6-1
[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.11.13
12 PKG_RELEASE:=2
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 +IPV6:ip6tables \
29 +iptables-mod-conntrack-extra \
30 +iptables-mod-ipopt \
31 +jshn
32 TITLE:=Multiwan hotplug script with connection tracking support
33 MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
34 PKGARCH:=all
35 endef
36
37 define Package/mwan3/description
38 Hotplug script which makes configuration of multiple WAN interfaces simple
39 and manageable. With loadbalancing/failover support for up to 250 wan
40 interfaces, connection tracking and an easy to manage traffic ruleset.
41 endef
42
43 define Package/mwan3/conffiles
44 /etc/config/mwan3
45 /etc/mwan3.user
46 endef
47
48 define Package/mwan3/postinst
49 #!/bin/sh
50 if [ -z "$${IPKG_INSTROOT}" ] && [ -x /etc/init.d/rpcd ]; then
51 /etc/init.d/rpcd restart
52 fi
53 exit 0
54 endef
55
56 define Package/mwan3/postrm
57 #!/bin/sh
58 if [ -z "$${IPKG_INSTROOT}" ] && [ -x /etc/init.d/rpcd ]; then
59 /etc/init.d/rpcd restart
60 fi
61 exit 0
62 endef
63
64 define Build/Compile
65 $(TARGET_CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
66 -shared \
67 -o $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 \
68 $(if $(CONFIG_IPV6),-DCONFIG_IPV6) \
69 $(PKG_BUILD_DIR)/sockopt_wrap.c \
70 -ldl
71 endef
72
73 define Package/mwan3/install
74 $(INSTALL_DIR) $(1)/etc/config
75 $(INSTALL_CONF) ./files/etc/config/mwan3 \
76 $(1)/etc/config/
77
78 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
79 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/15-mwan3 \
80 $(1)/etc/hotplug.d/iface/
81 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/16-mwan3-user \
82 $(1)/etc/hotplug.d/iface/
83
84 $(INSTALL_DIR) $(1)/etc/init.d
85 $(INSTALL_BIN) ./files/etc/init.d/mwan3 \
86 $(1)/etc/init.d/
87
88 $(INSTALL_DIR) $(1)/lib/mwan3
89 $(INSTALL_DATA) ./files/lib/mwan3/common.sh \
90 $(1)/lib/mwan3/
91 $(INSTALL_DATA) ./files/lib/mwan3/mwan3.sh \
92 $(1)/lib/mwan3/
93
94 $(INSTALL_DIR) $(1)/usr/libexec/rpcd
95 $(INSTALL_BIN) ./files/usr/libexec/rpcd/mwan3 \
96 $(1)/usr/libexec/rpcd/
97
98 $(INSTALL_DIR) $(1)/usr/sbin
99 $(INSTALL_BIN) ./files/usr/sbin/mwan3 \
100 $(1)/usr/sbin/
101 $(INSTALL_BIN) ./files/usr/sbin/mwan3rtmon \
102 $(1)/usr/sbin/
103 $(INSTALL_BIN) ./files/usr/sbin/mwan3track \
104 $(1)/usr/sbin/
105
106 $(INSTALL_DIR) $(1)/etc
107 $(INSTALL_BIN) ./files/etc/mwan3.user \
108 $(1)/etc/
109
110 $(CP) $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 $(1)/lib/mwan3/
111
112 $(INSTALL_DIR) $(1)/etc/uci-defaults
113 $(INSTALL_DATA) ./files/etc/uci-defaults/mwan3-migrate-flush_conntrack \
114 $(1)/etc/uci-defaults/
115 endef
116
117 $(eval $(call BuildPackage,mwan3))