Browse files

Cleanly remove zfs-modules-devel headers

Add the /usr/src/zfs-<version>-<release>/<kernel> directory to
the zfs-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/zfs-<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 zfs-modules-devel-* package
for this specific release is removed.

Signed-off-by: Brian Behlendorf <>
  • Loading branch information...
1 parent bafc4e9 commit 9ca431763e2db4c05858ed7dc578a8d6dbcc54d6 @behlendorf committed Aug 13, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3
@@ -579,7 +579,7 @@ rm -rf $RPM_BUILD_ROOT
%files devel
if [ -f /boot/{kver_kern} ]; then
@@ -595,6 +595,10 @@ else
/sbin/depmod -a || exit 0
+%postun devel
+rmdir %{_prefix}/src/@PACKAGE@-%{version}-@ZFS_META_RELEASE@ 2>/dev/null
+exit 0
%if %{?with_kernel_debug}
@@ -604,7 +608,7 @@ fi
%files debug-devel
%post debug
if [ -f /boot/{kver_dbug} ]; then
@@ -620,12 +624,16 @@ else
/sbin/depmod -a || exit 0
+%postun debug-devel
+rmdir %{_prefix}/src/@PACKAGE@-%{version}-@ZFS_META_RELEASE@ 2>/dev/null
+exit 0
%if %{?with_kernel_dkms}
%files dkms
%post dkms
for POSTINST in %{_prefix}/lib/dkms/common.postinst; do

0 comments on commit 9ca4317

Please sign in to comment.