Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I executed the following on xyz-3.0.rpm: $ rpm -qi --scripts ~/xyz-3.0.rpm > list

Now here's what list showed: $ cat list

postinstall scriptlet (/bin/sh): 
rm /opt/xyz/config/appkey.cfg
/opt/xyz/bin/setup

Now I see that the setup script was not added properly, and options are missing. It should have been called with a -i argument.

To fix this, my hunch was to go and search the .spec file which generates this rpm but within the spec file I did not see any setup script being called.

I believe I am looking into the right spec file but I don't see the setup script being called.

Is there a way I can extract the spec file from xyz-3.0.rpm? Or maybe modify the specfile to have setup run with -i argument?

share|improve this question
    
Is there an error that you're seeing? How do you know the postinstall script is missing? –  Andrew M. Jan 30 '12 at 21:12
add comment

1 Answer 1

The command you ran to list the scripts within the xyz RPM was missing the -p or --package option that is needed to query an uninstalled package. The command should have been

rpm -qp --scripts ~/xyz-3.0.rpm > list

Answering your question, it would be possible to extract and modify the spec file from the xyz-3.0.rpm if and only if that rpm contains the spec file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.