iwinfo: move device info into -data package
authorJo-Philipp Wich <jo@mein.io>
Sun, 11 Jul 2021 13:59:48 +0000 (15:59 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 11 Jul 2021 16:16:49 +0000 (18:16 +0200)
Backport upstream patch a0a0e02 ("iwinfo: rename hardware.txt to devices.txt")
and split devices.txt (former hardware.txt) into a common libiwinfo-data
package to allow different libiwinfo versions to coexist without file
clashes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit c13d7c82aa4cd2cbf1f61bad857cd01b795318e3)

package/network/utils/iwinfo/Makefile
package/network/utils/iwinfo/patches/0001-iwinfo-rename-hardware.txt-to-devices.txt.patch [new file with mode: 0644]

index b3ef261369f5015f7edb3ad63f3e8e78c41c34ef..815c477988b51e1855c3319bc2670f7673d86609 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_RELEASE:=2
+PKG_RELEASE:=2.1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
@@ -26,7 +26,7 @@ define Package/libiwinfo
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=Generalized Wireless Information Library (iwinfo)
-  DEPENDS:=+libnl-tiny +libuci +libubus
+  DEPENDS:=+libnl-tiny +libuci +libubus +libiwinfo-data
   ABI_VERSION:=$(IWINFO_ABI_VERSION)
 endef
 
@@ -50,6 +50,12 @@ define Package/libiwinfo-lua/description
 endef
 
 
+define Package/libiwinfo-data
+  TITLE:=libiwinfo Lua binding
+  HIDDEN:=1
+endef
+
+
 define Package/iwinfo
   SECTION:=utils
   CATEGORY:=Utilities
@@ -90,8 +96,6 @@ endef
 define Package/libiwinfo/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so.$(IWINFO_ABI_VERSION) $(1)/usr/lib/libiwinfo.so.$(IWINFO_ABI_VERSION)
-       $(INSTALL_DIR) $(1)/usr/share/libiwinfo
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hardware.txt $(1)/usr/share/libiwinfo/hardware.txt
 endef
 
 define Package/libiwinfo-lua/install
@@ -99,6 +103,11 @@ define Package/libiwinfo-lua/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
 endef
 
+define Package/libiwinfo-data/install
+       $(INSTALL_DIR) $(1)/usr/share/libiwinfo
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hardware.txt $(1)/usr/share/libiwinfo/devices.txt
+endef
+
 define Package/iwinfo/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo $(1)/usr/bin/iwinfo
@@ -106,4 +115,5 @@ endef
 
 $(eval $(call BuildPackage,libiwinfo))
 $(eval $(call BuildPackage,libiwinfo-lua))
+$(eval $(call BuildPackage,libiwinfo-data))
 $(eval $(call BuildPackage,iwinfo))
diff --git a/package/network/utils/iwinfo/patches/0001-iwinfo-rename-hardware.txt-to-devices.txt.patch b/package/network/utils/iwinfo/patches/0001-iwinfo-rename-hardware.txt-to-devices.txt.patch
new file mode 100644 (file)
index 0000000..f0cfaf3
--- /dev/null
@@ -0,0 +1,26 @@
+From a0a0e02dd91d14a50155390d5fd3b95d6ec87bf4 Mon Sep 17 00:00:00 2001
+From: Jo-Philipp Wich <jo@mein.io>
+Date: Sun, 11 Jul 2021 15:56:35 +0200
+Subject: [PATCH] iwinfo: rename hardware.txt to devices.txt
+
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+---
+ include/iwinfo.h            | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/iwinfo.h b/include/iwinfo.h
+index f7097cc..8469ee7 100644
+--- a/include/iwinfo.h
++++ b/include/iwinfo.h
+@@ -255,7 +255,7 @@ struct iwinfo_hardware_entry {
+ extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES[];
+-#define IWINFO_HARDWARE_FILE  "/usr/share/libiwinfo/hardware.txt"
++#define IWINFO_HARDWARE_FILE  "/usr/share/libiwinfo/devices.txt"
+ struct iwinfo_ops {
+-- 
+2.30.2
+