Search
j0ke.net Open Build Service
>
Projects
>
server:dns
>
pdns-recursor
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 24
[-]
[+]
Changed
pdns-recursor.spec
@@ -29,6 +29,11 @@ Requires: pwdutils %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if 0%{?suse_version} >= 1210 || 0%{?sles_version} >= 12 || 0%{?rhel} >= 7 +BuildRequires: systemd +%{?systemd_requires} +%define has_systemd 1 +%endif %if 0%{?suse_version} PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/groupadd %endif @@ -72,12 +77,16 @@ %{__install} -Dd -m 0755 %{buildroot}{%{home},%{_localstatedir}} %__make DESTDIR=%{buildroot} install SYSCONFDIR="%{_sysconfdir}/pdns" BINDIR="%{_sbindir}" %{__install} -D -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/pdns/recursor.conf +%if 0%{?has_systemd} +%{__install} -D -m 0644 contrib/systemd-pdns-recursor.service %{buildroot}%{_unitdir}/pdns-recursor.service +%else %if 0%{?suse_version} %{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name} %else %{__install} -D -m 0755 pdns-recursor.init.d %{buildroot}%{_sysconfdir}/init.d/%{name} %endif %{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name} +%endif %{__install} -m 0755 -d %{buildroot}%{_datadir}/%{name} cp -R rrd %{buildroot}%{_datadir}/%{name}/ %clean @@ -87,29 +96,46 @@ /usr/sbin/groupadd -r pdns &>/dev/null || : /usr/sbin/useradd -o -g pdns -s /bin/false -r -c "pdns" -d %{home} pdns &>/dev/null || : +%if 0%{?has_systemd} +%service_add_pre pdns-recursor.service +%endif + %post %if 0%{?suse_version} %{fillup_and_insserv pdns-recursor} %endif +%if 0%{?has_systemd} +%service_add_post pdns-recursor.service +%endif %preun %if 0%{?suse_version} %stop_on_removal pdns-recursor %endif +%if 0%{?has_systemd} +%service_del_preun pdns-recursor.service +%endif %postun %if 0%{?suse_version} %restart_on_update pdns-recursor %insserv_cleanup %endif +%if 0%{?has_systemd} +%service_del_postun pdns-recursor.service +%endif %files %defattr (-,root,root,-) %dir %{_sysconfdir}/pdns/ %config(noreplace) %{_sysconfdir}/pdns/recursor.conf %config %{_sysconfdir}/pdns/recursor.conf-dist +%if 0%{?has_systemd} +%{_unitdir}/pdns-recursor.service +%else %{_sysconfdir}/init.d/%{name} %{_sbindir}/rcpdns-recursor +%endif %{_sbindir}/pdns_recursor %{_sbindir}/rec_control %{_mandir}/man1/pdns_recursor.1*