libnl: Install include files into libnl3
[openwrt/openwrt.git] / package / libs / libnl / Makefile
1 #
2 # Copyright (C) 2006-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:=libnl
11 PKG_VERSION:=3.2.21
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.infradead.org/~tgr/libnl/files/
16 PKG_MD5SUM:=6fe7136558a9071e70673dcda38545b3
17 PKG_LICENSE:=LGPL-2.1
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libnl/default
22 SECTION:=libs
23 CATEGORY:=Libraries
24 URL:=http://people.suug.ch/~tgr/libnl/
25 endef
26
27 define Package/libnl-core
28 $(call Package/libnl/default)
29 TITLE:=Core Netlink Library
30 DEPENDS:=+libpthread
31 endef
32
33 define Package/libnl-genl
34 $(call Package/libnl/default)
35 TITLE:=Generic Netlink Library
36 DEPENDS:=+libnl-core
37 endef
38
39 define Package/libnl-route
40 $(call Package/libnl/default)
41 TITLE:=Routing Netlink Library
42 DEPENDS:=+libnl-core
43 endef
44
45 define Package/libnl-nf
46 $(call Package/libnl/default)
47 TITLE:=Netfilter Netlink Library
48 DEPENDS:=+libnl-route
49 endef
50
51 define Package/libnl
52 $(call Package/libnl/default)
53 TITLE:=Full Netlink Library
54 DEPENDS:=+libnl-genl +libnl-route +libnl-nf
55 endef
56
57 define Package/libnl-core/description
58 Common code for all netlink libraries
59 endef
60
61 define Package/libnl-genl/description
62 Generic Netlink Library Functions
63 endef
64
65 define Package/libnl-route/description
66 Routing Netlink Library Functions
67 endef
68
69 define Package/libnl-nf/description
70 Netfilter Netlink Library Functions
71 endef
72
73 define Package/libnl/description
74 Socket handling, connection management, sending and receiving of data,
75 message construction and parsing, object caching system, etc.
76 endef
77
78 TARGET_CFLAGS += -ffunction-sections $(FPIC)
79
80 define Build/Compile
81 $(call Build/Compile/Default)
82 make -C $(PKG_BUILD_DIR) \
83 DESTDIR="$(PKG_INSTALL_DIR)" \
84 install
85 endef
86
87 define Build/InstallDev
88 $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig
89 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
92
93 # Copy symlinks
94 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so
97 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so
98 endef
99
100 define Package/libnl-core/install
101 $(INSTALL_DIR) $(1)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so* $(1)/usr/lib/
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so
104 endef
105
106 define Package/libnl-genl/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so* $(1)/usr/lib/
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so
110 endef
111
112 define Package/libnl-route/install
113 $(INSTALL_DIR) $(1)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so* $(1)/usr/lib/
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so
116 endef
117
118 define Package/libnl-nf/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so* $(1)/usr/lib/
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so
122 endef
123
124 define Package/libnl/install
125 :
126 endef
127
128 $(eval $(call BuildPackage,libnl-core))
129 $(eval $(call BuildPackage,libnl-genl))
130 $(eval $(call BuildPackage,libnl-route))
131 $(eval $(call BuildPackage,libnl-nf))
132 $(eval $(call BuildPackage,libnl))