Accepting request 574119 from home:nkukreja:branches:network

- Implement systemd init scripts for bind and lwresd (fate#323155)

OBS-URL: https://build.opensuse.org/request/show/574119
OBS-URL: https://build.opensuse.org/package/show/network/bind?expand=0&rev=230
This commit is contained in:
Navin Kukreja 2018-02-08 13:15:18 +00:00 committed by Git OBS Bridge
parent 41f90b8125
commit c27658fca1
3 changed files with 42 additions and 9 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Feb 7 15:17:17 UTC 2018 - navin.kukreja@suse.com
- Implement systemd init scripts for bind and lwresd (fate#323155)
-------------------------------------------------------------------
Tue Jan 23 21:59:24 UTC 2018 - navin.kukreja@suse.com

View File

@ -43,7 +43,12 @@
%define GROUPADD_NAMED getent group %{NAMED_GID_NAME} >/dev/null || %{_sbindir}/groupadd -g %{NAMED_GID} -o -r %{NAMED_GID_NAME}
%define USERADD_NAMED getent passwd %{NAMED_UID_NAME} >/dev/null || %{_sbindir}/useradd -r -o -g %{NAMED_GID_NAME} -u %{NAMED_UID} -s %{NAMED_SHELL} -c "%{NAMED_COMMENT}" -d %{NAMED_HOMEDIR} %{NAMED_UID_NAME}
%define USERMOD_NAMED getent passwd %{NAMED_UID_NAME} >/dev/null || %{_sbindir}/usermod -s %{NAMED_SHELL} -d %{NAMED_HOMEDIR} %{NAMED_UID_NAME}
%if 0%{?suse_version} >= 1500
%define with_systemd 1
%else
%define with_systemd 0
%endif
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
@ -99,9 +104,11 @@ Provides: bind9
Provides: dns_daemon
Obsoletes: bind8 < %{version}
Obsoletes: bind9 < %{version}
%{?systemd_requires}
%if %{with_systemd}
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%else
Requires(post): %insserv_prereq
%endif
@ -313,12 +320,11 @@ function replaceStrings()
sed -e "s@__NSD__@/lib@g" \
-e "s@__BIND_PACKAGE_NAME__@%{name}@g" \
-e "s@__VENDOR__@%{VENDOR}@g" \
-e "s@___lib__@%{_lib}@g" \
-e "s@__openssl__@$(pkg-config --variable=enginesdir libcrypto)@g" \
-i "${file}"
}
pushd vendor-files
for file in docu/README tools/createNamedConfInclude config/{README,named.conf} init/{named,lwresd} sysconfig/{named-common,named-named,syslog-named}; do
for file in docu/README tools/createNamedConfInclude config/{README,named.conf} init/{named,lwresd} system/{named.init,lwresd.init} sysconfig/{named-common,named-named,syslog-named}; do
replaceStrings ${file}
done
popd
@ -349,6 +355,9 @@ export CFLAGS="%{optflags}"
--with-gssapi=yes \
--disable-isc-spnego \
--enable-fixed-rrset \
%if %{with_systemd}
--with-systemd \
%endif
--enable-full-report
# disable rpath
sed -i '
@ -387,10 +396,19 @@ mv vendor-files/config/rndc-access.conf %{buildroot}/%{_sysconfdir}/named.d
for file in lwresd.conf named.conf.include rndc.key; do
touch %{buildroot}/%{_sysconfdir}/${file}
done
%if %{with_systemd}
for file in lwresd named; do
install -D -m 0644 vendor-files/system/${file}.service %{buildroot}%{_unitdir}/${file}.service
install -m 0755 vendor-files/system/${file}.init %{buildroot}/usr/sbin/${file}.init
ln -s /sbin/service %{buildroot}%{_sbindir}/rc${file}
done
%else
for file in lwresd named; do
install -m 0754 vendor-files/init/${file} %{buildroot}%{_initddir}/${file}
ln -sf %{_initddir}/${file} %{buildroot}%{_sbindir}/rc${file}
done
%endif
install -m 0644 ${RPM_SOURCE_DIR}/named.root %{buildroot}%{_localstatedir}/lib/named/root.hint
mv vendor-files/config/{127.0.0,localhost}.zone %{buildroot}%{_localstatedir}/lib/named
install -m 0754 vendor-files/tools/createNamedConfInclude %{buildroot}/%{_datadir}/bind
@ -674,7 +692,12 @@ fi
%attr(0644,root,root) /%{_sysconfdir}/slp.reg.d/bind.reg
%attr(0644,root,named) %ghost /%{_sysconfdir}/named.conf.include
%attr(0640,root,named) %ghost %config(noreplace) /%{_sysconfdir}/rndc.key
%if %{with_systemd}
%config %{_unitdir}/named.service
%{_sbindir}/named.init
%else
%config /%{_sysconfdir}/init.d/named
%endif
%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/bind
%{_bindir}/bind9-config
%{_bindir}/named-rrchecker
@ -766,7 +789,12 @@ fi
%files lwresd
%ghost %attr(0644,root,named) %config(noreplace) /%{_sysconfdir}/lwresd.conf
%if %{with_systemd}
%config %{_unitdir}/lwresd.service
%{_sbindir}/lwresd.init
%else
%config %{_initddir}/lwresd
%endif
%{_sbindir}/rclwresd
%{_sbindir}/lwresd
%{_mandir}/man8/lwresd.8%{ext_man}

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bfee484250131455a86adddc0377a72b8a744bd7c012d97c26aec1ac3d96b51d
size 22291
oid sha256:fe5609bed079427793fef2bdc22a16d397b2dd358fd986e7e5315f567de2dc1e
size 23552