You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.4 KiB

  1. # This is free software, licensed under the GNU General Public License v2.
  2. # See /LICENSE for more information.
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=getdns
  6. PKG_VERSION:=1.6.0
  7. PKG_RELEASE:=5
  8. PKG_LICENSE:=BSD-3-Clause
  9. PKG_LICENSE_FILES:=LICENSE
  10. PKG_MAINTAINER:=Jonathan Underwood <jonathan.underwood@gmail.com>
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://getdnsapi.net/dist/
  13. PKG_HASH:=40e5737471a3902ba8304b0fd63aa7c95802f66ebbc6eae53c487c8e8a380f4a
  14. CMAKE_INSTALL:=1
  15. PKG_CONFIG_DEPENDS:= \
  16. CONFIG_GETDNS_ENABLE_STUB_ONLY \
  17. CONFIG_GETDNS_ENABLE_IDN_LIBIDN2
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../../devel/ninja/ninja-cmake.mk
  20. define Package/getdns/Default
  21. TITLE:=getdns
  22. URL:=https://getdnsapi.net/
  23. endef
  24. define Package/getdns
  25. $(call Package/getdns/Default)
  26. SECTION:=libs
  27. CATEGORY:=Libraries
  28. TITLE+= (library)
  29. DEPENDS+= +libopenssl +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN2:libidn2
  30. MENU:=1
  31. endef
  32. define Package/getdns/description
  33. This package contains the getdns library (libgetdns).
  34. This package also contains the "getdns_query" command line wrapper for getdns exposing the features of this implementation (both in the official API and the additional API functions).
  35. endef
  36. define Package/getdns/config
  37. source "$(SOURCE)/Config.in"
  38. endef
  39. # CMAKE options for GetDNS are described in this document:
  40. # https://getdnsapi.net/quick-start/cmake-quick-start/
  41. CMAKE_OPTIONS += -DBUILD_LIBEV=OFF
  42. CMAKE_OPTIONS += -DBUILD_LIBEVENT2=OFF
  43. CMAKE_OPTIONS += -DBUILD_LIBUV=OFF
  44. CMAKE_OPTIONS += -DENABLE_STUB_ONLY=$(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY),ON,OFF)
  45. CMAKE_OPTIONS += -DUSE_LIBIDN2=$(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2),ON,OFF)
  46. # getdns will use libbsd for the functions inet_pton, inet_ntop, strlcpy if
  47. # present, otherwise it will use builtin code for these functions. In order to
  48. # force the use of the built in code and remove the libbsd dependency disable
  49. # the test for libbsd.
  50. CMAKE_OPTIONS += -DBSD_LIBRARY=OFF
  51. # Disable static linking to ensure that utility programs such as getdns_query
  52. # don't end up as large statically linked binaries.
  53. CMAKE_OPTIONS += -DENABLE_STATIC=OFF
  54. CMAKE_OPTIONS += -DENABLE_SHARED=ON # This is the default
  55. define Package/getdns/install
  56. $(INSTALL_DIR) $(1)/usr/lib
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns.so.* $(1)/usr/lib/
  58. $(INSTALL_DIR) $(1)/usr/sbin
  59. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getdns_query $(1)/usr/sbin/getdns_query
  60. endef
  61. $(eval $(call BuildPackage,getdns))