%files devel
%defattr(-,root,root)
-%{_prefix}/src/*/%{kver_kern}/*
+%{_prefix}/src/*/%{kver_kern}
%post
if [ -f /boot/System.map-%{kver_kern} ]; then
/sbin/depmod -a || exit 0
fi
+%postun devel
+rmdir %{_prefix}/src/@PACKAGE@-%{version}-@ZFS_META_RELEASE@ 2>/dev/null
+exit 0
+
%endif
%if %{?with_kernel_debug}
%files debug-devel
%defattr(-,root,root)
-%{_prefix}/src/*/%{kver_dbug}/*
+%{_prefix}/src/*/%{kver_dbug}
%post debug
if [ -f /boot/System.map-%{kver_dbug} ]; then
/sbin/depmod -a || exit 0
fi
+%postun debug-devel
+rmdir %{_prefix}/src/@PACKAGE@-%{version}-@ZFS_META_RELEASE@ 2>/dev/null
+exit 0
+
%endif
%if %{?with_kernel_dkms}
%files dkms
%defattr(-,root,root)
-%{_prefix}/src/@PACKAGE@-%{version}/*
+%{_prefix}/src/@PACKAGE@-%{version}
%post dkms
for POSTINST in %{_prefix}/lib/dkms/common.postinst; do