On Sat, 2007-05-19 at 13:18 +0200, Dick Hoogendijk wrote:
> The problem for me is that I absolutely have no idea how to make patch
> files.

This is how I create patches, others may have different strategies:
Whenever I need to change a source file, I first make a copy with
a specific suffix.  Files with the same suffix will be in the same
patch.  Then change the file, compile, test, etc.  When done, I use
the gendiff script (comes with the JDS CBE) to generate the patches.
Example:

~/packages/BUILD/somesrc-1.2> cp main.c main.c.bugfix
~/packages/BUILD/somesrc-1.2> vi main.c
~/packages/BUILD/somesrc-1.2> make
(...)
~/packages/BUILD/somesrc-1.2> cd ..
~/packages/BUILD> gendiff somesrc-1.2 .bugfix > somesrc-01-bugfix.diff

You will need to copy the patch in the patches subdir of your
spec file repository.

Note: you can work on multiple patches at the same time if you use
different suffices.

Then you can add somesrc-01-bugfix.diff to the spec file:

In the preamble, right after the Source lines, add:

Patch1:      somesrc-01-bugfix.diff

and in %prep, after the %setup line add:

%patch1 -p1

and finally, update %changelog at the end of the spec file.

Here's an overview of the various elements of a spec file:
http://www.rpm.org/max-rpm-snapshot/s1-rpm-build-creating-spec-file.html
Hope this helps.

Laca


Reply via email to