Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.3
  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:=f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c
  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))