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