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