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