Skip to contentSkip to conversation

How do you apply patches to source code?

DISCUSSION Amin 1 participant 1 message May 26, 2003 1 message not in the archive

lore
Share & tools
lore

Amin

author
#1 lore raw
In reply to a message not in the archive
Quoted 13 lines · Ken Moffat
Quoted 3 lines · Robert

I have recently obtained the source code to an application as a .src.rpm file. I have unbundled the code into /usr/src/RPMS/SOURCES. There are a whole lot of .patch.bz2 files in the directory, as well as the main .tar.bz

2

Quoted 7 lines

file.

How do I compile the program with the patches?

I realise this is probably an easy one, but I can't find any documentation about applying patches.

Quoted 6 lines
Quoted 2 lines

Robert.

I believe that every .src.rpm has a file telling rpm how to build it,
maybe called specfile, and there is some option you give to rpm to build this (see `man rpm').

On slightly older systems, this command is

   rpm --rebuild package.src.rpm

On newer systems, it's

   rpmbuild --rebuild package.src.rpm

Try the latter first. Notice that you never have to see the contents of the source rpm file. You only need to run the above commands on it. Everything is automatically taken care of.

Quoted 9 lines

Of course, if you _want_ to build it by hand for some reason, you
first need to unpack the .tar.bz2 (probably with
tar -xvjf filename.tar.bz2), then cd into the directory it creates and run `bzcat ../patchname.patch.bz2 | patch -p1' for each patch, then build it as normal (typically ./configure ; make ; make install) - you'll want to see what options configure will support or need.

But, you probably still need the specfile or whatever to tell you in
what order the packages should be applied.

Logically, the specfile should specify rules for automatically applying patches, or what would be the convenience (to the user) of having the patches?

Quoted 5 lines

Sorry I can't be more help, but `rpm' has broken on the only box I've
got it on.

Ken

HTH,
Yawar Amin
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs