Merge pull request #89 from SeattleMeshnet/master
[feed/routing.git] / nat46 / Makefile
1 #
2 # Copyright (C) 2014-2015 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=nat46
12 PKG_VERSION:=4
13 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git
18 PKG_SOURCE_PROTO:=git
19 PKG_SOURCE_VERSION:=ccbba8595d7ccbc2ccb1e7d81b420e9587f07fe5
20 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
21 PKG_LICENSE:=GPL-2.0
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/map-t
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+map +kmod-nat46
29 TITLE:=MAP-T configuration support
30 endef
31
32 define Package/464xlat
33 SECTION:=net
34 CATEGORY:=Network
35 DEPENDS:=+kmod-nat46
36 TITLE:=464xlat CLAT support
37 endef
38
39 define KernelPackage/nat46
40 DEPENDS:=+kmod-ipv6
41 TITLE:=Stateless NAT46 translation kernel module
42 SECTION:=kernel
43 SUBMENU:=Network Support
44 FILES:=$(PKG_BUILD_DIR)/nat46/modules/nat46.ko
45 AUTOLOAD:=$(call AutoLoad,33,nat46)
46 endef
47
48 include $(INCLUDE_DIR)/kernel-defaults.mk
49
50 define Build/Prepare
51 $(call Build/Prepare/Default)
52 $(CP) ./src/* $(PKG_BUILD_DIR)/
53 endef
54
55 define Build/Compile
56 $(MAKE) -C $(PKG_BUILD_DIR) \
57 CC="$(TARGET_CC)" \
58 CFLAGS="$(TARGET_CFLAGS) -Wall" \
59 LDFLAGS="$(TARGET_LDFLAGS)"
60 $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)/nat46/modules" \
61 MODFLAGS="-DMODULE -mlong-calls" \
62 EXTRA_CFLAGS="-DNAT46_VERSION=\\\"$(PKG_SOURCE_VERSION)\\\"" \
63 modules
64 endef
65
66 define Package/map-t/install
67 true
68 endef
69
70 define Package/464xlat/install
71 $(INSTALL_DIR) $(1)/lib/netifd/proto
72 $(INSTALL_BIN) ./files/464xlat.sh $(1)/lib/netifd/proto/464xlat.sh
73 $(INSTALL_DIR) $(1)/sbin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/464xlatcfg $(1)/sbin
75 endef
76
77 $(eval $(call KernelPackage,nat46))
78 $(eval $(call BuildPackage,map-t))
79 $(eval $(call BuildPackage,464xlat))