+1 for KSnapshot (For those of us running KDE 4 still)
Very good article, thank you for this.
In regards to the %pre %post statement, be very very careful with those. When doing updates, the order of %pre, %post, and other scripts do not happen in the order many people think. The following is found at the end of the trigger document ( cat /usr/share/doc/rpm*/triggers )
For reference, here's the order in which scripts are executed on a single
any-%triggerprein (%triggerprein from other packages set off by new install)
new-%pre for new version of package being installed
... (all new files are installed)
new-%post for new version of package being installed
any-%triggerin (%triggerin from other packages set off by new install)
any-%triggerun (%triggerun from other packages set off by old uninstall)
old-%preun for old version of package being removed
... (all old files are removed)
old-%postun for old version of package being removed
any-%triggerpostun (%triggerpostun from other packages set off by old un
Your first thought when looking at that should be *youch*, how can I ever get my updates to work the way I want them to.
When each script get's run, they get passed how many instances of the package are installed. How does that help?
It allows you to do if statements to determine if a script should be run or not.
echo "%name-%version-%release : POSTUN : \$1=$1"
if [ "$1" -eq 0 ] ; then
echo " We are the last rpm, we should really run our script"
if [ "$1" -ge 1 ] ; then
echo " We are not the last rpm, run our script with care"
I just put my testrpm spec files up on github if you want a better set of examples on when scripts run. I've been using these for many years whenever I'm unclear on which script is run and when.