iproute2: remove odd conffiles generation
[openwrt/staging/lynxis/omap.git] / package / network / utils / iproute2 / Makefile
1 #
2 # Copyright (C) 2006-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
10 PKG_NAME:=iproute2
11 PKG_VERSION:=4.3.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
16 PKG_MD5SUM:=1a2bbb80cfc7ab3f3e987e18b3207c2f
17 PKG_BUILD_PARALLEL:=1
18 PKG_LICENSE:=GPL-2.0
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/iproute2/Default
25 TITLE:=Routing control utility ($(2))
26 SECTION:=net
27 CATEGORY:=Network
28 URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
29 SUBMENU:=Routing and Redirection
30 MAINTAINER:=Russell Senior <russell@personaltelco.net>
31 DEPENDS:= +libnl-tiny
32 VARIANT:=$(1)
33 endef
34
35 define Package/ip
36 $(call Package/iproute2/Default,tiny,Minimal)
37 CONFLICTS:=ip-full
38 endef
39
40 Package/ip-full=$(call Package/iproute2/Default,full,Full)
41
42 define Package/tc
43 $(call Package/iproute2/Default)
44 TITLE:=Traffic control utility
45 DEPENDS:=+kmod-sched-core
46 endef
47
48 define Package/genl
49 $(call Package/iproute2/Default)
50 TITLE:=General netlink utility frontend
51 endef
52
53 define Package/ip-bridge
54 $(call Package/iproute2/Default)
55 TITLE:=Bridge configuration utility from iproute2
56 endef
57
58 define Package/ss
59 $(call Package/iproute2/Default)
60 TITLE:=Socket statistics utility
61 endef
62
63 ifeq ($(BUILD_VARIANT),tiny)
64 IP_CONFIG_TINY:=y
65 endif
66
67 define Build/Configure
68 $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
69 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
70 $(PKG_BUILD_DIR)/Makefile
71 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
72 $(PKG_BUILD_DIR)/Makefile
73 echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
74 > $(PKG_BUILD_DIR)/include/SNAPSHOT.h
75 endef
76
77 TARGET_CFLAGS += -DHAVE_SETNS
78 TARGET_CFLAGS += -ffunction-sections -fdata-sections
79
80 MAKE_FLAGS += \
81 EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
82 KERNEL_INCLUDE="$(LINUX_DIR)/include" \
83 SHARED_LIBS="" \
84 LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
85 IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
86 FPIC="$(FPIC)"
87
88 define Build/Compile
89 +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
90 endef
91
92 define Build/InstallDev
93 $(INSTALL_DIR) $(1)/usr/include
94 $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
97 endef
98
99 define Package/ip/install
100 $(INSTALL_DIR) $(1)/usr/bin
101 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/
102 endef
103
104 define Package/ip-full/install
105 $(INSTALL_DIR) $(1)/usr/sbin
106 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
107 endef
108
109 define Package/tc/install
110 $(INSTALL_DIR) $(1)/usr/sbin
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
112 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
113 $(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
114 endef
115
116 define Package/genl/install
117 $(INSTALL_DIR) $(1)/usr/sbin
118 $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
119 endef
120
121 define Package/ip-bridge/install
122 $(INSTALL_DIR) $(1)/usr/sbin
123 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bridge/bridge $(1)/usr/sbin/
124 endef
125
126 define Package/ss/install
127 $(INSTALL_DIR) $(1)/usr/sbin
128 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/ss $(1)/usr/sbin/
129 endef
130
131 $(eval $(call BuildPackage,ip))
132 $(eval $(call BuildPackage,ip-full))
133 $(eval $(call BuildPackage,tc))
134 $(eval $(call BuildPackage,genl))
135 $(eval $(call BuildPackage,ip-bridge))
136 $(eval $(call BuildPackage,ss))