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