On Mon, Sep 11, 2000 at 09:51:32AM +0200, Michael A. Peters wrote:
> I build mod_php rpm's and am having a problem with %post and %postun
> script.
>
Yup, rpm installs before removing so your scriptlets are not running
in the order that you expect.
Your %preun is undoing what the %post has done. You need to distinguish
a pure remove pathway (i.e. rpm -e ...) from an upgrade pathway by testing
argv[1] (argv[1] contains the number of instances of the package that
will be located on the system after the script is run).
Basically that means you need to do
%preun
if [ $1 = 0 ]; then
<your sed here>
fi