iwinfo: update to latest git HEAD
[openwrt/openwrt.git] / package / network / utils / iwinfo / Makefile
1 #
2 # Copyright (C) 2010-2016 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the GPL 2 license.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=libiwinfo
10 PKG_RELEASE:=1
11
12 PKG_SOURCE_PROTO:=git
13 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
14 PKG_SOURCE_DATE:=2018-01-16
15 PKG_SOURCE_VERSION:=5a5e21b158ae48b86339d337823a01a0f132b09c
16 PKG_MIRROR_HASH:=afca1f5588aff47fdd4ec7ecd4c46f2b8027de7d0d70901f0eaf486887c3265c
17 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
18 PKG_LICENSE:=GPL-2.0
19
20 PKG_FLAGS := nonshared
21
22 PKG_CONFIG_DEPENDS := \
23 CONFIG_PACKAGE_kmod-brcm-wl \
24 CONFIG_PACKAGE_kmod-brcm-wl-mini \
25 CONFIG_PACKAGE_kmod-brcm-wl-mimo \
26 CONFIG_PACKAGE_kmod-cfg80211
27
28 include $(INCLUDE_DIR)/package.mk
29
30
31 define Package/libiwinfo
32 SECTION:=libs
33 CATEGORY:=Libraries
34 TITLE:=Generalized Wireless Information Library (iwinfo)
35 DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci
36 ABI_VERSION:=$(PKG_RELEASE)
37 endef
38
39 define Package/libiwinfo/description
40 Wireless information library with consistent interface for proprietary Broadcom,
41 nl80211 and wext driver interfaces.
42 endef
43
44
45 define Package/libiwinfo-lua
46 SUBMENU:=Lua
47 SECTION:=lang
48 CATEGORY:=Languages
49 TITLE:=libiwinfo Lua binding
50 DEPENDS:=+libiwinfo +liblua
51 endef
52
53 define Package/libiwinfo-lua/description
54 This is the Lua binding for the iwinfo library. It provides access to all enabled
55 backends.
56 endef
57
58
59 define Package/iwinfo
60 SECTION:=utils
61 CATEGORY:=Utilities
62 TITLE:=Generalized Wireless Information utility
63 DEPENDS:=+libiwinfo
64 endef
65
66 define Package/iwinfo/description
67 Command line frontend for the wireless information library.
68 endef
69
70
71 define Build/Configure
72 endef
73
74 IWINFO_BACKENDS := \
75 $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \
76 $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mini),wl) \
77 $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mimo),wl) \
78 $(if $(CONFIG_PACKAGE_kmod-cfg80211),nl80211)
79
80 TARGET_CFLAGS += \
81 -I$(STAGING_DIR)/usr/include/libnl-tiny \
82 -I$(STAGING_DIR)/usr/include \
83 -D_GNU_SOURCE
84
85 MAKE_FLAGS += \
86 FPIC="$(FPIC)" \
87 CFLAGS="$(TARGET_CFLAGS)" \
88 LDFLAGS="$(TARGET_LDFLAGS)" \
89 BACKENDS="$(IWINFO_BACKENDS)"
90
91 define Build/InstallDev
92 $(INSTALL_DIR) $(1)/usr/include/iwinfo
93 $(CP) $(PKG_BUILD_DIR)/include/iwinfo.h $(1)/usr/include/
94 $(CP) $(PKG_BUILD_DIR)/include/iwinfo/* $(1)/usr/include/iwinfo/
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so
97 $(INSTALL_DIR) $(1)/usr/lib/lua
98 $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
99 endef
100
101 define Package/libiwinfo/install
102 $(INSTALL_DIR) $(1)/usr/lib
103 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so
104 $(INSTALL_DIR) $(1)/usr/share/libiwinfo
105 $(INSTALL_DATA) $(PKG_BUILD_DIR)/hardware.txt $(1)/usr/share/libiwinfo/hardware.txt
106 endef
107
108 define Package/libiwinfo-lua/install
109 $(INSTALL_DIR) $(1)/usr/lib/lua
110 $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
111 endef
112
113 define Package/iwinfo/install
114 $(INSTALL_DIR) $(1)/usr/bin
115 $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo $(1)/usr/bin/iwinfo
116 endef
117
118 $(eval $(call BuildPackage,libiwinfo))
119 $(eval $(call BuildPackage,libiwinfo-lua))
120 $(eval $(call BuildPackage,iwinfo))