LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to add a file to an existing rpm package (https://www.linuxquestions.org/questions/linux-software-2/how-to-add-a-file-to-an-existing-rpm-package-195091/)

SharpyWarpy 06-18-2004 04:07 PM

How to add a file to an existing rpm package
 
Is there any way to add a file to an existing rpm package? I have all these rpm
packages I've downloaded and I'd like to put a text file in some of them with additional notes. I found a script called rpmerizor that will build from an installed package but it doesn't have any options for adding a file later.

bigrigdriver 06-18-2004 04:40 PM

The easiest way would be to get the .src.rpm for the app to which you want to add the file. When you install a .src.rpm, you don't get a working app; you get the source files (possibly with patches) and a spec file to direct rpm in creating an installable binary. The source file is the object of interest here. It's a plain old, ordinary tarball which you can unzip; untar; add the file; tar; and gzip back to the tarball stage.
Then, use the installed .src.rpm to make a new binary rpm with the text file included.
For a thourough read on the ins and outs of rpm, check out the Red Hat documentation. Look for a book called Max-Rpm (you can read it on-line, or download it to study at you leisure). There are sections which give better explainations and good examples of how to do it.

SharpyWarpy 06-19-2004 06:12 AM

Okay, the best way I've found so far is using rpmerizor. Write the text file named, say, yada.txt with the additional notes then run
rpmerizor `rpm -ql packagename` yada.txt
This makes an rpm package with the installed files and includes the text file. Might want to do "rpm -qa | grep packagename" to get version and release first for use with rpmerizor naming file. Also, do "rpm -qi packagename" on another terminal and copy-paste summary, description from there -- makes it a lot faster.

SharpyWarpy 06-20-2004 05:59 AM

Update: I found a better program than rpmerizor, rpmrebuild. Options are better, it allows you to edit the spec file right in the middle of the rpm creation so you can include your text file, automatically opens the spec file with your default editor.


All times are GMT -5. The time now is 10:52 PM.