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