%preun # Actions before package is uninstalled # Stop the service if it is running if [ $1 -eq 0 ]; then /bin/systemctl stop ksmd-taskset.service fi
%postun # Actions after package is uninstalled # Disable the service if [ $1 -eq 0 ]; then /bin/systemctl disable ksmd-taskset.service fi # Remove the service file and script rm -f /usr/lib/ctyunos/ksmd_taskset.sh rm -f /etc/systemd/system/ksmd-taskset.service /bin/systemctl daemon-reload
%changelog * Fri Aug 01 2024 Your Name <your.email@example.com> - 1.0-1 - Initial package
步骤3:构建RPM包
确保你已经安装了rpm-build工具包,然后执行以下命令来构建RPM包:
1 2
cd ksmd-taskset rpmbuild --define "_topdir $(pwd)" -ba SPECS/ksmd-taskset.spec