Accepting request 504782 from home:ndas:branches:network:vpn

- use %{_tmpfilesdir} for tmpfiles.d/openvpn.conf (bsc#1044223)

OBS-URL: https://build.opensuse.org/request/show/504782
OBS-URL: https://build.opensuse.org/package/show/network:vpn/openvpn?expand=0&rev=122
This commit is contained in:
Nirmoy Das 2017-06-19 14:48:58 +00:00 committed by Git OBS Bridge
parent 0c21985672
commit 6eab1b0fe1
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jun 14 12:05:14 CEST 2017 - ndas@suse.de
- use %{_tmpfilesdir} for tmpfiles.d/openvpn.conf (bsc#1044223)
-------------------------------------------------------------------
Tue Jun 6 14:59:29 CEST 2017 - ndas@suse.de

View File

@ -180,12 +180,14 @@ mkdir -p %{buildroot}/%{_datadir}/openvpn
%if %{with_systemd}
rm %{buildroot}%{_libdir}/systemd/system/openvpn-client@.service
rm %{buildroot}%{_libdir}/systemd/system/openvpn-server@.service
#use one proveded by suse
rm %{buildroot}%{_libdir}/tmpfiles.d/openvpn.conf
install -D -m 644 %{name}.service %{buildroot}/%{_unitdir}/%{name}@.service
install -D -m 644 $RPM_SOURCE_DIR/%{name}.target %{buildroot}/%{_unitdir}/%{name}.target
install -D -m 755 $RPM_SOURCE_DIR/rc%{name} %{buildroot}%{_sbindir}/rc%{name}
# tmpfiles.d
mkdir -p %{buildroot}%{_libdir}/tmpfiles.d
install -m 0644 $RPM_SOURCE_DIR/%{name}-tmpfile.conf %{buildroot}%{_libdir}/tmpfiles.d/%{name}.conf
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 $RPM_SOURCE_DIR/%{name}-tmpfile.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf
%else
install -D -m 755 $RPM_SOURCE_DIR/openvpn.init %{buildroot}/%{_sysconfdir}/init.d/openvpn
ln -sv %{_sysconfdir}/init.d/openvpn %{buildroot}/%{_sbindir}/rcopenvpn
@ -204,7 +206,7 @@ find sample -name .gitignore | xargs rm -f
%post
%if %{with_systemd}
systemd-tmpfiles --create %{_libdir}/tmpfiles.d/%{name}.conf ||:
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf ||:
%service_add_post %{name}.target
# try to migrate openvpn.service autostart to openvpn@<CONF>.service
if test ${FIRST_ARG:-$1} -ge 1 -a \
@ -274,7 +276,7 @@ rm -f %{_sysconfdir}/sysconfig/openvpn || :
%dir %{_libdir}/tmpfiles.d
%{_unitdir}/%{name}@.service
%{_unitdir}/%{name}.target
%{_libdir}/tmpfiles.d/%{name}.conf
%{_tmpfilesdir}/%{name}.conf
%dir %attr(0750,root,root) %ghost %{_rundir}/openvpn/
%else
%config %{_sysconfdir}/init.d/openvpn