]> git.pld-linux.org Git - packages/djbdns.git/blob - djbdns.spec
- patch updates by Tomasz Grobelny
[packages/djbdns.git] / djbdns.spec
1 # TODO: bcond patches
2 Summary:        DJB DNS
3 Summary(pl):    DJB DNS
4 Name:           djbdns
5 Version:        1.05
6 Release:        18
7 License:        http://cr.yp.to/distributors.html (free to use)
8 Group:          Networking/Daemons
9 Source0:        http://cr.yp.to/djbdns/%{name}-%{version}.tar.gz
10 # Source0-md5:  3147c5cd56832aa3b41955c7a51cbeb2
11 Source1:        %{name}-doc.tar.gz
12 # Source1-md5:  1d6aed1a5d3d3eda3958fa3e7d808fc8
13 Source2:        ftp://ftp.innominate.org/gpa/djb/%{name}-%{version}-man.tar.gz
14 # Source2-md5:  2b4e71fa4592858e4508538f78d50f61
15 Source3:        http://www.sericyb.com.au/tinydns-notify
16 # NoSource3-md5:        2213bdc8c58c10cb8770b7e5b0d67aea
17 Patch0:         dnscache-1.05-multiple-ip.patch
18 # adds IPv6 support
19 Patch1:         http://www.fefe.de/dns/%{name}-1.05-test21.diff.bz2
20 Patch3:         http://iksz.hu/package/djbdns-conf/djbdns-1.05-multi_tinydns_data.patch
21 Patch4:         %{name}-srv.patch
22 Patch5:         %{name}-glibc.patch
23 # http://www.iecc.com/rbldns-patch.txt
24 Patch6:         %{name}-rbldns_a.patch
25 # http://core.segfault.pl/~hobbit/tinydns-include.patch
26 Patch8:         %{name}-tinydns-include.patch
27 URL:            http://cr.yp.to/djbdns.html
28 BuildRequires:  rpm-perlprov
29 BuildRequires:  rpmbuild(macros) >= 1.159
30 Requires(pre):  /bin/id
31 Requires(pre):  /usr/bin/getgid
32 Requires(pre):  /usr/sbin/groupadd
33 Requires(pre):  /usr/sbin/useradd
34 Requires(postun):       /usr/sbin/groupdel
35 Requires(postun):       /usr/sbin/userdel
36 Provides:       group(djbdns)
37 Provides:       nameserver
38 Provides:       user(dnslog)
39 Obsoletes:      caching-nameserver
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 This is a set of DNS servers with security in mind. If you find a
44 security hole you can get a prize.
45
46 This package contains some basic DNS debugging tools and some
47 documentation. If you need a DNS server install one of the following
48 packages:
49
50  - djbdns-dnscache - a local DNS cache
51  - djbdns-tinydns - a DNS server
52  - djbdns-tinydns-notify - a tool to send NOTIFY requests
53  - djbdns-pickdns - a DNS load-balancing server
54  - djbdns-walldns - a reverse DNS wall
55  - djbdns-rbldns - an IP-address-listing DNS server
56  - djbdns-axfrdns - a DNS zone transfer server
57
58 %description -l de
59 Dies ist ein Satz von auf Sicherheit zielenden DNS-Servers. Man kriegt
60 ein Preis, wenn man ein Sicherheitsloch findet.
61
62 Dieses Paket enthält ein paar DNS-Werkzeugen und etwas Dokumentation.
63 Wenn du einen DNS-Server braucht, installe ein von den folgenden
64 Paketen:
65
66  - djbdns-dnscache - ein lokaler DNS-Cache
67  - djbdns-tinydns - ein DNS-Server
68  - djbdns-pickdns - ein Belastung ausgleichender DNS-Server
69  - djbdns-walldns - eine Wand Rückgekehrten DNSs
70  - djbdns-rbldns - ein IP-Adressen-Listen-DNS-Server
71  - djbdns-axfrdns - ein DNS-Zonen-Transfer-Server
72
73 %description -l pl
74 Jest to alternatywny zestaw serwerów DNS'u, którego g³ównym celem jest
75 bezpieczeñstwo. Za znalezienie dziury w tym systemie zosta³a
76 wyznaczona nawet nagroda.
77
78 Ten pakiet zawiera kilka podstawowych narzêdzi DNS oraz trochê
79 dokumentacji. Je¶li potrzebujesz serwera DNS zainstaluj jeden z
80 nastêpuj±cych pakietów:
81
82  - djbdns-dnscache - lokalny cache DNS
83  - djbdns-tinydns - serwer DNS
84  - djbdns-tinydns-notify - narzêdzie do wysy³ania komunikatów NOTIFY
85  - djbdns-pickdns - serwer DNS do równowa¿enia obci±¿eñ
86  - djbdns-walldns - ¶ciana dla odwrotnych zapytañ DNS
87  - djbdns-rbldns - serwer DNS list adresów IP
88  - djbdns-axfrdns - serwer transferów stref DNS
89
90 %package dnscache
91 Summary:        DJB's local DNS cache
92 Summary(de):    DJBs lokaler DNS-Cache
93 Summary(pl):    Lokalny cache DNS od DJB
94 Group:          Networking/Daemons
95 PreReq:         %{name} = %{version}
96 Requires(pre):  /bin/id
97 Requires(pre):  /usr/sbin/groupadd
98 Requires(pre):  /usr/sbin/useradd
99 Requires(postun):       /usr/sbin/userdel
100 Requires(postun):       /usr/sbin/groupdel
101 Requires(post): diffutils
102 Requires(post): fileutils
103 Requires(preun):        daemontools
104 Requires:       daemontools >= 0.70-5
105 Provides:       user(dnscache)
106 Obsoletes:      dnscache
107
108 %description dnscache
109 dnscache is a local DNS cache from the djbdns package. It accepts
110 recursive DNS queries from local clients such as web browsers and mail
111 transfer agents. It collects responses from remote DNS servers. It
112 caches the responses to save time later.
113
114 %description dnscache -l de
115 dnscache ist ein lokaler DNS-Cache aus dem djbdns-Paket. Es empfängt
116 rekursive DNS-Fragen von den lokalen Klienten, zum Beispiel
117 Web-Browsers und Mail-Transfer-Agenten. Es sammelt die Antworten von
118 den Fern-DNS-Servers. Es merkt sich die Antworten, um die Zeit später
119 zu sparen.
120
121 %description dnscache -l pl
122 dnscache jest lokalnym cachem DNS z pakietu djbdns. Przyjmuje on
123 rekursywne zapytania DNS od lokalnych klientów takich, jak
124 przegl±darki WWW i agenci transferu poczty (MTA). Zbiera on odpowiedzi
125 od zdalnych serwerów DNS. Zapamiêtuje on odpowiedzi, ¿eby pó¼niej
126 oszczêdziæ czas.
127
128 %package tinydns
129 Summary:        DJB's DNS server
130 Summary(de):    DJBs DNS-Server
131 Summary(pl):    Serwer DNS od DJB
132 Group:          Networking/Daemons
133 PreReq:         %{name} = %{version}
134 Requires(pre):  /bin/id
135 Requires(pre):  /usr/sbin/groupadd
136 Requires(pre):  /usr/sbin/useradd
137 Requires(postun):       /usr/sbin/userdel
138 Requires(postun):       /usr/sbin/groupdel
139 Requires(post): diffutils
140 Requires(preun):        daemontools
141 Requires:       daemontools >= 0.70-5
142 Requires:       make
143 Provides:       user(tinydns)
144 Obsoletes:      tinydns
145
146 %description tinydns
147 tinydns is a DNS server from the djbdns package. It accepts iterative
148 DNS queries from hosts around the Internet and responds with
149 locally-configured information.
150
151 %description tinydns -l de
152 tinydns ist ein DNS-Server aus dem djbdns-Paket. Es empfängt iterative
153 DNS-Fragen von dem Hosts aus allem Internet und antwortet mit den
154 lokal-konfigurierten Informationen.
155
156 %description tinydns -l pl
157 tinydns jest serwerem DNS z pakietu djbdns. Przyjmuje on iteracyjne
158 zapytania DNS od komputerów z ca³ego Internetu i odpowiada przy u¿yciu
159 lokalnie skonfigurowanych informacji.
160
161 %package tinydns-notify
162 Summary:        DNS NOTIFY sending tool
163 Summary(pl):    Narzêdzie do wysy³ania komunikatów DNS NOTIFY
164 Group:          Networking/Daemons
165 License:        Free to use
166 URL:            http://www.sericyb.com.au/tinydns-notify
167 PreReq:         %{name} = %{version}
168 Requires:       perl-modules
169 Requires:       perl-Net-DNS
170 Obsoletes:      tinydns-notify
171
172 %description tinydns-notify
173 tinydns-notify is a tool written in Perl, which extracts zones
174 and their nameservers from tinydns-data files and sends DNS NOTIFY
175 requests to nameservers listed in notify-list file.
176
177 %description tinydns-notify -l pl
178 tinydns-notify jest napisanym w Perlu narzêdziem, które czyta pliki
179 stref i odpowiadaj±ce im serwery nazw z plików tinydns-data, a
180 nastêpnie wysy³a ¿±dania NOTIFY do serwerów wyspecyfikowanych w pliku
181 notify-list.
182
183 %package pickdns
184 Summary:        DJB's load-balancing DNS server
185 Summary(de):    DJBs Belastung ausgleichender DNS-Server
186 Summary(pl):    Serwer DNS równowa¿±cy obci±¿enie od DJB
187 Group:          Networking/Daemons
188 PreReq:         %{name} = %{version}
189 Requires(pre):  /bin/id
190 Requires(pre):  /usr/sbin/groupadd
191 Requires(pre):  /usr/sbin/useradd
192 Requires(postun):       /usr/sbin/userdel
193 Requires(postun):       /usr/sbin/groupdel
194 Requires(post): diffutils
195 Requires(preun):        daemontools
196 Requires:       daemontools >= 0.70-5
197 Requires:       make
198 Provides:       user(pickdns)
199 Obsoletes:      pickdns
200
201 %description pickdns
202 pickdns is a DNS load-balancing server from the djbdns package. It
203 accepts iterative DNS queries from hosts around the Internet and
204 responds with a dynamic selection of locally configured IP addresses
205 with 5-second TTLs.
206
207 %description pickdns -l de
208 pickdns ist ein Belastung ausgleichender DNS-Server aus dem
209 djbdns-Paket. Es empfängt iterative DNS-Fragen von den Hosts aus allem
210 Internet und antwortet mit eine dynamische Auswahl von den
211 lokal-konfigurierten IP-Adressen mit 5-Sekunden-TTLs.
212
213 %description pickdns -l pl
214 pickdns jest równowa¿±cym obci±¿enie serwerem DNS z pakietu djbdns.
215 Odbiera on iteracyjne zapytania DNS od komputerów z ca³ego internetu i
216 odpowiada dynamicznym wyborem lokalnie skonfigurowanych adresów IP z
217 5-sekundowymi TTLami.
218
219 %package walldns
220 Summary:        DJB's reverse DNS wall
221 Summary(de):    DJBs Wand rückgekehrten DNSs
222 Summary(pl):    ¦ciana dla odwrotnych zapytañ DNS od DJB
223 Group:          Networking/Daemons
224 PreReq:         %{name} = %{version}
225 Requires(pre):  /bin/id
226 Requires(pre):  /usr/sbin/groupadd
227 Requires(pre):  /usr/sbin/useradd
228 Requires(postun):       /usr/sbin/userdel
229 Requires(postun):       /usr/sbin/groupdel
230 Requires(post): diffutils
231 Requires(preun):        daemontools
232 Requires:       daemontools >= 0.70-5
233 Provides:       user(walldns)
234 Obsoletes:      walldns
235
236 %description walldns
237 walldns is a reverse DNS wall from the djbdns package. It accepts
238 iterative DNS queries for in-addr.arpa domains from hosts around the
239 Internet and supplies generic responses that avoid revealing local
240 host information.
241
242 %description walldns -l de
243 walldns ist ein Wand rückgekehrten DNSs aus dem djbdns-Paket. Es
244 empfängt iterative DNS-Fragen für den in-addr.arpa-Domänen von den
245 Hosts aus allem Internet und liefert Antworte, die vermeiden
246 Informationen über die lokalen Hosts zu aufzudecken.
247
248 %description walldns -l pl
249 walldns jest ¶cian± dla odwrotnych zapytañ DNS z pakietu djbdns.
250 Przyjmuje ona iteracyjne zapytania DNS dla domen in-addr.arpa od
251 komputerów z ca³ego Internetu i dostarcza odpowiedzi, które unikaj±
252 ujawniania informacji o lokalnych komputerach.
253
254 %package rbldns
255 Summary:        DJB's IP-address-listing DNS server
256 Summary(de):    DJBs IP-Adressen-Listen-DNS-Server
257 Summary(pl):    Serwer DNS list adresów IP od DJB
258 Group:          Networking/Daemons
259 PreReq:         %{name} = %{version}
260 Requires(pre):  /bin/id
261 Requires(pre):  /usr/sbin/groupadd
262 Requires(pre):  /usr/sbin/useradd
263 Requires(postun):       /usr/sbin/userdel
264 Requires(postun):       /usr/sbin/groupdel
265 Requires(post): diffutils
266 Requires(preun):        daemontools
267 Requires:       daemontools >= 0.70-5
268 Requires:       make
269 Provides:       user(rbldns)
270 Obsoletes:      rbldns
271
272 %description rbldns
273 rbldns is an IP-address-listing DNS server from the djbdns package. It
274 accepts iterative DNS queries from hosts around the Internet asking
275 about various IP addresses. It provides responses showing whether the
276 addresses are on a locally configured list, such as RBL or DUL.
277
278 %description rbldns -l de
279 rbldns ist ein IP-Adressen-Listen-DNS-Server aus dem djbdns-Paket. Es
280 empfängt iterative DNS-Fragen von den Hosts aus allem Internet
281 fragende nach verschiedene IP-Adresse. Es liefert Antworte, die zeugen
282 ob die Adresse sich auf einer lokal-konfigurierten Liste befinden, zum
283 Beispiel RBL oder DUL.
284
285 %description rbldns -l pl
286 rbldns jest serwerem DNS list adresów z pakietu djbdns. Przyjmuje on
287 iteracyjne zapytania DNS od komputerów z ca³ego Internetu pytaj±ce o
288 ró¿ne adresy IP. Dostarcza on odpowiedzi pokazuj±cych, czy adresy te
289 s± na lokalnie skonfigurowanej li¶cie takiej, jak RBL lub DUL.
290
291 %package axfrdns
292 Summary:        DJB's DNS zone-transfer server
293 Summary(de):    DJBs DNS-Zonen-Transfer-Server
294 Summary(pl):    Serwer transferów stref DNS od DJB
295 Group:          Networking/Daemons
296 PreReq:         %{name} = %{version}
297 Requires(pre):  /bin/id
298 Requires(pre):  /usr/sbin/groupadd
299 Requires(pre):  /usr/sbin/useradd
300 Requires(postun):       /usr/sbin/userdel
301 Requires(postun):       /usr/sbin/groupdel
302 Requires(preun):        daemontools
303 Requires:       %{name}-tinydns = %{version}
304 Requires:       daemontools >= 0.70-5
305 Requires:       make
306 Requires:       ucspi-tcp
307 Provides:       user(axfrdns)
308 Obsoletes:      axfrdns
309
310 %description axfrdns
311 axfrdns is a DNS zone transfer server from the djbdns package. It
312 reads a zone-transfer request in DNS-over-TCP format from its standard
313 input and responds with locally configured information.
314
315 %description axfrdns -l de
316 axfrdns ist ein DNS-Zonen-Transfer-Server aus dem djbdns-Paket. Es
317 liest ein Zonen-Transfer-Ersuchen im DNS-over-TCP-Format von seinem
318 standarden Eingabe und antwortet mit den lokal-konfigurierten
319 Informationen.
320
321 %description axfrdns -l pl
322 axfrdns jest serwerem transferów stref DNS z pakietu djbdns. Wczytuje
323 on ze standardowego wej¶cia pro¶bê o transfer strefy w formacie
324 DNS-over-TCP i odpowiada przy u¿yciu lokalnie skonfigurowanych
325 informacji.
326
327 %prep
328 %setup -q -a1 -a2
329
330 %patch1 -p1
331 %patch0 -p1
332 %patch3 -p1
333 %patch4 -p1
334 %patch5
335 %patch6 -p1
336 %patch8 -p1
337 cd doc
338 ln -s merge/djbdns/* .
339
340 %build
341 echo %{__cc} %{rpmcflags} >conf-cc
342 echo %{_prefix} > conf-home
343 %{__make}
344
345 %install
346 rm -rf $RPM_BUILD_ROOT
347 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_sysconfdir}}
348 install -d $RPM_BUILD_ROOT%{_mandir}/{man1,man5,man8}
349
350 install %{SOURCE3}      $RPM_BUILD_ROOT%{_bindir}
351
352 install dnsroots.global $RPM_BUILD_ROOT%{_sysconfdir}
353 install axfr-get        $RPM_BUILD_ROOT%{_bindir}
354 install axfrdns         $RPM_BUILD_ROOT%{_bindir}
355 install axfrdns-conf    $RPM_BUILD_ROOT%{_bindir}
356 install cachetest       $RPM_BUILD_ROOT%{_bindir}
357 install dnscache        $RPM_BUILD_ROOT%{_bindir}
358 install dnscache-conf   $RPM_BUILD_ROOT%{_bindir}
359 install dnsfilter       $RPM_BUILD_ROOT%{_bindir}
360 install dnsip           $RPM_BUILD_ROOT%{_bindir}
361 install dnsipq          $RPM_BUILD_ROOT%{_bindir}
362 install dnsmx           $RPM_BUILD_ROOT%{_bindir}
363 install dnsname         $RPM_BUILD_ROOT%{_bindir}
364 install dnsq            $RPM_BUILD_ROOT%{_bindir}
365 install dnsqr           $RPM_BUILD_ROOT%{_bindir}
366 install dnstrace        $RPM_BUILD_ROOT%{_bindir}
367 install dnstxt          $RPM_BUILD_ROOT%{_bindir}
368 install pickdns         $RPM_BUILD_ROOT%{_bindir}
369 install pickdns-conf    $RPM_BUILD_ROOT%{_bindir}
370 install pickdns-data    $RPM_BUILD_ROOT%{_bindir}
371 install random-ip       $RPM_BUILD_ROOT%{_bindir}
372 install rbldns          $RPM_BUILD_ROOT%{_bindir}
373 install rbldns-conf     $RPM_BUILD_ROOT%{_bindir}
374 install rbldns-data     $RPM_BUILD_ROOT%{_bindir}
375 install rts             $RPM_BUILD_ROOT%{_bindir}
376 install tinydns         $RPM_BUILD_ROOT%{_bindir}
377 install tinydns-conf    $RPM_BUILD_ROOT%{_bindir}
378 install tinydns-data    $RPM_BUILD_ROOT%{_bindir}
379 install tinydns-edit    $RPM_BUILD_ROOT%{_bindir}
380 install tinydns-get     $RPM_BUILD_ROOT%{_bindir}
381 install walldns         $RPM_BUILD_ROOT%{_bindir}
382 install walldns-conf    $RPM_BUILD_ROOT%{_bindir}
383 install djbdns-man/*.1  $RPM_BUILD_ROOT%{_mandir}/man1
384 install djbdns-man/*.5  $RPM_BUILD_ROOT%{_mandir}/man5
385 install djbdns-man/*.8  $RPM_BUILD_ROOT%{_mandir}/man8
386
387 ##### DNSCACHE #####
388
389 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/dnscache
390 cd $RPM_BUILD_ROOT%{_sysconfdir}/dnscache
391 mkdir log
392 mkdir log/main
393 touch log/status
394 mkdir env
395 echo %{_sysconfdir}/dnscache/root>env/ROOT
396 echo 127.0.0.1                   >env/IP
397 echo 0.0.0.0                     >env/IPSEND
398 echo 1000000                     >env/CACHESIZE
399 echo 3000000                     >env/DATALIMIT
400 touch env/IGNOREIP
401 cat>run<<___
402 #!/bin/sh
403 exec 2>&1
404 exec <seed
405 exec envdir ./env sh -c '
406   exec envuidgid dnscache softlimit -o250 -d "\$DATALIMIT" %{_bindir}/dnscache
407 '
408 ___
409 cat>log/run<<___
410 #!/bin/sh
411 exec setuidgid dnslog multilog t ./main
412 ___
413 mkdir root
414 mkdir root/ip
415 touch root/ip/127.0.0.1
416 mkdir root/servers
417 ln $RPM_BUILD_ROOT%{_sysconfdir}/dnsroots.global root/servers/\@
418 dd if=/dev/zero of=seed bs=128c count=1
419
420 ##### TINYDNS #####
421
422 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/tinydns
423 cd $RPM_BUILD_ROOT%{_sysconfdir}/tinydns
424 mkdir log
425 mkdir log/main
426 touch log/status
427 cat>log/run<<___
428 #!/bin/sh
429 exec setuidgid dnslog multilog t ./main
430 ___
431 mkdir env
432 echo %{_sysconfdir}/tinydns/root>env/ROOT
433 echo 127.0.0.1                  >env/IP
434 cat>run<<___
435 #!/bin/sh
436 exec 2>&1
437 exec envuidgid tinydns envdir ./env softlimit -d300000 %{_bindir}/tinydns
438 ___
439 mkdir root
440 touch root/data
441 cat>root/add-ns<<___
442 #!/bin/sh
443 exec %{_bindir}/tinydns-edit data data.new add ns \${1+"\$@"}
444 ___
445 cat>root/add-childns<<___
446 #!/bin/sh
447 exec %{_bindir}/tinydns-edit data data.new add childns \${1+"\$@"}
448 ___
449 cat>root/add-host<<___
450 #!/bin/sh
451 exec %{_bindir}/tinydns-edit data data.new add host \${1+"\$@"}
452 ___
453 cat>root/add-host6<<___
454 #!/bin/sh
455 exec %{_bindir}/tinydns-edit data data.new add host6 \${1+"\$@"}
456 ___
457 cat>root/add-alias<<___
458 #!/bin/sh
459 exec %{_bindir}/tinydns-edit data data.new add alias \${1+"\$@"}
460 ___
461 cat>root/add-alias6<<___
462 #!/bin/sh
463 exec %{_bindir}/tinydns-edit data data.new add alias6 \${1+"\$@"}
464 ___
465 cat>root/add-mx<<___
466 #!/bin/sh
467 exec %{_bindir}/tinydns-edit data data.new add mx \${1+"\$@"}
468 ___
469 cat>root/Makefile<<___
470 data.cdb: data
471         %{_bindir}/tinydns-data
472 ___
473
474 ##### PICKDNS #####
475
476 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/pickdns
477 cd $RPM_BUILD_ROOT%{_sysconfdir}/pickdns
478 mkdir log
479 mkdir log/main
480 touch log/status
481 cat>log/run<<___
482 #!/bin/sh
483 exec setuidgid dnslog multilog t ./main
484 ___
485 mkdir env
486 echo %{_sysconfdir}/pickdns/root>env/ROOT
487 echo 127.0.0.1                  >env/IP
488 cat>run<<___
489 #!/bin/sh
490 exec 2>&1
491 exec envuidgid pickdns envdir ./env softlimit -d250000 %{_bindir}/pickdns
492 ___
493 mkdir root
494 touch root/data
495 cat>root/Makefile<<___
496 data.cdb: data
497         %{_bindir}/pickdns-data
498 ___
499
500 ##### WALLDNS #####
501 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/walldns
502 cd $RPM_BUILD_ROOT%{_sysconfdir}/walldns
503 mkdir log
504 mkdir log/main
505 touch log/status
506 cat>log/run<<___
507 #!/bin/sh
508 exec setuidgid dnslog multilog t ./main
509 ___
510 mkdir env
511 echo %{_sysconfdir}/walldns/root>env/ROOT
512 echo 127.0.0.1                  >env/IP
513 cat>run<<___
514 #!/bin/sh
515 exec 2>&1
516 exec envuidgid walldns envdir ./env softlimit -d250000 %{_bindir}/walldns
517 ___
518 mkdir root
519
520 ##### RBLDNS #####
521
522 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/rbldns
523 cd $RPM_BUILD_ROOT%{_sysconfdir}/rbldns
524 mkdir log
525 mkdir log/main
526 touch log/status
527 cat>log/run<<___
528 #!/bin/sh
529 exec setuidgid dnslog multilog t ./main
530 ___
531 mkdir env
532 echo %{_sysconfdir}/rbldns/root>env/ROOT
533 echo 127.0.0.1                 >env/IP
534 echo in-addr.arpa              >env/BASE
535 cat>run<<___
536 #!/bin/sh
537 exec 2>&1
538 exec envuidgid rbldns envdir ./env softlimit -d250000 %{_bindir}/rbldns
539 ___
540 mkdir root
541 touch root/data
542 cat>root/Makefile<<___
543 data.cdb: data
544         %{_bindir}/rbldns-data
545 ___
546 cat>data<<___
547 # example
548 # !10.11.12.13:See http://bad.example.com
549 # :127.0.0.2:blacklisted"
550 # 1.2.3.0/24
551 ___
552
553
554
555 ##### AXFRDNS #####
556
557 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/axfrdns
558 cd $RPM_BUILD_ROOT%{_sysconfdir}/axfrdns
559 mkdir log
560 mkdir log/main
561 touch log/status
562 cat>log/run<<___
563 #!/bin/sh
564 exec setuidgid dnslog multilog t ./main
565 ___
566 mkdir env
567 echo %{_sysconfdir}/tinydns/root>env/ROOT
568 echo 127.0.0.1                  >env/IP
569 cat>run<<___
570 #!/bin/sh
571 exec 2>&1
572 exec envdir ./env sh -c '
573   exec envuidgid axfrdns softlimit -d300000 tcpserver -vDRHl0 -x tcp.cdb -- "\$IP" 53 %{_bindir}/axfrdns
574 '
575 ___
576 cat>Makefile<<___
577 tcp.cdb: tcp
578         tcprules tcp.cdb tcp.tmp < tcp
579 ___
580 cat>tcp<<___
581 # sample line:  1.2.3.4:allow,AXFR="heaven.af.mil/3.2.1.in-addr.arpa"
582 :deny
583 ___
584
585 ##### daemontools symlinks #####
586 install -d $RPM_BUILD_ROOT/service
587 cd $RPM_BUILD_ROOT/service
588 ln -s ..%{_sysconfdir}/dnscache
589 ln -s ..%{_sysconfdir}/tinydns
590 ln -s ..%{_sysconfdir}/pickdns
591 ln -s ..%{_sysconfdir}/walldns
592 ln -s ..%{_sysconfdir}/rbldns
593 ln -s ..%{_sysconfdir}/axfrdns
594
595 %clean
596 rm -rf $RPM_BUILD_ROOT
597
598 %pre
599 if [ -n "`getgid djbdns`" ]; then
600         if [ "`getgid djbdns`" != "32" ]; then
601                 echo "Error: group djbdns doesn't have gid=32. Correct this before installing djbdns." 1>&2
602                 exit 1
603         fi
604 else
605         /usr/sbin/groupadd -g 32 -r -f djbdns
606 fi
607 if [ -n "`id -u dnslog 2>/dev/null`" ]; then
608         if [ "`id -u dnslog`" != "32" ]; then
609                 echo "Error: user dnslog doesn't have uid=32. Correct this before installing djbdns." 1>&2
610                 exit 1
611         fi
612 else
613         /usr/sbin/useradd -u 32 -r -d / -s /bin/false -c "djbdns User" -g djbdns dnslog 1>&2
614 fi
615
616 %postun
617 if [ "$1" = "0" ]; then
618         %userremove dnslog
619         %groupremove djbdns
620 fi
621
622 %pre dnscache
623 if [ -n "`id -u dnscache 2>/dev/null`" ]; then
624         if [ "`id -u dnscache`" != "33" ]; then
625                 echo "Error: user dnscache doesn't have uid=33. Correct this before installing djbdns-dnscache." 1>&2
626                 exit 1
627         fi
628 else
629         /usr/sbin/useradd -u 33 -r -d /etc/dnscache -s /bin/false -c "djbdns User" -g djbdns dnscache 1>&2
630 fi
631
632 %post dnscache
633 if [ \! -s /etc/dnscache/seed ]; then
634         dd if=/dev/urandom of=/etc/dnscache/seed bs=128c count=1
635 fi
636 if diff -u /etc/{dnscache,pickdns}/env/IP >/dev/zero 2>&1;then
637         echo "Warning: dnscache and pickdns can't work on the same"
638         echo "IP address. You have to edit either /etc/dnscache/env/IP"
639         echo "or /etc/pickdns/env/IP."
640 fi
641 if diff -u /etc/{dnscache,rbldns}/env/IP >/dev/zero 2>&1;then
642         echo "Warning: dnscache and rbldns can't work on the same"
643         echo "IP address. You have to edit either /etc/dnscache/env/IP"
644         echo "or /etc/rbldns/env/IP."
645 fi
646 if diff -u /etc/{dnscache,tinydns}/env/IP >/dev/zero 2>&1;then
647         echo "Warning: dnscache and tinydns can't work on the same"
648         echo "IP address. You have to edit either /etc/dnscache/env/IP"
649         echo "or /etc/tinydns/env/IP."
650 fi
651 if diff -u /etc/{dnscache,walldns}/env/IP >/dev/zero 2>&1;then
652         echo "Warning: dnscache and walldns can't work on the same"
653         echo "IP address. You have to edit either /etc/dnscache/env/IP"
654         echo "or /etc/walldns/env/IP."
655 fi
656
657 %preun dnscache
658 if [ "$1" = "0" ]; then
659         svc -d /service/dnscache
660 fi
661
662 %postun dnscache
663 if [ "$1" = "0" ]; then
664         %userremove dnscache
665 fi
666
667 %pre tinydns
668 if [ -n "`id -u tinydns 2>/dev/null`" ]; then
669         if [ "`id -u tinydns`" != "34" ]; then
670                 echo "Error: user tinydns doesn't have uid=34. Correct this before installing djbdns-tinydns." 1>&2
671                 exit 1
672         fi
673 else
674         /usr/sbin/useradd -u 34 -r -d /etc/tinydns -s /bin/false -c "djbdns User" -g djbdns tinydns 1>&2
675 fi
676
677 %post tinydns
678 if diff -u /etc/{dnscache,tinydns}/env/IP >/dev/zero 2>&1;then
679         echo "Warning: dnscache and tinydns can't work on the same"
680         echo "IP address. You have to edit either /etc/dnscache/env/IP"
681         echo "or /etc/tinydns/env/IP."
682 fi
683 if diff -u /etc/{pick,tiny}dns/env/IP >/dev/zero 2>&1;then
684         echo "Warning: pickdns and tinydns can't work on the same"
685         echo "IP address. You have to edit either /etc/pickdns/env/IP"
686         echo "or /etc/tinydns/env/IP."
687 fi
688 if diff -u /etc/{rbl,tiny}dns/env/IP >/dev/zero 2>&1;then
689         echo "Warning: rbldns and tinydns can't work on the same"
690         echo "IP address. You have to edit either /etc/rbldns/env/IP"
691         echo "or /etc/tinydns/env/IP."
692 fi
693 if diff -u /etc/{tiny,wall}dns/env/IP >/dev/zero 2>&1;then
694         echo "Warning: tinydns and walldns can't work on the same"
695         echo "IP address. You have to edit either /etc/tinydns/env/IP"
696         echo "or /etc/walldns/env/IP."
697 fi
698
699 %preun tinydns
700 if [ "$1" = "0" ]; then
701         svc -d /service/tinydns
702 fi
703
704 %postun tinydns
705 if [ "$1" = "0" ]; then
706         %userremove tinydns
707 fi
708
709 %pre pickdns
710 if [ -n "`id -u pickdns 2>/dev/null`" ]; then
711         if [ "`id -u pickdns`" != "35" ]; then
712                 echo "Error: user pickdns doesn't have uid=35. Correct this before installing djbdns-pickdns." 1>&2
713                 exit 1
714         fi
715 else
716         /usr/sbin/useradd -u 35 -r -d /etc/pickdns -s /bin/false -c "djbdns User" -g djbdns pickdns 1>&2
717 fi
718
719 %post pickdns
720 if diff -u /etc/{dnscache,pickdns}/env/IP >/dev/zero 2>&1;then
721         echo "Warning: dnscache and pickdns can't work on the same"
722         echo "IP address. You have to edit either /etc/dnscache/env/IP"
723         echo "or /etc/pickdns/env/IP."
724 fi
725 if diff -u /etc/{pick,rbl}dns/env/IP >/dev/zero 2>&1;then
726         echo "Warning: pickdns and rbldns can't work on the same"
727         echo "IP address. You have to edit either /etc/pickdns/env/IP"
728         echo "or /etc/rbldns/env/IP."
729 fi
730 if diff -u /etc/{pick,tiny}dns/env/IP >/dev/zero 2>&1;then
731         echo "Warning: pickdns and tinydns can't work on the same"
732         echo "IP address. You have to edit either /etc/pickdns/env/IP"
733         echo "or /etc/tinydns/env/IP."
734 fi
735 if diff -u /etc/{pick,wall}dns/env/IP >/dev/zero 2>&1;then
736         echo "Warning: pickdns and walldns can't work on the same"
737         echo "IP address. You have to edit either /etc/pickdns/env/IP"
738         echo "or /etc/walldns/env/IP."
739 fi
740
741 %preun pickdns
742 if [ "$1" = "0" ]; then
743         svc -d /service/pickdns
744 fi
745
746 %postun pickdns
747 if [ "$1" = "0" ]; then
748         %userremove pickdns
749 fi
750
751 %pre walldns
752 if [ -n "`id -u walldns 2>/dev/null`" ]; then
753         if [ "`id -u walldns`" != "36" ]; then
754                 echo "Error: user walldns doesn't have uid=36. Correct this before installing djbdns-walldns." 1>&2
755                 exit 1
756         fi
757 else
758         /usr/sbin/useradd -u 36 -r -d /etc/walldns -s /bin/false -c "djbdns User" -g djbdns walldns 1>&2
759 fi
760
761 %post walldns
762 if diff -u /etc/{dnscache,walldns}/env/IP >/dev/zero 2>&1;then
763         echo "Warning: dnscache and walldns can't work on the same"
764         echo "IP address. You have to edit either /etc/dnscache/env/IP"
765         echo "or /etc/walldns/env/IP."
766 fi
767 if diff -u /etc/{pick,wall}dns/env/IP >/dev/zero 2>&1;then
768         echo "Warning: pickdns and walldns can't work on the same"
769         echo "IP address. You have to edit either /etc/pickdns/env/IP"
770         echo "or /etc/walldns/env/IP."
771 fi
772 if diff -u /etc/{rbl,wall}dns/env/IP >/dev/zero 2>&1;then
773         echo "Warning: rbldns and walldns can't work on the same"
774         echo "IP address. You have to edit either /etc/rbldns/env/IP"
775         echo "or /etc/walldns/env/IP."
776 fi
777 if diff -u /etc/{tiny,wall}dns/env/IP >/dev/zero 2>&1;then
778         echo "Warning: tinydns and walldns can't work on the same"
779         echo "IP address. You have to edit either /etc/tinydns/env/IP"
780         echo "or /etc/walldns/env/IP."
781 fi
782
783 %preun walldns
784 if [ "$1" = "0" ]; then
785         svc -d /service/walldns
786 fi
787
788 %postun walldns
789 if [ "$1" = "0" ]; then
790         %userremove walldns
791 fi
792
793 %pre rbldns
794 if [ -n "`id -u rbldns 2>/dev/null`" ]; then
795         if [ "`id -u rbldns`" != "37" ]; then
796                 echo "Error: user rbldns doesn't have uid=37. Correct this before installing djbdns-rbldns." 1>&2
797                 exit 1
798         fi
799 else
800         /usr/sbin/useradd -u 37 -r -d /etc/rbldns -s /bin/false -c "djbdns User" -g djbdns rbldns 1>&2
801 fi
802
803 %post rbldns
804 if diff -u /etc/{dnscache,rbldns}/env/IP >/dev/zero 2>&1;then
805         echo "Warning: dnscache and rbldns can't work on the same"
806         echo "IP address. You have to edit either /etc/dnscache/env/IP"
807         echo "or /etc/rbldns/env/IP."
808 fi
809 if diff -u /etc/{pick,rbl}dns/env/IP >/dev/zero 2>&1;then
810         echo "Warning: pickdns and rbldns can't work on the same"
811         echo "IP address. You have to edit either /etc/pickdns/env/IP"
812         echo "or /etc/rbldns/env/IP."
813 fi
814 if diff -u /etc/{rbl,tiny}dns/env/IP >/dev/zero 2>&1;then
815         echo "Warning: rbldns and tinydns can't work on the same"
816         echo "IP address. You have to edit either /etc/rbldns/env/IP"
817         echo "or /etc/tinydns/env/IP."
818 fi
819 if diff -u /etc/{rbl,wall}dns/env/IP >/dev/zero 2>&1;then
820         echo "Warning: rbldns and walldns can't work on the same"
821         echo "IP address. You have to edit either /etc/rbldns/env/IP"
822         echo "or /etc/walldns/env/IP."
823 fi
824
825 %preun rbldns
826 if [ "$1" = "0" ]; then
827         svc -d /service/rbldns
828 fi
829
830 %postun rbldns
831 if [ "$1" = "0" ]; then
832         %userremove rbldns
833 fi
834
835 %pre axfrdns
836 if [ -n "`id -u axfrdns 2>/dev/null`" ]; then
837         if [ "`id -u axfrdns`" != "38" ]; then
838                 echo "Error: user axfrdns doesn't have uid=38. Correct this before installing djbdns-axfrdns." 1>&2
839                 exit 1
840         fi
841 else
842         /usr/sbin/useradd -u 38 -r -d /etc/axfrdns -s /bin/false -c "djbdns User" -g djbdns axfrdns 1>&2
843 fi
844
845 %preun axfrdns
846 if [ "$1" = "0" ]; then
847         svc -d /service/axfrdns
848 fi
849
850 %postun axfrdns
851 if [ "$1" = "0" ]; then
852         %userremove axfrdns
853 fi
854
855 %files
856 %defattr(644,root,root,755)
857 %doc CHANGES TODO MULTIPLEIP TINYDNS doc/*
858 %attr(755,root,root) %{_bindir}/cachetest
859 %attr(755,root,root) %{_bindir}/dns[f-t]*
860 %attr(755,root,root) %{_bindir}/axfr-get
861 %{_mandir}/man[15]/*
862 %{_mandir}/man8/axfr-get*
863
864 %files dnscache
865 %defattr(644,root,root,755)
866 %attr(755,root,root) %{_bindir}/dnscache*
867 %config %attr(644,root,root) %{_sysconfdir}/dnsroots.global
868 %dir %attr(3755,root,root) %{_sysconfdir}/dnscache
869 %dir %attr(2755,root,root) %{_sysconfdir}/dnscache/log
870 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/dnscache/log/main
871 %attr(644,dnslog,djbdns) %{_sysconfdir}/dnscache/log/status
872 %dir %attr(2755,root,root) %{_sysconfdir}/dnscache/env
873 %config %attr(644,root,root) %{_sysconfdir}/dnscache/env/*
874 %attr(755,root,root) %{_sysconfdir}/dnscache/run
875 %attr(755,root,root) %{_sysconfdir}/dnscache/log/run
876 %dir %attr(2755,root,root) %{_sysconfdir}/dnscache/root
877 %dir %attr(2755,root,root) %{_sysconfdir}/dnscache/root/*
878 %config %attr(600,root,root) %{_sysconfdir}/dnscache/root/ip/*
879 %config %attr(644,root,root) %{_sysconfdir}/dnscache/root/servers/*
880 %ghost %attr(600,root,root) %{_sysconfdir}/dnscache/seed
881 %{_mandir}/man8/dnscache*
882 /service/dnscache
883
884 %files tinydns
885 %defattr(644,root,root,755)
886 %attr(755,root,root) %{_bindir}/tinydns*
887 %dir %attr(3755,root,root) %{_sysconfdir}/tinydns
888 %dir %attr(2755,root,root) %{_sysconfdir}/tinydns/log
889 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/tinydns/log/main
890 %attr(644,dnslog,djbdns) %{_sysconfdir}/tinydns/log/status
891 %attr(755,root,root) %{_sysconfdir}/tinydns/log/run
892 %dir %attr(2755,root,root) %{_sysconfdir}/tinydns/env
893 %config %attr(644,root,root) %{_sysconfdir}/tinydns/env/*
894 %attr(755,root,root) %{_sysconfdir}/tinydns/run
895 %dir %attr(2755,root,root) %{_sysconfdir}/tinydns/root
896 %attr(644,root,root) %{_sysconfdir}/tinydns/root/Makefile
897 %config %attr(644,root,root) %{_sysconfdir}/tinydns/root/data
898 %attr(755,root,root) %{_sysconfdir}/tinydns/root/add-*
899 %{_mandir}/man8/tinydns*
900 /service/tinydns
901
902 %files tinydns-notify
903 %defattr(644,root,root,755)
904 %attr(755,root,root) %{_bindir}/tinydns-notify
905
906 %files pickdns
907 %defattr(644,root,root,755)
908 %attr(755,root,root) %{_bindir}/pickdns*
909 %dir %attr(3755,root,root) %{_sysconfdir}/pickdns
910 %dir %attr(2755,root,root) %{_sysconfdir}/pickdns/log
911 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/pickdns/log/main
912 %attr(644,dnslog,djbdns) %{_sysconfdir}/pickdns/log/status
913 %attr(755,root,root) %{_sysconfdir}/pickdns/log/run
914 %dir %attr(2755,root,root) %{_sysconfdir}/pickdns/env
915 %config %attr(644,root,root) %{_sysconfdir}/pickdns/env/*
916 %attr(755,root,root) %{_sysconfdir}/pickdns/run
917 %dir %attr(2755,root,root) %{_sysconfdir}/pickdns/root
918 %attr(644,root,root) %{_sysconfdir}/pickdns/root/Makefile
919 %config %attr(644,root,root) %{_sysconfdir}/pickdns/root/data
920 %{_mandir}/man8/pickdns*
921 /service/pickdns
922
923 %files walldns
924 %defattr(644,root,root,755)
925 %attr(755,root,root) %{_bindir}/walldns*
926 %dir %attr(3755,root,root) %{_sysconfdir}/walldns
927 %dir %attr(2755,root,root) %{_sysconfdir}/walldns/log
928 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/walldns/log/main
929 %attr(644,dnslog,djbdns) %{_sysconfdir}/walldns/log/status
930 %attr(755,root,root) %{_sysconfdir}/walldns/log/run
931 %dir %attr(2755,root,root) %{_sysconfdir}/walldns/env
932 %config %attr(644,root,root) %{_sysconfdir}/walldns/env/*
933 %attr(755,root,root) %{_sysconfdir}/walldns/run
934 %dir %attr(2755,root,root) %{_sysconfdir}/walldns/root
935 %{_mandir}/man8/walldns*
936 /service/walldns
937
938 %files rbldns
939 %defattr(644,root,root,755)
940 %attr(755,root,root) %{_bindir}/rbldns*
941 %dir %attr(3755,root,root) %{_sysconfdir}/rbldns
942 %dir %attr(2755,root,root) %{_sysconfdir}/rbldns/log
943 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/rbldns/log/main
944 %attr(644,dnslog,djbdns) %{_sysconfdir}/rbldns/log/status
945 %attr(755,root,root) %{_sysconfdir}/rbldns/log/run
946 %dir %attr(2755,root,root) %{_sysconfdir}/rbldns/env
947 %config %attr(644,root,root) %{_sysconfdir}/rbldns/env/*
948 %attr(755,root,root) %{_sysconfdir}/rbldns/run
949 %dir %attr(2755,root,root) %{_sysconfdir}/rbldns/root
950 %attr(644,root,root) %{_sysconfdir}/rbldns/root/Makefile
951 %config %attr(644,root,root) %{_sysconfdir}/rbldns/root/data
952 %{_mandir}/man8/rbldns*
953 /service/rbldns
954
955 %files axfrdns
956 %defattr(644,root,root,755)
957 %attr(755,root,root) %{_bindir}/axfrdns*
958 %dir %attr(3755,root,root) %{_sysconfdir}/axfrdns
959 %dir %attr(2755,root,root) %{_sysconfdir}/axfrdns/log
960 %dir %attr(2755,dnslog,djbdns) %{_sysconfdir}/axfrdns/log/main
961 %attr(644,dnslog,djbdns) %{_sysconfdir}/axfrdns/log/status
962 %attr(755,root,root) %{_sysconfdir}/axfrdns/log/run
963 %dir %attr(2755,root,root) %{_sysconfdir}/axfrdns/env
964 %config %attr(644,root,root) %{_sysconfdir}/axfrdns/env/*
965 %attr(755,root,root) %{_sysconfdir}/axfrdns/run
966 %attr(644,root,root) %{_sysconfdir}/axfrdns/Makefile
967 %config %attr(644,root,root) %{_sysconfdir}/axfrdns/tcp
968 %{_mandir}/man8/axfrdns*
969 /service/axfrdns
This page took 0.138357 seconds and 4 git commands to generate.