I downloaded a src rpm, built it using rpmbuild and the spec file and ran it. So far, so good. Now I want to modify the source to add some debugging statements. The problem is that the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Let me know if this needs to be moved to the devel list.
Thanks, Steve.
On Tue, 10 Feb 2009 10:52:14 -0500 Steve zephod@cfl.rr.com wrote:
the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Once you modify a package your warranty is null and void ;-)
Edit the patch and make a note in the spec file.
Steve wrote:
I downloaded a src rpm, built it using rpmbuild and the spec file and ran it. So far, so good. Now I want to modify the source to add some debugging statements. The problem is that the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Let me know if this needs to be moved to the devel list.
Thanks, Steve.
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Mikkel
On Tue, 10 Feb 2009 12:42:54 -0500 James Kosin jkosin@beta.intcomgrp.com wrote:
homburg@tips-Q.com wrote:
What is the Fedora way of dealing with this situation?
Once you modify a package your warranty is null and void ;-)
Actually, there is NO WARRANTY of any sort.
My sarcasm projector is obviously out of warranty ;-)
---- "Mikkel L. Ellertson" mikkel@infinity-ltd.com wrote:
Steve wrote:
I downloaded a src rpm, built it using rpmbuild and the spec file and ran it. So far, so good. Now I want to modify the source to add some debugging statements. The problem is that the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Let me know if this needs to be moved to the devel list.
Thanks, Steve.
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Yukk!! That will get really tiresome really quickly. At this point I don't really know what I'm looking for so I may end up having to add debug statements to several files.
Is there a way to apply all the patches to the source code and them remove them from the spec file?
Steve
Steve wrote:
---- "Mikkel L. Ellertson" mikkel@infinity-ltd.com wrote:
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Yukk!! That will get really tiresome really quickly. At this point I don't really know what I'm looking for so I may end up having to add debug statements to several files.
Is there a way to apply all the patches to the source code and them remove them from the spec file?
Steve
Well, if you are debugging the program, you would probably be better off running "rpmbuild -bp <package>" and then make your changes in the build directory. Then run make manually. You can do this all as a normal user. Depending on what you are building, you may be able to run it as a normal user from the build directory. If not, you are probably going to override the make file so it installs relative to your home directory. Once you have it debugged, you can transfere the changes to the virgin source with a patch, or pass them upstream...
Mikkel
On Tue, 10 Feb 2009 14:00:23 -0500 Steve zephod@cfl.rr.com wrote:
Is there a way to apply all the patches to the source code and them remove them from the spec file?
Have you looked at the patches? At the risk of being an apostate, you might not need them in the first place. "fix_errors_rendering_khmen" might not be necessary unless you live in Cambodia. In that case, you can just comment them out in the spec file.
On Tue, 2009-02-10 at 11:58 -0500, homburg@tips-Q.com wrote:
On Tue, 10 Feb 2009 10:52:14 -0500 Steve zephod@cfl.rr.com wrote:
the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Once you modify a package your warranty is null and void ;-)
Edit the patch and make a note in the spec file.
I was going to suggest "rpmbuild -bp" which unpacks and applies included patches. Then edit the patched file and create a patch of your own. Add it to the spec file after the other patch, so yours is applied after the included one. Then do the full build.
On Tuesday 10 February 2009 09:52:14 am Steve wrote:
I downloaded a src rpm, built it using rpmbuild and the spec file and ran it. So far, so good. Now I want to modify the source to add some debugging statements. The problem is that the src rpm contains a number of patches and one of the patches is to the file I want to modify. Now when I rpmbuild, the patching fails because the source file it is trying to patch doesn't look the same.
What is the Fedora way of dealing with this situation?
Let me know if this needs to be moved to the devel list.
do a rpmbuild -bp <specfile> then you can can go into the prepared source and make you patch toapply in the spec. I almost have a new fedora-packager update ready which will allow anonmous checkouts of fedora packages from cvs you can grab the script from https://fedorahosted.org/fedora- packager/browser/src/fedora-cvs.py it requires you have PyOpenSSL and cvs installed
Dennis
Steve wrote:
---- "Mikkel L. Ellertson" mikkel@infinity-ltd.com wrote:
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Yukk!! That will get really tiresome really quickly. At this point I don't really know what I'm looking for so I may end up having to add debug statements to several files.
Is there a way to apply all the patches to the source code and them remove them from the spec file?
Steve
I don't know if this is possible, but if it is it's a lot easier to just change the compile to be a debugging version and run gdb on the result. There should be a switch, but if there isn't just change the CFLAGS to use -ggdb -Wall -O0.
Of course, it depends on what you're debugging as to whether this is feasible.
HTH
On Tue, 10 Feb 2009 14:00:23 -0500, Steve wrote:
---- "Mikkel L. Ellertson" wrote:
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Yukk!! That will get really tiresome really quickly. At this point I don't really know what I'm looking for so I may end up having to add debug statements to several files.
Yes, that's in the nature of incremental patches. You would usually try to get patches merged upstream regularly. And if upstream doesn't do that for a long time, you may need to rediff patches occasionally. Or join them with a private working-copy of the source code tree in order to reduce the number of patches to apply in a src.rpm. With a high number of patches and many modifications in the same files, maintaining a private patched source code tree may be the more convenient solution.
Is there a way to apply all the patches to the source code and them remove them from the spec file?
"rpmbuild -bp foo.spec" and then tar the build dir. That's not what's done in Fedora, though.
---- "Mikkel L. Ellertson" mikkel@infinity-ltd.com wrote:
Steve wrote:
---- "Mikkel L. Ellertson" mikkel@infinity-ltd.com wrote:
One way is to create your own patch that is used after the original patch. Add it to the end of the patch list.
Yukk!! That will get really tiresome really quickly. At this point I don't really know what I'm looking for so I may end up having to add debug statements to several files.
Is there a way to apply all the patches to the source code and them remove them from the spec file?
Steve
Well, if you are debugging the program, you would probably be better off running "rpmbuild -bp <package>" and then make your changes in the build directory. Then run make manually. You can do this all as a normal user. Depending on what you are building, you may be able to run it as a normal user from the build directory. If not, you are probably going to override the make file so it installs relative to your home directory. Once you have it debugged, you can transfere the changes to the virgin source with a patch, or pass them upstream...
rpmbuild -bp <spec file> did the trick.
After running that I went into the BUILD directory and made my modifications. Next I ran ./configure with all the options from the spec file and finally ran
$ make CFLAGS='-fPIC -D_GNU_SOURCE"
I also got the CFLAG options from the spec file. The last thing I had to do was set the correct SELinux context for the executable and point the boot script at my executable instead of the system one.
Now I can start.
Thanks for the help. Steve.