Move libexpat, unbound into core and introduce hnsd
[librecmc/librecmc.git] / package / network / services / unbound / Makefile
1 #
2 # Copyright (C) 2010-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:=unbound
11 PKG_VERSION:=1.7.3
12 PKG_RELEASE:=6
13
14 PKG_LICENSE:=BSD-3-Clause
15 PKG_LICENSE_FILES:=LICENSE
16 PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@gmail.com>
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=http://www.unbound.net/downloads
20 PKG_HASH:=c11de115d928a6b48b2165e0214402a7a7da313cd479203a7ce7a8b62cba602d
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/unbound/Default
29   TITLE:=Validating Recursive DNS Server
30   URL:=http://www.unbound.net/
31   DEPENDS:=+libopenssl
32 endef
33
34 define Package/unbound
35   $(call Package/unbound/Default)
36   SECTION:=net
37   CATEGORY:=Network
38   SUBMENU:=IP Addresses and Names
39   USERID:=unbound:unbound
40   TITLE+= (daemon)
41   DEPENDS+= +libunbound
42 endef
43
44 define Package/unbound/description
45   This package contains the Unbound daemon.
46 endef
47
48 define Package/unbound-anchor
49   $(call Package/unbound/Default)
50   SECTION:=net
51   CATEGORY:=Network
52   SUBMENU:=IP Addresses and Names
53   TITLE+= (DSKEY utility)
54   DEPENDS+= +unbound +libexpat
55 endef
56
57 define Package/unbound-anchor/description
58   This package contains the Unbound anchor utility.
59 endef
60
61 define Package/unbound-control
62   $(call Package/unbound/Default)
63   SECTION:=net
64   CATEGORY:=Network
65   SUBMENU:=IP Addresses and Names
66   TITLE+= (control utility)
67   DEPENDS+= +unbound
68 endef
69
70 define Package/unbound-control/description
71   This package contains the Unbound control utility.
72 endef
73
74 define Package/unbound-control-setup
75   $(call Package/unbound/Default)
76   SECTION:=net
77   CATEGORY:=Network
78   SUBMENU:=IP Addresses and Names
79   TITLE+= (control setup)
80   DEPENDS+= +unbound-control +openssl-util
81 endef
82
83 define Package/unbound-control-setup/description
84   This package contains the Unbound control setup utility.
85 endef
86
87 define Package/unbound-host
88   $(call Package/unbound/Default)
89   SECTION:=net
90   CATEGORY:=Network
91   SUBMENU:=IP Addresses and Names
92   TITLE+= (lookup utility)
93   DEPENDS+= +libunbound
94 endef
95
96 define Package/unbound-host/description
97   This package contains the Unbound DNS lookup utility.
98 endef
99
100 define Package/libunbound
101   $(call Package/unbound/Default)
102   SECTION:=libs
103   CATEGORY:=Libraries
104   TITLE+= (library)
105   DEPENDS+= +libpthread
106 endef
107
108 define Package/libunbound/description
109   This package contains the Unbound shared library.
110 endef
111
112 CONFIGURE_ARGS += \
113         --disable-dsa \
114         --disable-gost \
115         --enable-allsymbols \
116         --enable-tfo-client \
117         --enable-tfo-server \
118         --with-libexpat="$(STAGING_DIR)/usr" \
119         --with-ssl="$(STAGING_DIR)/usr" \
120         --with-user=unbound \
121         --with-run-dir=/var/lib/unbound \
122         --with-conf-file=/var/lib/unbound/unbound.conf \
123         --with-pidfile=/var/run/unbound.pid
124
125 define Package/unbound/conffiles
126 /etc/config/unbound
127 /etc/unbound/unbound.conf
128 /etc/unbound/unbound_ext.conf
129 /etc/unbound/unbound_srv.conf
130 endef
131
132 define Build/InstallDev
133         $(INSTALL_DIR) $(1)/usr/include
134         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
135         $(INSTALL_DIR) $(1)/usr/lib
136         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
137 endef
138
139 define Package/unbound/install
140         $(INSTALL_DIR) $(1)/usr/sbin
141         $(INSTALL_BIN) \
142                 $(PKG_INSTALL_DIR)/usr/sbin/unbound \
143                 $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf \
144                 $(1)/usr/sbin/
145         $(INSTALL_DIR) $(1)/etc/unbound
146         $(INSTALL_DATA) \
147                 $(PKG_INSTALL_DIR)/var/lib/unbound/unbound.conf \
148                 $(1)/etc/unbound/unbound.conf
149         $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
150         $(INSTALL_DATA) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
151         $(INSTALL_DATA) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
152         $(INSTALL_DIR) $(1)/etc/config
153         $(INSTALL_DATA) ./files/unbound.uci $(1)/etc/config/unbound
154         $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
155         $(INSTALL_BIN)  ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
156         $(INSTALL_DIR) $(1)/etc/init.d
157         $(INSTALL_BIN)  ./files/unbound.init $(1)/etc/init.d/unbound
158         $(INSTALL_DIR) $(1)/usr/lib/unbound
159         $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
160         $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
161         $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
162         $(INSTALL_BIN)  ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
163         $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
164         $(INSTALL_DATA) ./files/stopping.sh $(1)/usr/lib/unbound/stopping.sh
165         $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
166 endef
167
168 define Package/unbound-anchor/install
169         $(INSTALL_DIR) $(1)/usr/sbin
170         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
171 endef
172
173 define Package/unbound-control/install
174         $(INSTALL_DIR) $(1)/usr/sbin
175         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
176 endef
177
178 define Package/unbound-control-setup/install
179         $(INSTALL_DIR) $(1)/usr/sbin
180         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
181 endef
182
183 define Package/unbound-host/install
184         $(INSTALL_DIR) $(1)/usr/sbin
185         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
186 endef
187
188 define Package/libunbound/install
189         $(INSTALL_DIR) $(1)/usr/lib
190         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
191 endef
192
193 $(eval $(call BuildPackage,unbound))
194 $(eval $(call BuildPackage,unbound-anchor))
195 $(eval $(call BuildPackage,unbound-control))
196 $(eval $(call BuildPackage,unbound-control-setup))
197 $(eval $(call BuildPackage,unbound-host))
198 $(eval $(call BuildPackage,libunbound))
199