Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=libiwinfo
  8. PKG_RELEASE:=1
  9. PKG_SOURCE_PROTO:=git
  10. PKG_SOURCE_URL=$(PROJECT_GIT)/iwinfo.git
  11. PKG_SOURCE_DATE:=2023-07-01
  12. PKG_SOURCE_VERSION:=ca79f64154b107f192ec3c1ba631816cb8b07922
  13. PKG_MIRROR_HASH:=5eddf584a1c3ed5637162d6bfc573ed1ce3691fcb38bdd55bf9f1e11e82ccc46
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_BUILD_FLAGS:=no-lto
  17. IWINFO_ABI_VERSION:=20230701
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/libiwinfo
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE:=Generalized Wireless Information Library (iwinfo)
  23. DEPENDS:=+libnl-tiny +libuci +libubus +libiwinfo-data
  24. ABI_VERSION:=$(IWINFO_ABI_VERSION)
  25. endef
  26. define Package/libiwinfo/description
  27. Wireless information library with simplified API for nl80211
  28. and wext driver interfaces.
  29. endef
  30. define Package/libiwinfo-lua
  31. SUBMENU:=Lua
  32. SECTION:=lang
  33. CATEGORY:=Languages
  34. TITLE:=libiwinfo Lua binding
  35. DEPENDS:=+libiwinfo +liblua
  36. endef
  37. define Package/libiwinfo-lua/description
  38. This is the Lua binding for the iwinfo library. It provides access to all enabled
  39. backends.
  40. endef
  41. define Package/libiwinfo-data
  42. TITLE:=libiwinfo Lua binding
  43. HIDDEN:=1
  44. endef
  45. define Package/iwinfo
  46. SECTION:=utils
  47. CATEGORY:=Utilities
  48. TITLE:=Generalized Wireless Information utility
  49. DEPENDS:=+libiwinfo
  50. endef
  51. define Package/iwinfo/description
  52. Command line frontend for the wireless information library.
  53. endef
  54. define Build/Configure
  55. endef
  56. TARGET_CFLAGS += \
  57. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  58. -I$(STAGING_DIR)/usr/include \
  59. -D_GNU_SOURCE
  60. MAKE_FLAGS += \
  61. FPIC="$(FPIC)" \
  62. CFLAGS="$(TARGET_CFLAGS)" \
  63. LDFLAGS="$(TARGET_LDFLAGS)" \
  64. BACKENDS="nl80211" \
  65. SOVERSION="$(IWINFO_ABI_VERSION)"
  66. define Build/InstallDev
  67. $(INSTALL_DIR) $(1)/usr/include/iwinfo
  68. $(CP) $(PKG_BUILD_DIR)/include/iwinfo.h $(1)/usr/include/
  69. $(CP) $(PKG_BUILD_DIR)/include/iwinfo/* $(1)/usr/include/iwinfo/
  70. $(INSTALL_DIR) $(1)/usr/lib
  71. $(CP) $(PKG_BUILD_DIR)/libiwinfo.so* $(1)/usr/lib/
  72. $(INSTALL_DIR) $(1)/usr/lib/lua
  73. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
  74. endef
  75. define Package/libiwinfo/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so.$(IWINFO_ABI_VERSION) $(1)/usr/lib/libiwinfo.so.$(IWINFO_ABI_VERSION)
  78. endef
  79. define Package/libiwinfo-lua/install
  80. $(INSTALL_DIR) $(1)/usr/lib/lua
  81. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so
  82. endef
  83. define Package/libiwinfo-data/install
  84. $(INSTALL_DIR) $(1)/usr/share/libiwinfo
  85. $(INSTALL_DATA) $(PKG_BUILD_DIR)/devices.txt $(1)/usr/share/libiwinfo/devices.txt
  86. endef
  87. define Package/iwinfo/install
  88. $(INSTALL_DIR) $(1)/usr/bin
  89. $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo $(1)/usr/bin/iwinfo
  90. endef
  91. $(eval $(call BuildPackage,libiwinfo))
  92. $(eval $(call BuildPackage,libiwinfo-lua))
  93. $(eval $(call BuildPackage,libiwinfo-data))
  94. $(eval $(call BuildPackage,iwinfo))