Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2006-2013 OpenWrt.org
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=libnl
  7. PKG_VERSION:=3.7.0
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION))
  11. PKG_HASH:=9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939
  12. PKG_LICENSE:=LGPL-2.1
  13. PKG_LICENSE_FILES:=COPYING
  14. PKG_CPE_ID:=cpe:/a:libnl_project:libnl
  15. PKG_INSTALL:=1
  16. PKG_FIXUP:=autoreconf
  17. PKG_BUILD_FLAGS:=gc-sections
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/libnl/default
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. URL:=http://www.infradead.org/~tgr/libnl/
  23. ABI_VERSION:=200
  24. endef
  25. define Package/libnl-core
  26. $(call Package/libnl/default)
  27. TITLE:=Core Netlink Library
  28. DEPENDS:=+libpthread
  29. endef
  30. define Package/libnl-genl
  31. $(call Package/libnl/default)
  32. TITLE:=Generic Netlink Library
  33. DEPENDS:=+libnl-core
  34. endef
  35. define Package/libnl-route
  36. $(call Package/libnl/default)
  37. TITLE:=Routing Netlink Library
  38. DEPENDS:=+libnl-core
  39. endef
  40. define Package/libnl-nf
  41. $(call Package/libnl/default)
  42. TITLE:=Netfilter Netlink Library
  43. DEPENDS:=+libnl-route
  44. endef
  45. define Package/libnl-cli
  46. $(call Package/libnl/default)
  47. TITLE:=CLI Netlink Library
  48. DEPENDS:=+libnl-genl +libnl-nf
  49. endef
  50. define Package/libnl
  51. $(call Package/libnl/default)
  52. TITLE:=Full Netlink Library
  53. DEPENDS:=+libnl-genl +libnl-route +libnl-nf +libnl-cli
  54. endef
  55. define Package/libnl-core/description
  56. Common code for all netlink libraries
  57. endef
  58. define Package/libnl-genl/description
  59. Generic Netlink Library Functions
  60. endef
  61. define Package/libnl-route/description
  62. Routing Netlink Library Functions
  63. endef
  64. define Package/libnl-nf/description
  65. Netfilter Netlink Library Functions
  66. endef
  67. define Package/libnl-cli/description
  68. CLI Netlink Library Functions
  69. endef
  70. define Package/libnl/description
  71. Socket handling, connection management, sending and receiving of data,
  72. message construction and parsing, object caching system, etc.
  73. endef
  74. TARGET_CFLAGS += $(FPIC)
  75. CONFIGURE_ARGS += \
  76. --disable-debug
  77. define Build/InstallDev
  78. $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig
  79. $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  82. # Copy symlinks
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so $(1)/usr/lib/libnl-cli.so
  88. endef
  89. define Package/libnl-core/install
  90. $(INSTALL_DIR) $(1)/usr/lib
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so.* $(1)/usr/lib/
  92. endef
  93. define Package/libnl-genl/install
  94. $(INSTALL_DIR) $(1)/usr/lib
  95. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so.* $(1)/usr/lib/
  96. endef
  97. define Package/libnl-route/install
  98. $(INSTALL_DIR) $(1)/usr/lib
  99. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so.* $(1)/usr/lib/
  100. endef
  101. define Package/libnl-nf/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/
  104. endef
  105. define Package/libnl-cli/install
  106. $(INSTALL_DIR) $(1)/usr/lib
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so.* $(1)/usr/lib/
  108. endef
  109. define Package/libnl/install
  110. :
  111. endef
  112. $(eval $(call BuildPackage,libnl-core))
  113. $(eval $(call BuildPackage,libnl-genl))
  114. $(eval $(call BuildPackage,libnl-route))
  115. $(eval $(call BuildPackage,libnl-nf))
  116. $(eval $(call BuildPackage,libnl-cli))
  117. $(eval $(call BuildPackage,libnl))