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.

87 lines
2.8 KiB

  1. #
  2. # Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
  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-proxy2
  9. PKG_VERSION:=2.1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=dnscrypt-proxy-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/DNSCrypt/dnscrypt-proxy/tar.gz/$(PKG_VERSION)?
  13. PKG_HASH:=4af43a2143a1d0f9b430f5f08981417cb4475cc590daf79d11c9a0487f72fadc
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/dnscrypt-proxy-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
  16. PKG_LICENSE:=ISC
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_BUILD_DEPENDS:=golang/host
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_USE_MIPS16:=0
  21. GO_PKG:=github.com/DNSCrypt/dnscrypt-proxy
  22. GO_PKG_LDFLAGS:=-s -w
  23. include $(INCLUDE_DIR)/package.mk
  24. include ../../lang/golang/golang-package.mk
  25. GO_MOD_ARGS:=
  26. GO_PKG_BUILD_VARS+= GO111MODULE=off
  27. define Package/dnscrypt-proxy2
  28. SECTION:=net
  29. CATEGORY:=Network
  30. TITLE:=Flexible DNS proxy with encrypted DNS protocols
  31. URL:=https://github.com/DNSCrypt/dnscrypt-proxy
  32. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  33. CONFLICTS:=dnscrypt-proxy
  34. endef
  35. define Package/dnscrypt-proxy2/install
  36. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  37. $(INSTALL_DIR) $(1)/usr/sbin
  38. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/sbin/
  39. $(INSTALL_DIR) $(1)/etc/dnscrypt-proxy2
  40. $(INSTALL_CONF) $(PKG_BUILD_DIR)/dnscrypt-proxy/example-dnscrypt-proxy.toml $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
  41. $(INSTALL_CONF) ./files/blocked-names.txt $(1)/etc/dnscrypt-proxy2/blocked-names.txt
  42. $(INSTALL_DIR) $(1)/etc/init.d
  43. $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
  44. sed -i "s/^listen_addresses = .*/listen_addresses = ['127.0.0.53:53']/" $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
  45. sed -i "s/^ # blocked_names_file = 'blocked-names.txt'/blocked_names_file = 'blocked-names.txt'/" $(1)/etc/dnscrypt-proxy2/dnscrypt-proxy.toml
  46. endef
  47. define Package/dnscrypt-proxy2/description
  48. A flexible DNS proxy, with support for modern encrypted DNS protocols
  49. such as DNSCrypt v2 and DNS-over-HTTPS.
  50. endef
  51. define Package/dnscrypt-proxy2/conffiles
  52. /etc/dnscrypt-proxy2/dnscrypt-proxy.toml
  53. endef
  54. define Package/golang-github-jedisct1-dnscrypt-proxy2-dev
  55. $(call Package/dnscrypt-proxy2)
  56. $(call GoPackage/GoSubMenu)
  57. TITLE+= (source files)
  58. PKGARCH:=all
  59. endef
  60. define Package/golang-github-jedisct1-dnscrypt-proxy2-dev/description
  61. $(call Package/dnscrypt-proxy2/description)
  62. This package provides the source files for the client/bridge program.
  63. endef
  64. $(eval $(call GoBinPackage,dnscrypt-proxy2))
  65. $(eval $(call BuildPackage,dnscrypt-proxy2))
  66. $(eval $(call GoSrcPackage,golang-github-jedisct1-dnscrypt-proxy2-dev))
  67. $(eval $(call BuildPackage,golang-github-jedisct1-dnscrypt-proxy2-dev))