On Fri, Dec 27, 2002 at 02:12:11PM -0000, Yogesh Hasabnis wrote:
> Thanks! But again how to modify the source code in that src.rpm 

Here is what I do:

Suppose I want to patch foo-1.0-1.i386.rpm. I pick the foo-1.0-1.src.rpm
from the source CD, and then:

1. rpm -i foo-1.0-1.src.rpm
2. rpm -bp /usr/src/redhat/SPECS/foo.spec
3. cd /usr/src/redhat/BUILD
4. cp -a foo-1.0 foo-1.0.patched
5. cd foo-1.0.patched
6. Edit to my heart's content inside the .patched directory.
7. cd /usr/src/redhat/BUILD
8. diff -Naur foo-1.0 foo-1.0.patched > /usr/src/redhat/SOURCES/foo-mypatch.patch
9. cd /usr/src/redhat/SPECS
10. Edit foo.spec to add Patchn: foo-mypatch.patch line. n is one greater
    than the number of existing patches.
11. Add a corresponding %patchn -p1 line (-p1 is important ;)
12. Increase the Release: number by 1.
13. rpm -ba /usr/src/redhat/SPECS/foo.spec
14. I get a brand new foo-1.0-2.i386.rpm in /usr/src/redhat/RPMS/i386
    directory. Install it :)
15. Store the corresponding .src.rpm to cater to a later OS upgrade. I haven't
    figured how to avoid the installer overwriting my packages (there is a way
    to do that too).

In case of RHL 8.0+, use rpmbuild instead of rpm in the above. If you already have
the patch file, replace steps 3-8 with one step in which you copy your patch to
/usr/src/redhat/SOURCES.

HTH,

Binand

-- 
Russian Roulette with Unix:
while :; do kill $RANDOM &> /dev/null && break || sleep 1; done


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to