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