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.

79 lines
2.5 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.7.0
  7. PKG_RELEASE:=2
  8. PKG_LICENSE:=BSD-3-Clause
  9. PKG_LICENSE_FILES:=LICENSE
  10. PKG_MAINTAINER:=
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://getdnsapi.net/dist/
  13. PKG_HASH:=ea8713ce5e077ac76b1418ceb6afd25e6d4e39e9600f6f5e81d3a3a13a60f652
  14. CMAKE_INSTALL:=1
  15. PKG_CONFIG_DEPENDS:= \
  16. CONFIG_GETDNS_BUILD_LIBEVENT2 \
  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_BUILD_LIBEVENT2:libevent2 +!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_LIBUV=OFF
  44. CMAKE_OPTIONS += -DBUILD_LIBEVENT2=$(if $(CONFIG_GETDNS_BUILD_LIBEVENT2),ON,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 += -DBSD_LIBRARY=OFF
  52. # Disable static linking to ensure that utility programs such as getdns_query
  53. # don't end up as large statically linked binaries.
  54. CMAKE_OPTIONS += -DENABLE_STATIC=OFF
  55. CMAKE_OPTIONS += -DENABLE_SHARED=ON # This is the default
  56. define Package/getdns/install
  57. $(INSTALL_DIR) $(1)/usr/lib
  58. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns.so.* $(1)/usr/lib/
  59. $(INSTALL_DIR) $(1)/usr/sbin
  60. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getdns_query $(1)/usr/sbin/getdns_query
  61. endef
  62. $(eval $(call BuildPackage,getdns))