-1

How to execute some commands or scripts immediately after rpm installed and has to be run as part rpm install command.

I wrote a spec file to take back up of some files within directory and tar them. When I install rpm tar would be copied on file system how ever I had to untar the ball manually to desired location.

RPM spec %post doesn't execute in rpmbuild

The above lost helped me understand we can include %post steps in spec file itself which would do that job and commands get execute as part of rpm install command itself.

The %post section runs when you install an RPM Note that echo command included for test purpose are not executed.

Chris Papantonis
  • 720
  • 7
  • 18
Vaseem W
  • 69
  • 1
  • 7

1 Answers1

0

For more information on %post in spec file please refer http://ftp.rpm.org/max-rpm/s1-rpm-inside-scripts.html#S2-RPM-INSIDE-BUILD-TIME-SCRIPTS

Vaseem W
  • 69
  • 1
  • 7