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.

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