mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Cleanly remove spl-modules-devel headers
Add the /usr/src/spl-<version>-<release>/<kernel> directory to the spl-modules-devel package. This ensures that this directory will be removed when the package is removed. We do not include the higher level /usr/src/spl-<version>-<release> directory since there may be builds for multiple kernels. Instead, a %postun rmdir is added which attempts to remove this directory. It will only succeed when the last spl-modules-devel-* package for this specific release is removed. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
d83d25c2f8
commit
3679829092
@ -497,7 +497,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_prefix}/src/*/%{kver_kern}/*
|
%{_prefix}/src/*/%{kver_kern}
|
||||||
|
|
||||||
%post
|
%post
|
||||||
if [ -f /boot/System.map-%{kver_kern} ]; then
|
if [ -f /boot/System.map-%{kver_kern} ]; then
|
||||||
@ -513,6 +513,10 @@ else
|
|||||||
/sbin/depmod -a || exit 0
|
/sbin/depmod -a || exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
%postun devel
|
||||||
|
rmdir %{_prefix}/src/@PACKAGE@-%{version}-@SPL_META_RELEASE@ 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
%if %{?with_kernel_debug}
|
%if %{?with_kernel_debug}
|
||||||
|
|
||||||
@ -522,7 +526,7 @@ fi
|
|||||||
|
|
||||||
%files debug-devel
|
%files debug-devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_prefix}/src/*/%{kver_dbug}/*
|
%{_prefix}/src/*/%{kver_dbug}
|
||||||
|
|
||||||
%post debug
|
%post debug
|
||||||
if [ -f /boot/System.map-%{kver_dbug} ]; then
|
if [ -f /boot/System.map-%{kver_dbug} ]; then
|
||||||
@ -538,12 +542,16 @@ else
|
|||||||
/sbin/depmod -a || exit 0
|
/sbin/depmod -a || exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
%postun debug-devel
|
||||||
|
rmdir %{_prefix}/src/@PACKAGE@-%{version}-@SPL_META_RELEASE@ 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
%if %{?with_kernel_dkms}
|
%if %{?with_kernel_dkms}
|
||||||
|
|
||||||
%files dkms
|
%files dkms
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_prefix}/src/@PACKAGE@-%{version}/*
|
%{_prefix}/src/@PACKAGE@-%{version}
|
||||||
|
|
||||||
%post dkms
|
%post dkms
|
||||||
for POSTINST in %{_prefix}/lib/dkms/common.postinst; do
|
for POSTINST in %{_prefix}/lib/dkms/common.postinst; do
|
||||||
|
Loading…
Reference in New Issue
Block a user