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

# 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
BuildRequires:  lua-devel
%define lua_lib lua
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %insserv_prereq %fillup_prereq pwdutils
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

PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
package if you need a dns cache for your network.


%setup -n %{name}-%{pkg_version}

%{__make} OPTFLAGS="%{optflags}" \
  LUA=1 LUA_LIBS_CONFIG="-l%lua_lib" LUA_CPPFLAGS_CONFIG="-I/usr/include/lua5.1"

%{__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}

%{__rm} -rf %{buildroot}

/usr/sbin/groupadd -r pdns &>/dev/null || :
/usr/sbin/useradd -o -g pdns -s /bin/false -r -c "pdns" -d %{home} pdns &>/dev/null || :

%{fillup_and_insserv pdns-recursor}

%stop_on_removal pdns-recursor

%restart_on_update pdns-recursor

%defattr (-,root,root,-)
%dir %{_sysconfdir}/pdns/
%config(noreplace) %{_sysconfdir}/pdns/recursor.conf
%config %{_sysconfdir}/pdns/recursor.conf-dist
%config(noreplace) %{_sysconfdir}/init.d/%{name}
%doc README COPYING rrd/ powerdns-example-script.lua
%dir %{home}
%ghost %dir %{_localstatedir}