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.

131 lines
4.1 KiB

  1. #
  2. # Copyright (C) 2018 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=dnscrypt-proxy
  9. PKG_VERSION:=1.9.5
  10. PKG_RELEASE:=8
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_VERSION:=f71ca699aa3399f0c103c1f13ce1a86f9ce9638c
  14. PKG_SOURCE_URL:=https://github.com/dyne/dnscrypt-proxy
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_MIRROR_HASH:=a3a52f7f85b390184695db688c9837bf51cf25c4cb2c1093bb315640dbd2a54f
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  20. PKG_LICENSE:=ISC
  21. PKG_CONFIG_DEPENDS:= \
  22. CONFIG_DNSCRYPT_ENABLE_PLUGINS
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/dnscrypt-proxy/Default
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=IP Addresses and Names
  28. URL:=https://github.com/dyne/dnscrypt-proxy
  29. MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  30. endef
  31. define Package/dnscrypt-proxy
  32. $(call Package/dnscrypt-proxy/Default)
  33. DEPENDS:=+libsodium +dnscrypt-proxy-resolvers +DNSCRYPT_ENABLE_PLUGINS:libltdl \
  34. +DNSCRYPT_ENABLE_PLUGINS:libldns
  35. TITLE:=A tool for securing communications between a client and a DNS resolver
  36. endef
  37. define Package/dnscrypt-proxy/description
  38. dnscrypt-proxy provides local service which can be used directly as your
  39. local resolver or as a DNS forwarder, encrypting and authenticating requests
  40. using the DNSCrypt protocol and passing them to an upstream server.
  41. The DNSCrypt protocol uses high-speed high-security elliptic-curve cryptography
  42. and is very similar to DNSCurve, but focuses on securing communications between
  43. a client and its first-level resolver.
  44. endef
  45. define Package/dnscrypt-proxy-resolvers
  46. $(call Package/dnscrypt-proxy/Default)
  47. TITLE:=Package with current list of dnscrypt-proxy resolvers
  48. VERSION:=$(PKG_VERSION)+git-20171001-2d43be3-$(PKG_RELEASE)
  49. endef
  50. define Package/dnscrypt-proxy-resolvers/description
  51. Package with current list of dnscrypt-proxy resolvers.
  52. endef
  53. define Package/hostip
  54. $(call Package/dnscrypt-proxy/Default)
  55. DEPENDS:=+libsodium
  56. TITLE:=Resolver to IPv4 or IPv6 addresses
  57. endef
  58. define Package/hostip/description
  59. The DNSCrypt proxy ships with a simple tool named hostip that resolves a name
  60. to IPv4 or IPv6 addresses.
  61. endef
  62. define Package/dnscrypt-proxy/config
  63. source "$(SOURCE)/Config.in"
  64. endef
  65. define Build/Configure
  66. $(call Build/Configure/Default, \
  67. --prefix=/usr \
  68. --disable-ssp \
  69. $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS),,--disable-plugins) \
  70. )
  71. endef
  72. TARGET_CFLAGS += \
  73. -fomit-frame-pointer \
  74. -fdata-sections \
  75. -ffunction-sections
  76. TARGET_LDFLAGS += \
  77. -Wl,-gc-sections
  78. MAKE_FLAGS += \
  79. CFLAGS="$(TARGET_CFLAGS)" \
  80. LDFLAGS="$(TARGET_LDFLAGS)"
  81. define Package/dnscrypt-proxy/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnscrypt-proxy $(1)/usr/sbin/
  84. $(INSTALL_DIR) $(1)/etc/init.d
  85. $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
  86. $(INSTALL_DIR) $(1)/etc/config
  87. $(INSTALL_CONF) ./files/dnscrypt-proxy.config $(1)/etc/config/dnscrypt-proxy
  88. $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS), \
  89. $(INSTALL_DIR) $(1)/usr/lib/dnscrypt-proxy; \
  90. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_cache.so $(1)/usr/lib/dnscrypt-proxy/; \
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_aaaa_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
  92. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
  93. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_logging.so $(1)/usr/lib/dnscrypt-proxy/)
  94. endef
  95. define Package/dnscrypt-proxy-resolvers/install
  96. $(INSTALL_DIR) $(1)/usr/share/dnscrypt-proxy
  97. $(CP) ./files/dnscrypt-resolvers.csv $(1)/usr/share/dnscrypt-proxy/
  98. endef
  99. define Package/dnscrypt-proxy/conffiles
  100. /etc/config/dnscrypt-proxy
  101. endef
  102. define Package/hostip/install
  103. $(INSTALL_DIR) $(1)/usr/bin
  104. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hostip $(1)/usr/bin/
  105. endef
  106. $(eval $(call BuildPackage,dnscrypt-proxy))
  107. $(eval $(call BuildPackage,dnscrypt-proxy-resolvers))
  108. $(eval $(call BuildPackage,hostip))