File pdns-recursor.spec of Package powerdns-recursor

Name: pdns-recursor

Version: 5.3.3
%define pkg_version 5.3.3

%define oname pdns-recursor

Release: 1
Summary: Modern, advanced and high performance recursing/non authoritative name server
Group: Productivity/Networking/DNS/Utilities
License: GPL-2.0
URL: https://powerdns.com/  
Source0: %{oname}-%{pkg_version}.tar.xz
Source1: vendor.tar.xz

BuildRequires: python3
BuildRequires: libsodium-devel
BuildRequires: lua-devel
BuildRequires: openssl-devel
BuildRequires: net-snmp-devel
BuildRequires: protobuf-devel
BuildRequires: fstrm-devel
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
BuildRequires: libcurl-devel
BuildRequires: cargo-packaging
BuildRequires: libboost_context-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: memory-constraints

BuildRequires: gcc13-c++
%define compiler_ver -13

%{?systemd_requires}

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

%prep
%autosetup -n %{oname}-%{pkg_version} -a1 -N

%build
export CXX=g++%{?compiler_ver}

%configure \
   --enable-nod

make %{?_smp_mflags}

%install
%make_install

sed -i 's/LimitNOFILE\s*=\s*[0-9]\+/LimitNOFILE=32768/' %{buildroot}/%{_unitdir}/%{oname}*.service
grep LimitNOFILE=32768 %{buildroot}/%{_unitdir}/%{oname}*.service

%pre
getent group pdns-recursor >/dev/null || groupadd -r pdns-recursor
getent passwd pdns-recursor >/dev/null || \
        useradd -r -g pdns-recursor -d / -s /sbin/nologin \
        -c "PowerDNS Recursor user" pdns-recursor
exit 0

%files
%defattr (-,root,root,-)
%{_bindir}/rec_control
%{_sbindir}/pdns_recursor
%{_mandir}/man1/pdns_recursor.1.gz
%{_mandir}/man1/rec_control.1.gz 
%config %{_sysconfdir}/recursor.yml-dist
%{_unitdir}/%{oname}.service
%{_unitdir}/%{oname}@.service
%doc README

%changelog
openSUSE Build Service is sponsored by