[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] POPT (was Pilot link)



On Wed, 5 Mar 2008 18:13:11 , Edgar Aichinger <edgar.aichinger@aon.at> wrote:

I relocated the spec file tokeep things tidy (I like tidy ;-)

> > I can't see a reference to the patch file in the 1.3 spec file.

Doh, I msut have been looking at the 1.13 spec file
 
> The header has:
> Patch0: popt-1.3-mintcnf.patch
>
> Then, in %prep this gets applied:
> %patch0 -p1 -b .mint
>
> The trailing number (0 here) is used to distinguish patches if you use more
> than one. If you use just one patch it could as well say Patch: in the head
> er, and later %patch.

Why do these patches not get added to the main sources ?
 
> > > > I copied the 1.13 sources to \usr\src\redhat\SOURCES\popt-1.13\
> > > > and tried the spec file from 1.13.  It requires the source to
> > > > be in a tar.gz so I compressed it.
> > >
> > > The right way is to modify the spec file, not to recompress the source
> > > archive. rpm can perfectly handle bzip2 too.
> >
> > I thought it was unusual too. The SRPM has a tar.gz and that it what
> > both versions of the spec files expect to find, I think. Without
> > the file I just get:
> >
> > bash-2.05a# rpm -ba popt.spec
> > File /usr/src/redhat/SOURCES/popt-1.13.tar.gz: No such file or directory
>
> Simply change
>
> Source: ftp://ftp.redhat.com/pub/redhat/code/popt/popt-%{version}.tar.gz
> to
> Source: ftp://ftp.redhat.com/pub/redhat/code/popt/popt-%{version}.tar.bz2
>
> You can as well omit the URL part and just use the plain filename
> (using the version macro is a good idea though)
 
It is still looking for a compressed file though. Frank assumed it would
only need the source and not a compressed file.
 
> > > > At the moment the source is just patched in the way that Alan
> > > > hinted. Is there a more formal way of patching the code ?
>
> The patch should be generated by "diff -u" IIRC, and should contain all
> the patches related to one issue. That's where gendiff comes in so handy,
> just append a "meaningful" extension (e.g. .wchar) to the unpatched source
> file copies,
> use "gendiff popt-1.13 .wchar > ../SOURCES/popt-wchar.patch". Then add a li
> ne
>
> Patch1: popt-wchar.patch
>
> and later in %prep
>
> %patch1 -p1 -b .wchar
>
> > > Sure. Create a patch file like the popt-1.3-mintcnf.patch, copy it to
> > > the SOURCES folder and add it to the spec file so rpm automatically apply
> > > it while building the package. And never modify the original source archive
> > > that is used by rpm.
> >
> > Was the 1.3 patch file generated by something like diff ?
>
> No, looks like "diff -uR" output.
> >
> > Is it necessary to include the old patch (or parts of it) into the new
> > patch ?
>
> See above, keep your patches organized by adressing a single problem per pa
> tch :)
>
> Finally, here's an exhaustive source of general RPM information:
> http://www.rpm.org/max-rpm/
>
> > Regards,
> >
> > Peter
> >
>
> Edgar

Many thanks Edgar, I'm learning a lot.

Regards,

Peter