Topic: How to perform operation in post section of rpm spec when reinstalling
I have a use case where I want to execute a particular command in the post section of rpm spec only when same version of rpm is already installed. Rpm will be invoked with following option:
rpm -Uvh --replacefiles --replacepkgs rpm_file_name
Condition if [ "$1" = "2" ]; is not useful here because it becomes true for upgrades also.
How can a reinstall case be detected in spec?