see Packaging software with RPM

diff -uNr the_package/the_file \
the_package/the_file.new > the_file.patch

copy the patch file to /usr/src/redhat/SOURCES

The spec file has those lines:

After Sources:
Patch0: the_file.patch

After %setup, before %build

%patch -p1

To get your new version from the original file:
patch slapd.conf.template \
../../slapd.conf.template.patch \
-o slapd.conf.template.new

Use patched files in RPMs
Tagged on: