Wednesday, August 22, 2012

patch diff rpm

http://bradthemad.org/tech/notes/patching_rpms.php

Summary:


% diff -uNr package-1.0/ package-1.0p/ > ../SOURCES/package-1.0-my.patch



  • Adding the patch to the package


Next, add the patch to the specfile, so it will be applied when building the package. There may be other patches already, and they are applied in order of their number in the specfile, so number yours appropriately. Add to %_topdir/SPECS/package.spec, in the top section where the name, version, and source lines are:

Patch0: package-1.0-my.patch

Farther down, there will be a section that deals with preparing for the build. Add a patch command that corresponds with the patch line above, typically right after %setup:

%prep
%setup ...
%patch0 -p1



1 comment:

  1. before you execute create the package-1.0p directory you need to, from %_topdir, cd BUILD . then you do cp -r package-1.0 package-1.0p . then you make changes to files in package-1.0p and then you run the diff -uNr

    ReplyDelete