dnscrypt-proxy: Update to latest git version.
[feed/packages.git] / net / dnscrypt-proxy / Makefile
1 #
2 # Copyright (C) 2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=dnscrypt-proxy
11 PKG_SOURCE_DATE:=2019-08-20
12 PKG_SOURCE_VERSION:=07ac3825b5069adc28e2547c16b1d983a8ed8d80
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/dyne/dnscrypt-proxy
17 PKG_MIRROR_HASH:=c5c074f52732f14f026002bc48bdffcf0b212092de5798120209b2e6b65fc3e6
18
19 PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
20 PKG_LICENSE:=ISC
21 PKG_LICENSE_FILES:=COPYING
22
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25 PKG_BUILD_PARALLEL:=1
26 PKG_CONFIG_DEPENDS:= \
27 CONFIG_DNSCRYPT_ENABLE_PLUGINS
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/dnscrypt-proxy/Default
32 SECTION:=net
33 CATEGORY:=Network
34 SUBMENU:=IP Addresses and Names
35 URL:=https://github.com/dyne/dnscrypt-proxy
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 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))