treewide: revise library packaging
[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.4.0
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_4_0
16 PKG_HASH:=b7287637ae71c6db6f89e1422c995f0407ff2fe50cecd61a312b6a9b0921f5bf
17 PKG_LICENSE:=LGPL-2.1
18
19 PKG_INSTALL:=1
20 PKG_FIXUP:=autoreconf
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libnl/default
25 SECTION:=libs
26 CATEGORY:=Libraries
27 URL:=http://www.infradead.org/~tgr/libnl/
28 ABI_VERSION:=200
29 endef
30
31 define Package/libnl-core
32 $(call Package/libnl/default)
33 TITLE:=Core Netlink Library
34 DEPENDS:=+libpthread
35 endef
36
37 define Package/libnl-genl
38 $(call Package/libnl/default)
39 TITLE:=Generic Netlink Library
40 DEPENDS:=+libnl-core
41 endef
42
43 define Package/libnl-route
44 $(call Package/libnl/default)
45 TITLE:=Routing Netlink Library
46 DEPENDS:=+libnl-core
47 endef
48
49 define Package/libnl-nf
50 $(call Package/libnl/default)
51 TITLE:=Netfilter Netlink Library
52 DEPENDS:=+libnl-route
53 endef
54
55 define Package/libnl
56 $(call Package/libnl/default)
57 TITLE:=Full Netlink Library
58 DEPENDS:=+libnl-genl +libnl-route +libnl-nf
59 endef
60
61 define Package/libnl-core/description
62 Common code for all netlink libraries
63 endef
64
65 define Package/libnl-genl/description
66 Generic Netlink Library Functions
67 endef
68
69 define Package/libnl-route/description
70 Routing Netlink Library Functions
71 endef
72
73 define Package/libnl-nf/description
74 Netfilter Netlink Library Functions
75 endef
76
77 define Package/libnl/description
78 Socket handling, connection management, sending and receiving of data,
79 message construction and parsing, object caching system, etc.
80 endef
81
82 TARGET_CFLAGS += -ffunction-sections -fdata-sections $(FPIC)
83
84 CONFIGURE_ARGS += \
85 --disable-debug
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 endef
104
105 define Package/libnl-genl/install
106 $(INSTALL_DIR) $(1)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so.* $(1)/usr/lib/
108 endef
109
110 define Package/libnl-route/install
111 $(INSTALL_DIR) $(1)/usr/lib
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so.* $(1)/usr/lib/
113 endef
114
115 define Package/libnl-nf/install
116 $(INSTALL_DIR) $(1)/usr/lib
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/
118 endef
119
120 define Package/libnl/install
121 :
122 endef
123
124 $(eval $(call BuildPackage,libnl-core))
125 $(eval $(call BuildPackage,libnl-genl))
126 $(eval $(call BuildPackage,libnl-route))
127 $(eval $(call BuildPackage,libnl-nf))
128 $(eval $(call BuildPackage,libnl))