I just created rpm package which contains few shell scripts and My rpm executes those shell scripts in post installation step ( i.e %post section).
My RPM is created successfully and when I run
rpm -ivh myrpmfile.rpm
Warning: RPMDB altered outside of yum
You can't call
yum from your
%post because the database is locked. If you need other packages installed, you set them as
Required. If your RPM also installs the yum repo files, then you need to make them into two RPMs.
That warning is just because you used
rpm directly "behind its back" and most likely is a red herring.