Browse Source

nsd-4.3.8-2

Tomohiro "Tomo-p" KATO 2 years ago
parent
commit
a70b28e2f4
1 changed files with 17 additions and 7 deletions
  1. 17 7
      n/nsd/nsd-vl.spec

+ 17 - 7
n/nsd/nsd-vl.spec

@@ -4,7 +4,7 @@ Summary: Fast and lean authoritative DNS Name Server
 Summary(ja): 高速で最小限のAuthoritative専用DNSネームサーバ
 Name: nsd
 Version: 4.3.8
-Release: 1%{?_dist_release}%{?with_systemd:.systemd}
+Release: 2%{?_dist_release}%{?with_systemd:.systemd}
 Group: servers
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -95,7 +95,7 @@ install -d -m 0700 %{buildroot}%{_localstatedir}/lib/%{name}
 
 %if %{with systemd}
 mkdir -p %{buildroot}%{_unitdir}
-install -m 0644 %{SOURCE10} %{SOURCE11} %{buildroot}%{_unitdir}
+install -m 0644 %{SOURCE10} %{buildroot}%{_unitdir}
 mkdir -p %{buildroot}%{_tmpfilesdir}
 install -m 0644 %{SOURCE12} %{buildroot}%{_tmpfilesdir}/nsd.conf
 %else
@@ -116,6 +116,13 @@ sed -i \
 	-e 's|# control-interface: ::1|control-interface: %{piddir}/nsd.ctl|' \
 	%{buildroot}%{_sysconfdir}/nsd/nsd.conf
 
+# Install ghost files
+for name in control server; do
+	for extension in key pem; do
+		touch %{buildroot}%{_sysconfdir}/nsd/nsd_${name}.${extension}
+	done
+done
+
 
 %clean
 rm -rf ${RPM_BUILD_ROOT}
@@ -133,7 +140,6 @@ chown -R nsd.nsd %{_localstatedir}/lib/nsd 2>/dev/null ||:
 chown -R nsd.nsd %{_localstatedir}/run/nsd 2>/dev/null ||:
 %if %{with systemd}
 %systemd_post nsd.service
-%systemd_post nsd-keygen.service
 %else
 /sbin/chkconfig --add %{name}
 if [ ! -f %{_sysconfdir}/nsd/nsd_control.pem ]; then
@@ -144,7 +150,6 @@ fi
 %preun
 %if %{with systemd}
 %systemd_preun nsd.service
-%systemd_preun nsd-keygen.service
 %else
 if [ $1 -eq 0 -o -x /bin/systemctl ]; then
         /sbin/service %{name} stop
@@ -155,7 +160,6 @@ fi
 %postun
 %if %{with systemd}
 %systemd_postun_with_restart nsd.service
-%systemd_postun nsd-keygen.service
 %else
 if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then
   /sbin/service %{name} condrestart 
@@ -170,21 +174,27 @@ fi
 %dir %{_sysconfdir}/nsd/
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.conf
 #%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.zones
+%attr(0640,root,nsd) %ghost %{_sysconfdir}/nsd/nsd_server.key
+%attr(0640,root,nsd) %ghost %{_sysconfdir}/nsd/nsd_server.pem
+%attr(0640,root,nsd) %ghost %{_sysconfdir}/nsd/nsd_control.key
+%attr(0640,root,nsd) %ghost %{_sysconfdir}/nsd/nsd_control.pem
 %if %{with systemd}
 %attr(0644,root,root) %{_unitdir}/nsd.service
-%attr(0644,root,root) %{_unitdir}/nsd-keygen.service
 %attr(0644,root,root) %{_tmpfilesdir}/nsd.conf
 %else
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/nsd
 %attr(0755,root,root) %{_initrddir}/%{name}
-%endif
 %ghost %attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name}
+%endif
 %attr(0755,%{name},%{name}) %dir %{_localstatedir}/lib/%{name}
 %{_sbindir}/*
 %{_mandir}/*/*
 
 
 %changelog
+* Fri Dec 03 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.3.8-2
+- fixed systemd-unit.
+
 * Tue Oct 12 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.3.8-1
 - new upstream release.