SHA256
1
0
forked from pool/dkms

- Update the dkms chrooting to use the tmpfiles macros from systemd

OBS-URL: https://build.opensuse.org/package/show/X11:Bumblebee/dkms?expand=0&rev=19
This commit is contained in:
Tomáš Chvátal 2017-04-24 11:58:45 +00:00 committed by Git OBS Bridge
parent 8df0ee7d04
commit a713a8fd80
2 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Apr 24 11:58:23 UTC 2017 - tchvatal@suse.com
- Update the dkms chrooting to use the tmpfiles macros from systemd
-------------------------------------------------------------------
Wed Feb 1 09:50:43 UTC 2017 - bumblebee.obs@gmail.com

View File

@ -65,7 +65,7 @@ make install DESTDIR=%{buildroot} \
BASHDIR=%{buildroot}%{_sysconfdir}/bash_completion.d \
LIBDIR=%{buildroot}%{_libexecdir}/%{name}
make install-doc DESTDIR=%{buildroot} \
DOCDIR=%{buildroot}%{_datadir}/doc/packages/%{name}
DOCDIR=%{buildroot}%{_docdir}/%{name}
# systemd
mkdir -p %{buildroot}%{_unitdir}
@ -78,19 +78,23 @@ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcdkms
# remove regular init file
rm -rf %{buildroot}%{_sysconfdir}/rc.d/init.d/dkms_autoinstaller
sed -i \
-e 's:# tmp_location="/tmp":tmp_location="%{_localstatedir}/tmp/dkms":' \
%{buildroot}%{_sysconfdir}/dkms/framework.conf
# Install /usr/lib/tmpfiles.d/dkms.conf
mkdir -p %{buildroot}%{_tmpfilesdir}
cat > %{buildroot}%{_tmpfilesdir}/dkms.conf <<EOF
# See tmpfiles.d(5) for details
d %{_localstatedir}/tmp/dkms 0700 root root -
EOF
%pre
%service_add_pre dkms.service
exit 0
%post
# make it more secure
if [ ! -d %{_tmppath}/dkms ] ;
then
mkdir -p %{_tmppath}/dkms
chmod 700 %{_tmppath}/dkms
fi
sed -i -e 's,# tmp_location="/tmp",tmp_location="%{_tmppath}/dkms",' %{_sysconfdir}/dkms/framework.conf
%tmpfiles_create %{_tmpfilesdir}/dkms.conf
# enable on initial install
%service_add_post dkms.service
exit 0
@ -110,6 +114,7 @@ exit 0
%{_sbindir}/rcdkms
%{_localstatedir}/lib/%{name}
%{_libexecdir}/%{name}
%{_tmpfilesdir}/dkms.conf
%{_mandir}/*/*
%config(noreplace) %{_sysconfdir}/%{name}
%doc sample.spec sample.conf AUTHORS COPYING README.dkms