LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File pdns-recursor.spec of Package pdns-recursor (Project server:dns)

#
# spec file for package pdns-recursor (Version 3.1.7.1)
#
# Copyright (c) 2009 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.5.3
Release:        1
%define pkg_version    %{version}
#
Group:          Productivity/Networking/DNS/Servers
License:        GPL-2.0+
#
%define home           %{_var}/lib/pdns
%define _localstatedir %{_var}/run/pdns
BuildRequires:  boost-devel gcc-c++
%if 0%{?suse_version} && (0%{?suse_version} < 1030 || 0%{?suse_version} > 1210)
BuildRequires:  lua51-devel
%if 0%{?suse_version} > 1210
%define lua_lib lua
%else
%define lua_lib lua5.1
%endif
%else
BuildRequires:  lua-devel
%define lua_lib lua
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
PreReq:         %insserv_prereq %fillup_prereq
PreReq:         pwdutils
%else
PreReq:         shadow-utils
%endif
#
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
Patch2:         pdns-rec-lua52.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
%patch2

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

%install
%{__install} -Dd -m 0755 %{buildroot}{%{home},%{_localstatedir}}
make install DESTDIR="%{buildroot}" 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 -g pdns -s /bin/false -r -c "pdns" -d %{home} pdns &>/dev/null || :

%post
%if 0%{?suse_version}
%{fillup_and_insserv pdns-recursor}
%endif

%preun
%if 0%{?suse_version}
%stop_on_removal pdns-recursor
%endif

%postun
%if 0%{?suse_version}
%restart_on_update pdns-recursor
%insserv_cleanup
%endif

%files
%defattr (-,root,root,-)
%dir %{_sysconfdir}/pdns/
%config(noreplace) %{_sysconfdir}/pdns/recursor.conf
%{_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