]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Install a small YAML default config instead of one with everything commented out 14265/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 7 Jun 2024 11:49:49 +0000 (13:49 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 21 Jun 2024 09:06:26 +0000 (11:06 +0200)
builder-support/debian/recursor/debian-buster/rules
builder-support/specs/pdns-recursor.spec

index 00bb032a61e68c5c7664a1d8219f7af3e1e2df0c..2806c456a8ad0e30cddd192c729f0f7ba1b9e564 100755 (executable)
@@ -41,15 +41,20 @@ override_dh_auto_install:
        install -m 644 -t debian/pdns-recursor/usr/share/pdns-recursor/snmp RECURSOR-MIB.txt
        rm -f debian/pdns-recursor/etc/powerdns/recursor.conf-dist
        rm -f debian/pdns-recursor/etc/powerdns/recursor.yml-dist
-       dir=$$(mktemp -d) && touch "$$dir/recursor.yml" && ./pdns_recursor --config-dir="$$dir" --config=default 2> /dev/null | sed \
-               -e 's!^#\(.*config_dir: \).*!\1/etc/powerdns!' \
-               -e 's!^#\(.*hint_file: \).*!\1/usr/share/dns/root.hints!' \
-               -e 's!^#\(.*include_dir: \).*!\1/etc/powerdns/recursor.d!' \
-               -e 's!^#\(.*local_address: \).*\1!127.0.0.1!' \
-               -e 's!^#\(.*lua_config_file: \).*!\1/etc/powerdns/recursor.lua!' \
-               -e 's!^#\(.*quiet: \)=.*!\1=true!' \
-               -e '/^#.*version_string:.*/d' \
-               > debian/pdns-recursor/etc/powerdns/recursor.conf
+       @echo "\
+       dnssec:\n\
+         # validation: process\n\
+       recursor:\n\
+         hint_file: /usr/share/dns/root.hints\n\
+         include_dir: /etc/powerdns/recursor.d\n\
+         lua_config_file: /etc/powerdns/recursor.lua\n\
+       incoming:\n\
+        # listen:\n\
+        # - 127.0.0.1\n\
+       outgoing:\n\
+        # source_address:\n\
+        # - 0.0.0.0\n\
+       " > debian/pdns-recursor/etc/powerdns/recursor.conf
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
index cd0a4637dbc8300ffbb241f0327b9886caaac049..bc478d433e558092b0435ed292f44d98d1b5728a 100644 (file)
@@ -81,15 +81,23 @@ make %{?_smp_mflags} check || (cat test-suite.log && false)
 %install
 make install DESTDIR=%{buildroot}
 
-%{__cp} %{buildroot}%{_sysconfdir}/%{name}/recursor.{yml-dist,conf}
 %{__mkdir} %{buildroot}%{_sysconfdir}/%{name}/recursor.d
 
 # change user and group to pdns-recursor and add default include-dir
-sed -i \
-    -e 's/# \(.*setuid: \).*/\1pdns-recursor/' \
-    -e 's/# \(.*setgid: \).*/\1pdns-recursor/' \
-    -e 's!# \(.*include_dir: \).*!\1%{_sysconfdir}/%{name}/recursor.d!' \
-    %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
+cat << EOF > %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
+dnssec:
+  # validation: process
+recursor:
+  include_dir: %{_sysconfdir}/%{name}/recursor.d
+  setuid: pdns-recursor
+  setgid: pdns-recursor
+incoming:
+  # listen:
+  # - 127.0.0.1
+outgoing:
+  # source_address:
+  # - 0.0.0.0
+EOF
 
 %{__install } -d %{buildroot}/%{_sharedstatedir}/%{name}