Adding patches in a SPEC

Andy Shevchenko andy.shevchenko at gmail.com
Tue Nov 16 15:48:10 UTC 2010


You need to do patch on top of source tree container

mycoolpkg-5.3/
    /Makefile
    /source.c
...
mycoolpkg-5.3.new/
   /Makefile
   /source.c
...

run  diff -ruN -p mycoolpkg-5.3 mycoolpkg-5.3.new

Another way:
mycoolpkg-5.3/
   /Makefile
   /Makefile.orig
...

gendiff mycoolpkg-5.3 .orig > mycoolpkg-fix.patch



On Tue, Nov 16, 2010 at 5:43 PM, Eric "Sparks" Christensen
<sparks at fedoraproject.org> wrote:
> I've never had to add a patch to a SPEC file before and I can't seem
> to make it work.
>
> The patch is to make a modification to the Makefile.  I created the
> patch (diff -u) and put that in my SOURCES directory.  I included the
> Patch0: line and then called the patch in %prep using %patch0 (no
> switches).  When I run rpmbuild I get the following:
>
> [user at system rpmbuild]$ rpmbuild -ba SPECS/gpredict.spec
> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ILyyD6
> + umask 022
> + cd /home/user/rpmbuild/BUILD
> + LANG=C
> + export LANG
> + unset DISPLAY
> + cd /home/user/rpmbuild/BUILD
> + rm -rf gpredict-1.2
> + /usr/bin/gzip -dc /home/user/rpmbuild/SOURCES/gpredict-1.2.tar.gz
> + /bin/tar -xf -
> + STATUS=0
> + '[' 0 -ne 0 ']'
> + cd gpredict-1.2
> + /bin/chmod -Rf a+rX,u+w,g-w,o-w .
> + echo 'Patch #0 (gpredict-1.2-DSO.patch):'
> Patch #0 (gpredict-1.2-DSO.patch):
> + /bin/cat /home/user/rpmbuild/SOURCES/gpredict-1.2-DSO.patch
> + /usr/bin/patch -s -p0 --fuzz=0
> The text leading up to this was:
> --------------------------
> |--- Makefile   2010-11-15 20:07:20.676418835 -0500
> |+++ Makefile   2010-11-15 21:35:53.803407014 -0500
> --------------------------
> File to patch:
>
>
> It appears to not find Makefile.  Most likely I'm just failing to do
> something correctly here.  Can someone point me in the proper
> direction?
>
> Thanks,
> Eric
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
>



-- 
With Best Regards,
Andy Shevchenko


More information about the devel mailing list