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.

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