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.

130 lines
4.2 KiB

  1. #
  2. # Copyright (C) 2016 OpenWrt.org
  3. # Copyright (C) 2012-2016 Black Roland and contributors (https://github.com/black-roland/exOpenWrt/graphs/contributors)
  4. # Copyright (C) 2011-2012 Entware
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=dnscrypt-proxy
  11. PKG_VERSION:=1.9.5
  12. PKG_RELEASE:=7
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy \
  15. https://github.com/jedisct1/dnscrypt-proxy/releases/download/$(PKG_VERSION)
  16. PKG_HASH:=e89f5b9039979ab392302faf369ef7593155d5ea21580402a75bbc46329d1bb6
  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:=http://dnscrypt.org/
  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-20170530-60baef4-$(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))