%prep
-%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
+%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
%build
%if 0%{?rhel} < 8
%{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
-# change user and group to pdns-recursor
+# change user and group to pdns-recursor and add default include-dir
sed -i \
-e 's/# setuid=/setuid=pdns-recursor/' \
-e 's/# setgid=/setgid=pdns-recursor/' \
+ -e 's!# include-dir=.*!&\ninclude-dir=%{_sysconfdir}/%{name}/recursor.d!' \
%{buildroot}%{_sysconfdir}/%{name}/recursor.conf
# The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
%{_unitdir}/pdns-recursor.service
%{_unitdir}/pdns-recursor@.service
%dir %{_sysconfdir}/%{name}
+%dir %{_sysconfdir}/%{name}/recursor.d
%config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
%doc README