]> git.pld-linux.org Git - packages/pdnsd.git/blob - pdnsd.spec
8e9587ea729ec9db5738c4b79ce76e37a4404367
[packages/pdnsd.git] / pdnsd.spec
1 Summary:        A caching dns proxy for small networks or dialin accounts
2 Summary(pl):    DNS proxy serwer dla ma³ej sieci lub jednostki z po³±czeniem dialup
3 Name:           pdnsd
4 Version:        1.2.1
5 %define par     par
6 Release:        0.par0.0
7 License:        GPL
8 Group:          Networking/Daemons
9 Source0:        http://www.phys.uu.nl/~rombouts/pdnsd/releases/%{name}-%{version}-%{par}.tar.gz
10 # Source0-md5:  7be77e25ba8b3de73df32706d956c294
11 Source1:        %{name}.init
12 Source2:        %{name}.sysconfig
13 Patch0:         %{name}-threads_signals.patch
14 Patch1:         %{name}-ac_am.patch
15 # Old URL:      http://home.t-online.de/home/Moestl/
16 URL:            http://www.phys.uu.nl/~rombouts/pdnsd.html
17 BuildRequires:  autoconf
18 BuildRequires:  automake
19 BuildRequires:  flex
20 PreReq:         rc-scripts
21 Requires(post,preun):   /sbin/chkconfig
22 Provides:       caching-nameserver
23 Obsoletes:      bind
24 Obsoletes:      maradns
25 Obsoletes:      maradns-zoneserver
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 pdnsd is a proxy DNS daemon with permanent (disk-)cache and the
30 ability to serve local records. It is designed to detect network
31 outages or hangups and to prevent DNS-dependent applications like
32 Netscape Navigator from hanging.
33
34 %description -l pl
35 pdnsd jest serwerem proxy dla us³ugi DNS, zapisuj±cym bufor ze
36 zgromadzonymi informacjami na dysku. Bêdzie on szczególnie u¿yteczny
37 dla jednostki pracujacej w trybie off-line (np. poprzez po³±czenie
38 dialup).
39
40 %prep
41 %setup -q
42 #%patch0 -p0
43 %patch1 -p1
44
45 %build
46 rm -fr src/rc
47 %{__aclocal}
48 %{__autoconf}
49 %{__autoheader}
50 %{__automake}
51 %configure \
52         --with-default-id=pdnsd \
53         --enable-ipv6 \
54         --with-thread-lib=LinuxThreads2 \
55         --enable-tcp-subseq
56 %{__make}
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
61
62 %{__make} install \
63         DESTDIR=$RPM_BUILD_ROOT
64
65 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pdnsd
66 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pdnsd
67
68 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/pdnsd.conf{.sample,}
69
70 %clean
71 rm -rf $RPM_BUILD_ROOT
72
73 %pre
74 if [ -n "`/usr/bin/getgid pdnsd`" ]; then
75         if [ "`/usr/bin/getgid pdnsd`" != "140" ]; then
76                 echo "Error: group pdnsd doesn't have gid=140. Correct this before installing pdnsdd." 1>&2
77                 exit 1
78         fi
79 else
80         /usr/sbin/groupadd -g 140 pdnsd 1>&2
81 fi
82 if [ -n "`/bin/id -u pdnsd 2>/dev/null`" ]; then
83         if [ "`/bin/id -u pdnsd`" != "140" ]; then
84                 echo "Error: user pdnsd doesn't have uid=140. Correct this before installing pdnsdd server." 1>&2
85                 exit 1
86         fi
87 else
88         /usr/sbin/useradd -u 140 -d /tmp -s /bin/false -c "pdnsd user" \
89                 -g pdnsd pdnsd 1>&2
90 fi
91
92 %post
93 /sbin/chkconfig --add pdnsd
94 if [ -f %{_localstatedir}/lock/subsys/pdnsd ]; then
95         /etc/rc.d/init.d/pdnsd restart >&2
96 else
97         echo "Run \"/etc/rc.d/init.d/pdnsd start\" to start pdnsd." >&2
98 fi
99
100 %preun
101 if [ "$1" = "0" ]; then
102         if [ -f %{_localstatedir}/lock/subsys/pdnsd ]; then
103                 /etc/rc.d/init.d/pdnsd stop
104         fi
105         /sbin/chkconfig --del pdnsd
106 fi
107
108 %postun
109 if [ "$1" = "0" ]; then
110         %userremove pdnsd
111         %groupremove pdnsd
112 fi
113
114 %files
115 %defattr(644,root,root,755)
116 %doc AUTHORS ChangeLog NEWS README TODO doc/txt/*.txt doc/html/*.html
117 %attr(754,root,root) /etc/rc.d/init.d/pdnsd
118 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/pdnsd
119 %attr(755,root,root) %{_sbindir}/pdnsd
120 %attr(755,root,root) %{_sbindir}/pdnsd-ctl
121 %attr(775,pdnsd,pdnsd) %dir %{_var}/cache/pdnsd
122 %attr(664,pdnsd,pdnsd) %config(noreplace) %verify(not md5 size mtime) %{_var}/cache/pdnsd/pdnsd.cache
123 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/pdnsd.conf
124 %{_mandir}/man[58]/*
This page took 0.065895 seconds and 2 git commands to generate.