File pdns-recursor.spec of Package pdns-recursor
#
# spec file for package pdns-recursor (Version 3.2)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: pdns-recursor
Version: 3.2
Release: 1
%define pkg_version 3.2
#
Group: Productivity/Networking/DNS/Servers
License: GPLv2+
#
%define home %{_var}/lib/pdns
%define _localstatedir %{_var}/run/pdns
BuildRequires: boost-devel gcc-c++
%if 0%{?suse_version} < 1030
BuildRequires: lua51-devel
%define lua_lib lua5.1
%else
BuildRequires: lua-devel
%define lua_lib lua
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq %fillup_prereq pwdutils
#
Url: http://www.powerdns.com/
Source: http://downloads.powerdns.com/releases/%{name}-%{pkg_version}.tar.bz2
Source1: pdns-recursor.init
Source2: recursor.conf
Patch: pdns-recursor-%{version}_config.patch
Patch1: pdns-recursor-3.2rc1-strip.patch
#
Summary: Modern, advanced and high performance recursing/non authoritative nameserver
%description
PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
package if you need a dns cache for your network.
Authors:
--------
http://www.powerdns.com
%prep
%setup -n %{name}-%{pkg_version}
%patch
%patch1
%build
%{__make} OPTFLAGS="%{optflags}" \
LUA=1 LUA_LIBS_CONFIG="-l%lua_lib" LUA_CPPFLAGS_CONFIG="-I/usr/include/lua5.1"
%install
%{__install} -Dd -m 0755 %{buildroot}{%{home},%{_localstatedir}}
%makeinstall CONFIGDIR="%{_sysconfdir}/pdns" BINDIR="%{_sbindir}"
%{__install} -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/pdns/recursor.conf
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%clean
%{__rm} -rf %{buildroot}
%pre
/usr/sbin/groupadd -r pdns &>/dev/null || :
/usr/sbin/useradd -o -g pdns -s /bin/false -r -c "pdns" -d %{home} pdns &>/dev/null || :
%post
%{fillup_and_insserv pdns-recursor}
%preun
%stop_on_removal pdns-recursor
%postun
%restart_on_update pdns-recursor
%insserv_cleanup
%files
%defattr (-,root,root,-)
%dir %{_sysconfdir}/pdns/
%config(noreplace) %{_sysconfdir}/pdns/recursor.conf
%config %{_sysconfdir}/pdns/recursor.conf-dist
%config(noreplace) %{_sysconfdir}/init.d/%{name}
%{_sbindir}/rcpdns-recursor
%{_sbindir}/pdns_recursor
%{_sbindir}/rec_control
%{_mandir}/man1/pdns_recursor.1*
%{_mandir}/man1/rec_control.1*
%doc README COPYING rrd/ powerdns-example-script.lua
%dir %{home}
%ghost %dir %{_localstatedir}
%changelog