[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rebuild an RPM with changed source



On Mon, Aug 26, 2002 at 02:56:57PM -0500, Erich Schroeder wrote:
>   I've never done this, so I'm asking. I have found that in order to use 
> Ogle with some home-built dvd-r's, I need to recompile libdvdread after 
> commenting out one line in the code. If things work out well, I'm going to 
> want to deploy a total of 6 of these machines, so I was wondering what the 
> steps would be to create a custom rpm so that I can do it more 
> easily.

Here's the "right" way:

    1) Unpack the source rpm with "rpm -i".

    2) cd /usr/src/redhat/SPECS

    3) Let rpm unpack the source and apply patches with "rpm -bp
       specfile" where "specfile" is, in this case, likely to be
       libdvdread.spec.

    4) cd ../BUILD

    5) If you are editing one file, cd into the appropriate build
       directory (probably libdvdread-$version) and make a backup
       copy of the file you need to edit ("cp -a file file.orig").  If
       you are editing multiple files, make a copy of the whole build
       tree ("cp -a dir dir.orig").

    6) Edit the file(s).

    7) Make a patch against the original source.  If you made a copy
       of the whole source tree, you can use "diff -urN dir.orig dir".
       If you just edit one file, do something like "diff -u
       dir/file.orig dir/file".

    8) Save the patch in /usr/src/redhat/SOURCES.

    9) Edit the spec file.  Bump up the release number.  Add a line in
       the spec for the patch ("PatchN: your.patch" where N is a
       unique number), then add a line at the end of the %prep section
       to apply the patch ("%patchN -p1" or "%patchN -p0", depending
       on what directory you made the patch in).

   10) Rebuild the rpm with "rpm -ba specfile".

There's a little hand-waving there, but I hope you get the idea.  :-)

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7360             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.