firewall3: move libext*.a copying to compile phase
[openwrt/staging/lynxis/omap.git] / package / network / config / firewall3 / Makefile
1 #
2 # Copyright (C) 2013 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:=firewall3
11 PKG_VERSION:=2013-05-21
12 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=git://nbd.name/firewall3.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=54904110e3122f4fcded32f5ff6ef30f7de7363c
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
20
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/kernel.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 define Package/firewall3
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=UCI C Firewall
30 DEPENDS:=+libubox +libubus +libuci +libip4tc +libip6tc +libxtables
31 endef
32
33 define Package/firewall3/description
34 This package provides a config-compatible C implementation of the UCI firewall.
35 endef
36
37 define Package/firewall3/conffiles
38 /etc/config/firewall
39 /etc/firewall.user
40 endef
41
42 define Build/Compile
43 $(CP) $(lastword $(wildcard $(KERNEL_BUILD_DIR)/iptables-*/extensions/libext.a)) $(PKG_BUILD_DIR)/libext.a
44 $(CP) $(lastword $(wildcard $(KERNEL_BUILD_DIR)/iptables-*/extensions/libext4.a)) $(PKG_BUILD_DIR)/libext4.a
45 $(CP) $(lastword $(wildcard $(KERNEL_BUILD_DIR)/iptables-*/extensions/libext6.a)) $(PKG_BUILD_DIR)/libext6.a
46 $(call Build/Compile/Default)
47 endef
48
49 TARGET_CFLAGS += -ffunction-sections -fdata-sections
50 TARGET_LDFLAGS += -Wl,--gc-sections
51
52 define Package/firewall3/install
53 $(INSTALL_DIR) $(1)/sbin
54 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
55 $(INSTALL_DIR) $(1)/etc/init.d
56 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
57 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
58 $(INSTALL_DATA) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
59 $(INSTALL_DIR) $(1)/etc/config/
60 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
61 $(INSTALL_DIR) $(1)/etc/
62 $(INSTALL_DATA) ./files/firewall.user $(1)/etc/firewall.user
63 endef
64
65 $(eval $(call BuildPackage,firewall3))