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