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.

74 lines
2.3 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:=1
  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_BUILD_PARALLEL:=1
  16. PKG_CONFIG_DEPENDS:= \
  17. CONFIG_GETDNS_ENABLE_STUB_ONLY \
  18. CONFIG_GETDNS_ENABLE_IDN_LIBIDN2
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/getdns/Default
  22. TITLE:=getdns
  23. URL:=https://getdnsapi.net/
  24. endef
  25. define Package/getdns
  26. $(call Package/getdns/Default)
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE+= (library)
  30. DEPENDS+= +libopenssl +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN2:libidn2
  31. MENU:=1
  32. endef
  33. define Package/getdns/description
  34. This package contains the getdns library (libgetdns).
  35. 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).
  36. endef
  37. define Package/getdns/config
  38. source "$(SOURCE)/Config.in"
  39. endef
  40. # CMAKE options for GetDNS are described in this document:
  41. # https://getdnsapi.net/quick-start/cmake-quick-start/
  42. CMAKE_OPTIONS += -DBUILD_LIBEV=OFF
  43. CMAKE_OPTIONS += -DBUILD_LIBEVENT2=OFF
  44. CMAKE_OPTIONS += -DBUILD_LIBUV=OFF
  45. CMAKE_OPTIONS += -DENABLE_STUB_ONLY=$(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY),ON,OFF)
  46. CMAKE_OPTIONS += -DUSE_LIBIDN2=$(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2),ON,OFF)
  47. # getdns will use libbsd for the functions inet_pton, inet_ntop, strlcpy if
  48. # present, otherwise it will use builtin code for these functions. In order to
  49. # force the use of the built in code and remove the libbsd dependency disable
  50. # the test for libbsd.
  51. CMAKE_OPTIONS += -DCMAKE_DISABLE_FIND_PACKAGE_BSD=ON
  52. define Package/getdns/install
  53. $(INSTALL_DIR) $(1)/usr/lib
  54. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns.so.* $(1)/usr/lib/
  55. $(INSTALL_DIR) $(1)/usr/sbin
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getdns_query $(1)/usr/sbin/getdns_query
  57. endef
  58. $(eval $(call BuildPackage,getdns))