1

I try to build rpm package. I follow here.

I want to run a script (bash or python) when run command as "rpm -Uvh mytest-1.0-1.el6.noarch.rpm" .

Could run a script when install a rpm package? How?

2 Answers 2

3

From the RPM Guide:

Defining installation scripts:

RPM supports a script run prior to installation, %pre, and a script run after installation, %post. The same concepts apply when a package is erased, or uninstalled. The %preun script is run just before the uninstall and the %postun script just after the uninstal

So, use the %pre section if you want to run the script right before the package is installed or the %post section if you want to run it after the package is installed.


See also Mandriva Howto, rpm.org

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.