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
3.9 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_SOURCE_DATE:=2019-08-20
  10. PKG_SOURCE_VERSION:=07ac3825b5069adc28e2547c16b1d983a8ed8d80
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/dyne/dnscrypt-proxy
  14. PKG_MIRROR_HASH:=c5c074f52732f14f026002bc48bdffcf0b212092de5798120209b2e6b65fc3e6
  15. PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  16. PKG_LICENSE:=ISC
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  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. 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. endef
  48. define Package/dnscrypt-proxy-resolvers/description
  49. Package with current list of dnscrypt-proxy resolvers.
  50. endef
  51. define Package/hostip
  52. $(call Package/dnscrypt-proxy/Default)
  53. DEPENDS:=+libsodium
  54. TITLE:=Resolver to IPv4 or IPv6 addresses
  55. endef
  56. define Package/hostip/description
  57. The DNSCrypt proxy ships with a simple tool named hostip that resolves a name
  58. to IPv4 or IPv6 addresses.
  59. endef
  60. define Package/dnscrypt-proxy/config
  61. source "$(SOURCE)/Config.in"
  62. endef
  63. define Build/Configure
  64. $(call Build/Configure/Default, \
  65. --prefix=/usr \
  66. --disable-ssp \
  67. $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS),,--disable-plugins) \
  68. )
  69. endef
  70. TARGET_CFLAGS += \
  71. -fomit-frame-pointer \
  72. -fdata-sections \
  73. -ffunction-sections
  74. TARGET_LDFLAGS += \
  75. -Wl,-gc-sections
  76. MAKE_FLAGS += \
  77. CFLAGS="$(TARGET_CFLAGS)" \
  78. LDFLAGS="$(TARGET_LDFLAGS)"
  79. define Package/dnscrypt-proxy/install
  80. $(INSTALL_DIR) $(1)/usr/sbin
  81. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnscrypt-proxy $(1)/usr/sbin/
  82. $(INSTALL_DIR) $(1)/etc/init.d
  83. $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
  84. $(INSTALL_DIR) $(1)/etc/config
  85. $(INSTALL_CONF) ./files/dnscrypt-proxy.config $(1)/etc/config/dnscrypt-proxy
  86. $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS), \
  87. $(INSTALL_DIR) $(1)/usr/lib/dnscrypt-proxy; \
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_cache.so $(1)/usr/lib/dnscrypt-proxy/; \
  89. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_aaaa_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
  90. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_logging.so $(1)/usr/lib/dnscrypt-proxy/)
  92. endef
  93. define Package/dnscrypt-proxy-resolvers/install
  94. $(INSTALL_DIR) $(1)/usr/share/dnscrypt-proxy
  95. $(CP) ./files/dnscrypt-resolvers.csv $(1)/usr/share/dnscrypt-proxy/
  96. endef
  97. define Package/dnscrypt-proxy/conffiles
  98. /etc/config/dnscrypt-proxy
  99. endef
  100. define Package/hostip/install
  101. $(INSTALL_DIR) $(1)/usr/bin
  102. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hostip $(1)/usr/bin/
  103. endef
  104. $(eval $(call BuildPackage,dnscrypt-proxy))
  105. $(eval $(call BuildPackage,dnscrypt-proxy-resolvers))
  106. $(eval $(call BuildPackage,hostip))