@@ -40,6 +40,8 @@ echo "Source: kernel-$__KERNELRELEASE.tar.gz"
fi
echo "BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root"
+echo "Requires(post): /sbin/new-kernel-pkg"
+echo "Requires(preun): /sbin/new-kernel-pkg"
echo "Provides: $PROVIDES"
echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
echo "%define debug_package %{nil}"
@@ -95,6 +97,14 @@ echo 'mv vmlinux.orig vmlinux'
echo "%endif"
echo ""
+echo "%preun"
+echo '/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove '"$KERNELRELEASE"' || exit $?'
+
+echo ""
+echo "%post"
+echo '/sbin/new-kernel-pkg --mkinitrd --depmod --install --make-default '"$KERNELRELEASE"' || exit $?'
+
+echo ""
echo "%clean"
echo 'rm -rf $RPM_BUILD_ROOT'
echo ""