I have an rpm for which I need to change the preinstal scriptlet for testing.

However, I do not have the SRPM from which is was built.

Is it possible to change the scriptlet and/or rebuild the rpm without having the SRPM?

If so, how?

I've tried using Midnight Commander (mc) to open the rpm as a directory structure and edit the contents, but even with 666 permissions, it won't let me save any changes.

link|improve this question

444 permissions are just "everybody can read"; no write permissions there. you need 7 for read-write-execute -- 700 for you, 777 for everybody. – quack quixote Apr 21 '10 at 13:17
@quack quixote - I meant '666', fixing now – warren Apr 21 '10 at 13:40
yeah, 444 does look a lot ... less evil, doesn't it? :) – quack quixote Apr 21 '10 at 13:46
@quack quixote - it does indeed :) – warren Apr 21 '10 at 14:16
feedback

1 Answer

up vote 0 down vote accepted

What is needed is rpmrebuild, which I found via the Red Hat Magazine article.

If you have an rpm for which you only wish to modify the spec file, do the following:

  1. copy the rpm in question to a working directory
  2. run rpmrebuild -e -p <pkg>rpm   (this will open your default editor (typically vi|vim if you haven't made any changes on your rpm-based distro), allowing you to make changes to the spec file)
  3. find the line(s) you wish to change
  4. make changes
  5. save and exit your editor   (Esc:wq! in vi[m], Ctrl-x s in emacs)
  6. rpmrebuild will ask if you want to continue
  7. answer 'yes'
  8. the rebuilt package will show up in /usr/src/redhat/RPMS/<arch>/<pkg>.rpm
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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