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