Bläddra i källkod

Import net/unbound package from Subversion

This is an import of the net/unbound package from Subversion
revision 40658 (May 2, 2014). The only change is the addition of
PKG_LICENSE, PKG_LICENSE_FILE and PKG_MAINTAINER to Makefile.
Unbound 1.4.22 is the current upstream release.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Michael Hanselmann 10 år sedan
förälder
incheckning
6f2ceb74b9

+ 176
- 0
net/unbound/Makefile Visa fil

@@ -0,0 +1,176 @@
1
+#
2
+# Copyright (C) 2010-2014 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.4.22
12
+PKG_RELEASE:=1
13
+
14
+PKG_LICENSE:=BSD-3-Clause
15
+PKG_LICENSE_FILE:=LICENSE
16
+PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
17
+
18
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19
+PKG_SOURCE_URL:=http://www.unbound.net/downloads
20
+PKG_MD5SUM:=59728c74fef8783f8bad1d7451eba97f
21
+
22
+PKG_BUILD_DEPENDS:=libexpat
23
+PKG_BUILD_PARALLEL:=1
24
+PKG_FIXUP:=autoreconf
25
+PKG_INSTALL:=1
26
+
27
+include $(INCLUDE_DIR)/package.mk
28
+
29
+define Package/unbound/Default
30
+  TITLE:=A validating, recursive & caching DNS resolver
31
+  URL:=http://www.unbound.net/
32
+  DEPENDS:=+libopenssl
33
+endef
34
+
35
+define Package/unbound
36
+  $(call Package/unbound/Default)
37
+  SECTION:=net
38
+  CATEGORY:=Network
39
+  SUBMENU:=IP Addresses and Names
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+= (anchor 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 utility)
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+= (DNS 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
+endef
106
+
107
+define Package/libunbound/description
108
+  This package contains the Unbound shared library.
109
+endef
110
+
111
+CONFIGURE_ARGS += \
112
+	--disable-ecdsa \
113
+	--disable-gost \
114
+	--enable-allsymbols \
115
+	--with-libexpat="$(STAGING_DIR)/usr" \
116
+	--with-ssl="$(STAGING_DIR)/usr" \
117
+	--without-pthreads
118
+
119
+define Package/unbound/conffiles
120
+/etc/unbound/unbound.conf
121
+endef
122
+
123
+define Build/InstallDev
124
+	$(INSTALL_DIR) $(1)/usr/include
125
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
126
+	$(INSTALL_DIR) $(1)/usr/lib
127
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
128
+endef
129
+
130
+define Package/unbound/install
131
+	$(INSTALL_DIR) $(1)/usr/sbin
132
+	$(CP) \
133
+		$(PKG_INSTALL_DIR)/usr/sbin/unbound \
134
+		$(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf \
135
+		$(1)/usr/sbin/
136
+	$(INSTALL_DIR) $(1)/etc/unbound
137
+	$(INSTALL_CONF) \
138
+		$(PKG_INSTALL_DIR)/etc/unbound/unbound.conf \
139
+		$(1)/etc/unbound/
140
+	$(INSTALL_CONF) ./files/root.key $(1)/etc/unbound/
141
+	$(INSTALL_CONF) ./files/named.cache $(1)/etc/unbound/
142
+	$(INSTALL_DIR) $(1)/etc/init.d
143
+	$(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
144
+endef
145
+
146
+define Package/unbound-anchor/install
147
+	$(INSTALL_DIR) $(1)/usr/sbin
148
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
149
+endef
150
+
151
+define Package/unbound-control/install
152
+	$(INSTALL_DIR) $(1)/usr/sbin
153
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
154
+endef
155
+
156
+define Package/unbound-control-setup/install
157
+	$(INSTALL_DIR) $(1)/usr/sbin
158
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
159
+endef
160
+
161
+define Package/unbound-host/install
162
+	$(INSTALL_DIR) $(1)/usr/sbin
163
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
164
+endef
165
+
166
+define Package/libunbound/install
167
+	$(INSTALL_DIR) $(1)/usr/lib
168
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
169
+endef
170
+
171
+$(eval $(call BuildPackage,unbound))
172
+$(eval $(call BuildPackage,unbound-anchor))
173
+$(eval $(call BuildPackage,unbound-control))
174
+$(eval $(call BuildPackage,unbound-control-setup))
175
+$(eval $(call BuildPackage,unbound-host))
176
+$(eval $(call BuildPackage,libunbound))

+ 89
- 0
net/unbound/files/named.cache Visa fil

@@ -0,0 +1,89 @@
1
+;       This file holds the information on root name servers needed to
2
+;       initialize cache of Internet domain name servers
3
+;       (e.g. reference this file in the "cache  .  <file>"
4
+;       configuration file of BIND domain name servers).
5
+;
6
+;       This file is made available by InterNIC 
7
+;       under anonymous FTP as
8
+;           file                /domain/named.cache
9
+;           on server           FTP.INTERNIC.NET
10
+;       -OR-                    RS.INTERNIC.NET
11
+;
12
+;       last update:    Mar 26, 2014
13
+;       related version of root zone:   2014032601
14
+;
15
+; formerly NS.INTERNIC.NET
16
+;
17
+.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
18
+A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
19
+A.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:BA3E::2:30
20
+;
21
+; FORMERLY NS1.ISI.EDU
22
+;
23
+.                        3600000      NS    B.ROOT-SERVERS.NET.
24
+B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
25
+;
26
+; FORMERLY C.PSI.NET
27
+;
28
+.                        3600000      NS    C.ROOT-SERVERS.NET.
29
+C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
30
+C.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2::C
31
+;
32
+; FORMERLY TERP.UMD.EDU
33
+;
34
+.                        3600000      NS    D.ROOT-SERVERS.NET.
35
+D.ROOT-SERVERS.NET.      3600000      A     199.7.91.13
36
+D.ROOT-SERVERS.NET.	 3600000      AAAA  2001:500:2D::D
37
+;
38
+; FORMERLY NS.NASA.GOV
39
+;
40
+.                        3600000      NS    E.ROOT-SERVERS.NET.
41
+E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
42
+;
43
+; FORMERLY NS.ISC.ORG
44
+;
45
+.                        3600000      NS    F.ROOT-SERVERS.NET.
46
+F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
47
+F.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2F::F
48
+;
49
+; FORMERLY NS.NIC.DDN.MIL
50
+;
51
+.                        3600000      NS    G.ROOT-SERVERS.NET.
52
+G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
53
+;
54
+; FORMERLY AOS.ARL.ARMY.MIL
55
+;
56
+.                        3600000      NS    H.ROOT-SERVERS.NET.
57
+H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
58
+H.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:1::803F:235
59
+;
60
+; FORMERLY NIC.NORDU.NET
61
+;
62
+.                        3600000      NS    I.ROOT-SERVERS.NET.
63
+I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
64
+I.ROOT-SERVERS.NET.      3600000      AAAA  2001:7FE::53
65
+;
66
+; OPERATED BY VERISIGN, INC.
67
+;
68
+.                        3600000      NS    J.ROOT-SERVERS.NET.
69
+J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
70
+J.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:C27::2:30
71
+;
72
+; OPERATED BY RIPE NCC
73
+;
74
+.                        3600000      NS    K.ROOT-SERVERS.NET.
75
+K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
76
+K.ROOT-SERVERS.NET.      3600000      AAAA  2001:7FD::1
77
+;
78
+; OPERATED BY ICANN
79
+;
80
+.                        3600000      NS    L.ROOT-SERVERS.NET.
81
+L.ROOT-SERVERS.NET.      3600000      A     199.7.83.42
82
+L.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:3::42
83
+;
84
+; OPERATED BY WIDE
85
+;
86
+.                        3600000      NS    M.ROOT-SERVERS.NET.
87
+M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
88
+M.ROOT-SERVERS.NET.      3600000      AAAA  2001:DC3::35
89
+; End of File

+ 1
- 0
net/unbound/files/root.key Visa fil

@@ -0,0 +1 @@
1
+. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5

+ 14
- 0
net/unbound/files/unbound.init Visa fil

@@ -0,0 +1,14 @@
1
+#!/bin/sh /etc/rc.common
2
+#Copyright (C) 2010 Ondrej Caletka <o.caletka@sh.cvut.cz>
3
+START=61
4
+
5
+start () {
6
+	unbound
7
+}
8
+
9
+stop () {
10
+	PIDFILE='/var/run/unbound.pid'
11
+	if [ -f $PIDFILE ] ; then
12
+		kill $(cat $PIDFILE)
13
+	fi
14
+}

+ 154
- 0
net/unbound/patches/001-conf.patch Visa fil

@@ -0,0 +1,154 @@
1
+--- a/doc/example.conf.in
2
++++ b/doc/example.conf.in
3
+@@ -38,6 +38,8 @@ server:
4
+ 	# interface: 192.0.2.154
5
+ 	# interface: 192.0.2.154@5003
6
+ 	# interface: 2001:DB8::5
7
++	interface: 0.0.0.0
8
++	interface: ::0
9
+ 
10
+ 	# enable this feature to copy the source address of queries to reply.
11
+ 	# Socket options are not supported on all platforms. experimental. 
12
+@@ -57,6 +59,7 @@ server:
13
+ 	# port range that can be open simultaneously.  About double the
14
+ 	# num-queries-per-thread, or, use as many as the OS will allow you.
15
+ 	# outgoing-range: 4096
16
++	outgoing-range: 60
17
+ 
18
+ 	# permit unbound to use this port number or port range for
19
+ 	# making outgoing queries, using an outgoing interface.
20
+@@ -73,9 +76,11 @@ server:
21
+ 
22
+ 	# number of outgoing simultaneous tcp buffers to hold per thread.
23
+ 	# outgoing-num-tcp: 10
24
++	outgoing-num-tcp: 1
25
+ 
26
+ 	# number of incoming simultaneous tcp buffers to hold per thread.
27
+ 	# incoming-num-tcp: 10
28
++	incoming-num-tcp: 1
29
+ 
30
+ 	# buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
31
+ 	# 0 is system default.  Use 4m to catch query spikes for busy servers.
32
+@@ -99,18 +104,22 @@ server:
33
+ 	# buffer size for handling DNS data. No messages larger than this
34
+ 	# size can be sent or received, by UDP or TCP. In bytes.
35
+ 	# msg-buffer-size: 65552
36
++	msg-buffer-size: 8192
37
+ 
38
+ 	# the amount of memory to use for the message cache.
39
+ 	# plain value in bytes or you can append k, m or G. default is "4Mb". 
40
+ 	# msg-cache-size: 4m
41
++	msg-cache-size: 100k
42
+ 
43
+ 	# the number of slabs to use for the message cache.
44
+ 	# the number of slabs must be a power of 2.
45
+ 	# more slabs reduce lock contention, but fragment memory usage.
46
+ 	# msg-cache-slabs: 4
47
++	msg-cache-slabs: 1
48
+ 
49
+ 	# the number of queries that a thread gets to service.
50
+ 	# num-queries-per-thread: 1024
51
++	num-queries-per-thread: 30
52
+ 
53
+ 	# if very busy, 50% queries run to completion, 50% get timeout in msec
54
+ 	# jostle-timeout: 200
55
+@@ -121,11 +130,13 @@ server:
56
+ 	# the amount of memory to use for the RRset cache.
57
+ 	# plain value in bytes or you can append k, m or G. default is "4Mb". 
58
+ 	# rrset-cache-size: 4m
59
++	rrset-cache-size: 100k
60
+ 
61
+ 	# the number of slabs to use for the RRset cache.
62
+ 	# the number of slabs must be a power of 2.
63
+ 	# more slabs reduce lock contention, but fragment memory usage.
64
+ 	# rrset-cache-slabs: 4
65
++	rrset-cache-slabs: 1
66
+ 
67
+ 	# the time to live (TTL) value lower bound, in seconds. Default 0.
68
+ 	# If more than an hour could easily give trouble due to stale data.
69
+@@ -143,9 +154,11 @@ server:
70
+ 	# the number of slabs must be a power of 2.
71
+ 	# more slabs reduce lock contention, but fragment memory usage.
72
+ 	# infra-cache-slabs: 4
73
++	infra-cache-slabs: 1
74
+ 
75
+ 	# the maximum number of hosts that are cached (roundtrip, EDNS, lame).
76
+ 	# infra-cache-numhosts: 10000
77
++	infra-cache-numhosts: 200
78
+ 
79
+ 	# Enable IPv4, "yes" or "no".
80
+ 	# do-ip4: yes
81
+@@ -178,6 +191,8 @@ server:
82
+ 	# access-control: ::0/0 refuse
83
+ 	# access-control: ::1 allow
84
+ 	# access-control: ::ffff:127.0.0.1 allow
85
++	access-control: 0.0.0.0/0 allow
86
++	access-control: ::0/0 allow
87
+ 
88
+ 	# if given, a chroot(2) is done to the given directory.
89
+ 	# i.e. you can chroot to the working directory, for example,
90
+@@ -208,6 +223,7 @@ server:
91
+ 	# and the given username is assumed. Default is user "unbound".
92
+ 	# If you give "" no privileges are dropped.
93
+ 	# username: "@UNBOUND_USERNAME@"
94
++	username: ""
95
+ 
96
+ 	# the working directory. The relative files in this config are 
97
+ 	# relative to this directory. If you give "" the working directory
98
+@@ -230,10 +246,12 @@ server:
99
+ 
100
+ 	# the pid file. Can be an absolute path outside of chroot/work dir.
101
+ 	# pidfile: "@UNBOUND_PIDFILE@"
102
++	pidfile: "/var/run/unbound.pid"
103
+ 
104
+ 	# file to read root hints from.
105
+ 	# get one from ftp://FTP.INTERNIC.NET/domain/named.cache
106
+ 	# root-hints: ""
107
++	root-hints: "/etc/unbound/named.cache"
108
+ 
109
+ 	# enable to not answer id.server and hostname.bind queries.
110
+ 	# hide-identity: no
111
+@@ -256,12 +274,15 @@ server:
112
+ 	#	positive value: fetch that many targets opportunistically.
113
+ 	# Enclose the list of numbers between quotes ("").
114
+ 	# target-fetch-policy: "3 2 1 0 0"
115
++	target-fetch-policy: "2 1 0 0 0 0"
116
+ 
117
+ 	# Harden against very small EDNS buffer sizes. 
118
+ 	# harden-short-bufsize: no
119
++	harden-short-bufsize: yes
120
+ 
121
+ 	# Harden against unseemly large queries.
122
+ 	# harden-large-queries: no
123
++	harden-large-queries: yes
124
+ 
125
+ 	# Harden against out of zone rrsets, to avoid spoofing attempts. 
126
+ 	# harden-glue: yes
127
+@@ -342,7 +363,7 @@ server:
128
+ 	# you start unbound (i.e. in the system boot scripts).  And enable:
129
+ 	# Please note usage of unbound-anchor root anchor is at your own risk
130
+ 	# and under the terms of our LICENSE (see that file in the source).
131
+-	# auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
132
++	auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
133
+ 
134
+ 	# File with DLV trusted keys. Same format as trust-anchor-file.
135
+ 	# There can be only one DLV configured, it is trusted from root down.
136
+@@ -428,15 +449,18 @@ server:
137
+ 	# the amount of memory to use for the key cache.
138
+ 	# plain value in bytes or you can append k, m or G. default is "4Mb". 
139
+ 	# key-cache-size: 4m
140
++	key-cache-size: 100k
141
+ 
142
+ 	# the number of slabs to use for the key cache.
143
+ 	# the number of slabs must be a power of 2.
144
+ 	# more slabs reduce lock contention, but fragment memory usage.
145
+ 	# key-cache-slabs: 4
146
++	key-cache-slabs: 1
147
+ 
148
+ 	# the amount of memory to use for the negative cache (used for DLV).
149
+ 	# plain value in bytes or you can append k, m or G. default is "1Mb". 
150
+ 	# neg-cache-size: 1m
151
++	neg-cache-size: 10k
152
+ 
153
+ 	# By default, for a number of zones a small default 'nothing here'
154
+ 	# reply is built-in.  Query traffic is thus blocked.  If you