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.

119 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2009-2014 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.4.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy
  13. PKG_MD5SUM:=54d172236a8f321fb5689ff81767f1ba
  14. PKG_FIXUP:=autoreconf
  15. PKG_INSTALL:=1
  16. PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  17. PKG_LICENSE:=ISC
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/dnscrypt-proxy/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. SUBMENU:=IP Addresses and Names
  23. DEPENDS:=+libsodium
  24. URL:=http://dnscrypt.org/
  25. MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
  26. endef
  27. define Package/dnscrypt-proxy
  28. $(call Package/dnscrypt-proxy/Default)
  29. TITLE:=A tool for securing communications between a client and a DNS resolver
  30. endef
  31. define Package/dnscrypt-proxy/description
  32. dnscrypt-proxy provides local service which can be used directly as your
  33. local resolver or as a DNS forwarder, encrypting and authenticating requests
  34. using the DNSCrypt protocol and passing them to an upstream server.
  35. The DNSCrypt protocol uses high-speed high-security elliptic-curve cryptography
  36. and is very similar to DNSCurve, but focuses on securing communications between
  37. a client and its first-level resolver.
  38. endef
  39. define Package/hostip
  40. $(call Package/dnscrypt-proxy/Default)
  41. TITLE:=Resolver to IPv4 or IPv6 addresses
  42. endef
  43. define Package/hostip/description
  44. The DNSCrypt proxy ships with a simple tool named hostip that resolves a name
  45. to IPv4 or IPv6 addresses.
  46. endef
  47. define Build/Configure
  48. $(call Build/Configure/Default, \
  49. --prefix=/usr \
  50. --disable-ssp \
  51. )
  52. endef
  53. TARGET_CFLAGS += \
  54. -fomit-frame-pointer \
  55. -fdata-sections \
  56. -ffunction-sections
  57. TARGET_LDFLAGS += \
  58. -Wl,-gc-sections
  59. MAKE_FLAGS += \
  60. CFLAGS="$(TARGET_CFLAGS)" \
  61. LDFLAGS="$(TARGET_LDFLAGS)"
  62. define Package/dnscrypt-proxy/install
  63. $(INSTALL_DIR) $(1)/usr/sbin
  64. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnscrypt-proxy $(1)/usr/sbin/
  65. $(INSTALL_DIR) $(1)/usr/share/dnscrypt-proxy
  66. $(CP) $(PKG_INSTALL_DIR)/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv $(1)/usr/share/dnscrypt-proxy/
  67. $(INSTALL_DIR) $(1)/etc/init.d
  68. $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
  69. $(INSTALL_DIR) $(1)/etc/config
  70. $(INSTALL_CONF) ./files/dnscrypt-proxy.config $(1)/etc/config/dnscrypt-proxy
  71. endef
  72. define Package/dnscrypt-proxy/postinst
  73. #!/bin/sh
  74. # check if we are on real system
  75. if [ -z "$${IPKG_INSTROOT}" ]; then
  76. echo "Enabling rc.d symlink for dnscrypt-proxy"
  77. /etc/init.d/dnscrypt-proxy enable
  78. fi
  79. exit 0
  80. endef
  81. define Package/dnscrypt-proxy/prerm
  82. #!/bin/sh
  83. # check if we are on real system
  84. if [ -z "$${IPKG_INSTROOT}" ]; then
  85. echo "Removing rc.d symlink for dnscrypt-proxy"
  86. /etc/init.d/dnscrypt-proxy disable
  87. fi
  88. exit 0
  89. endef
  90. define Package/dnscrypt-proxy/conffiles
  91. /etc/config/dnscrypt-proxy
  92. endef
  93. define Package/hostip/install
  94. $(INSTALL_DIR) $(1)/usr/bin
  95. $(CP) $(PKG_INSTALL_DIR)/usr/bin/hostip $(1)/usr/bin/
  96. endef
  97. $(eval $(call BuildPackage,dnscrypt-proxy))
  98. $(eval $(call BuildPackage,hostip))