]> git.pld-linux.org Git - packages/pdns.git/blob - pdns.spec
3fbe5eda3e3df6784f760e315adc528a24bf2c84
[packages/pdns.git] / pdns.spec
1 Summary:        PowerDNS is a Versatile Database Driven Nameserver
2 Summary(pl):    PowerDNS to wielofunkcyjny serwer nazw korzystaj¹cy z relacyjnych baz danych
3 Name:           pdns
4 Version:        2.9.15
5 Release:        1
6 License:        GPL
7 Group:          Networking/Daemons
8 Source0:        http://downloads.powerdns.com/releases/%{name}-%{version}.tar.gz
9 # Source0-md5:  3465694b9638c29f19a25dd5b0a77559
10 Source1:        http://downloads.powerdns.com/documentation/%{name}.pdf
11 # Source1-md5:  d7adf31d793735251c416d6ef5075cfa
12 Source2:        http://downloads.powerdns.com/documentation/%{name}.txt
13 Source3:        %{name}.init
14 Source4:        %{name}.conf
15 Source5:        %{name}.sysconfig
16 Patch0:         %{name}-unistd.patch
17 Patch1: ldap_utils.diff
18 URL:            http://www.powerdns.com/
19 BuildRequires:  bison
20 BuildRequires:  flex
21 BuildRequires:  libpq++-static
22 BuildRequires:  libstdc++-devel
23 BuildRequires:  mysql-devel
24 BuildRequires:  zlib-devel
25 BuildRequires:  openldap-devel
26 PreReq:         rc-scripts
27 Requires(pre):  /bin/id
28 Requires(pre):  /usr/sbin/useradd
29 Requires(pre):  /usr/sbin/groupadd
30 Requires(post,preun):   /sbin/chkconfig
31 Requires(postun):       /usr/sbin/userdel
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Provides:       nameserver
34 Obsoletes:      powerdns
35
36 %description
37 PowerDNS is a versatile nameserver which supports a large number of
38 different backends ranging from simple zonefiles to relational
39 databases and load balancing/failover algorithms.
40
41 %description -l pl
42 PowerDNS to wielofunkcyjny serwer nazw posiadaj±cy du¿± liczbê wtyczek
43 od prostych stref (a'la BIND) pocz±wszy, a na relacyjnych bazach
44 danych skoñczywszy oraz zawieraj±cy algorytmy zrównowa¿enia obci±¿enia
45 i prze³±czania w wypadku awarii.
46
47 %package backend-pipe
48 Summary:        PowerDNS support for custom pipe backend
49 Summary(pl):    Wsparcie PowerDNS dla w³asnego mechanizmu przechowywania stref
50 Group:          Development/Libraries
51
52 %description backend-pipe
53 This package allows creation of own backend using simple STDIN/STDOUT
54 API. Example backend script in perl is provided in package
55 documentation.
56
57 %description backend-pipe -l pl
58 Ten pakiet pozwala na utworzenie w³asnego mechanizmu przechowywania
59 stref za pomoc¹ prostego interfejsu STDIN/STDOUT. Przyk³adowy skrypt w
60 perlu zosta³ do³±czony do dokumentacji pakietu.
61
62 %package backend-gpgsql
63 Summary:        PowerDNS support for PostgreSQL
64 Summary(pl):    Wsparcie PowerDNS dla baz PostgresQL
65 Group:          Development/Libraries
66 Requires:       postgresql
67
68 %description backend-gpgsql
69 This package allows zone storage in PostgreSQL relational db tables.
70
71 %description backend-gpgsql -l pl
72 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
73 relacyjnej bazy danych PostgreSQL.
74
75 %package backend-gmysql
76 Summary:        PowerDNS support for MySQL
77 Summary(pl):    Wsparcie PowerDNS dla baz MySQL
78 Group:          Development/Libraries
79 Requires:       mysql
80
81 %description backend-gmysql
82 This package allows zone storage in MySQL relational db tables.
83
84 %description backend-gmysql -l pl
85 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
86 relacyjnej bazy danych MySQL.
87
88 %package backend-ldap
89 Summary:        PowerDNS support for LDAP
90 Summary(pl):    Wsparcie PowerDNS dla baz LDAP
91 Group:          Development/Libraries
92 Requires:       openldap
93
94 %description backend-ldap
95 This package allows zone storage in LDAP directory.
96
97 %description backend-ldap -l pl
98 Ten pakiet pozwala na przechowywanie danych o strefach w katalogu LDAP.
99
100 %prep
101 %setup -q
102 %patch0 -p1
103 %patch1 -p1
104 cp %{SOURCE1} .
105 cp %{SOURCE2} .
106
107 %build
108 CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\""
109 %configure \
110         --libdir=%{_libdir}/%{name} \
111         --sysconfdir=%{_sysconfdir}/%{name} \
112         --with-socketdir=/var/run \
113         --with-dynmodules="gmysql gpgsql pipe ldap" \
114         --with-modules="" \
115         --enable-mysql \
116         --enable-pgsql \
117         --with-pgsql-lib=/usr/lib \
118         --with-pgsql-includes=%{_includedir} \
119         --enable-ldap \
120         --disable-static
121
122 %{__make}
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126 install -d $RPM_BUILD_ROOT{%{_initrddir},%{_sysconfdir}/%{name},/etc/sysconfig}
127
128 %{__make} install \
129         DESTDIR=$RPM_BUILD_ROOT
130
131 install %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/%{name}
132 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
133 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/pdns
134
135 # useless - modules are dlopened by *.so
136 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %pre
142 if [ -n "`getgid djbdns`" ]; then
143         if [ "`getgid djbdns`" != "32" ]; then
144                 echo "Error: group djbdns doesn't have gid=32. Correct this before installing pdns." 1>&2
145                 exit 1
146         fi
147 else
148         /usr/sbin/groupadd -g 32 -r -f djbdns
149 fi
150 if [ -n "`id -u pdns 2>/dev/null`" ]; then
151         if [ "`id -u pdns`" != "30" ]; then
152                 echo "Error: user pdns doesn't have uid=30. Correct this before installing pdns." 1>&2
153                 exit 1
154         fi
155 else
156         /usr/sbin/useradd -u 30 -r -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns 1>&2
157 fi
158
159 %post
160 # dirty hack so the config file is processed correctly, and server does not respawn
161 TMP=`mktemp /tmp/pdns.install-tmp.XXXXXX`
162 sed 's/^ *//g' /etc/pdns/pdns.conf > $TMP
163 cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.rpmsave
164 mv $TMP /etc/pdns/pdns.conf
165
166 /sbin/chkconfig --add pdns
167 if [ -f /var/lock/subsys/pdns ]; then
168         /etc/rc.d/init.d/pdns restart >&2
169 else
170         echo "Run \"/etc/rc.d/init.d/pdns start\" to start pdns." >&2
171 fi
172
173 %preun
174 if [ "$1" = "0" ]; then
175         if [ -f /var/lock/subsys/pdns ]; then
176                 /etc/rc.d/init.d/pdns stop
177         fi
178         /sbin/chkconfig --del pdns
179 fi
180
181 %postun
182 if [ "$1" = "0" ]; then
183         /usr/sbin/userdel pdns
184 fi
185
186 %files
187 %defattr(644,root,root,755)
188 %doc ChangeLog HACKING INSTALL README TODO WARNING pdns.pdf pdns.txt
189 %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/%{name}/%{name}.conf
190 %config(noreplace) %attr(0754,root,root) %{_initrddir}/%{name}
191 %attr(640,root,root)  %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/pdns
192 %dir %{_sysconfdir}/%{name}
193 %attr(755,root,root) %{_sbindir}/*
194 %attr(755,root,root) %{_bindir}/*
195 %{_mandir}/man8/*
196
197 %files backend-gmysql
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/%{name}/*mysql*.so*
200
201 %files backend-gpgsql
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so*
204
205 %files backend-pipe
206 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_libdir}/%{name}/*pipe*.so*
208
209 %files backend-ldap
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/%{name}/*ldap*.so*
This page took 0.030443 seconds and 2 git commands to generate.