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

Re: [MiNT] POPT (was Pilot link)



Am Dienstag, 4. März 2008 schrieb Peter Slegg:
> On Tue, 4 Mar 2008 09:07:51 , Frank Naumann <fnaumann@boerde.de> wrote:
> > Hello!
> >
> > > The 1.3 srpm includes a file popt-1.3-mintcnf.patch  I am not sure
> > > what to do with this, if anything is required.
> >
> > It belong to the SOURCES directory too. rpm use this to build the package
> > (it's mentioned inside the spec file).
> 
> Hello Frank,
> 
> I can't see a reference to the patch file in the 1.3 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 header, 
and later %patch.

> 
> > > 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)

> 
> > > with the file locations in the tmp file it creates. So far
> > > no success. Below is the tmp file:
> >
> > That't don't help much. What's the exact error message rpm produce?
> 
> It tries to cd to pop-1.13 but fails because it can't find it:
> 
> bash-2.05a# cd /usr/src/redhat/SOURCES/popt-1.13
> bash-2.05a# rpm -ba popt.spec
> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.37439
> + umask 022
> + cd /usr/src/redhat/BUILD
> + cd /usr/src/redhat/BUILD
> + rm -rf popt-1.13
> + /bin/gzip -dc /usr/src/redhat/SOURCES/popt-1.13.tar.gz
> + tar -xf -
> + STATUS=0
> + '[' 0 -ne 0 ']'
> + cd popt-1.13
> /var/tmp/rpm-tmp.37439: cd: popt-1.13: No such file or directory
> Bad exit status from /var/tmp/rpm-tmp.37439 (%prep)
> 
> or if I cd ..
> 
> bash-2.05a# pwd
> /usr/src/redhat/SOURCES
> bash-2.05a# rpm -ba popt.spec
> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.48385
> + umask 022
> + cd /usr/src/redhat/BUILD
> + cd /usr/src/redhat/BUILD
> + rm -rf popt-1.13
> + /bin/gzip -dc /usr/src/redhat/SOURCES/popt-1.13.tar.gz
> + tar -xf -
> + STATUS=0
> + '[' 0 -ne 0 ']'
> + cd popt-1.13
> /var/tmp/rpm-tmp.48385: cd: popt-1.13: No such file or directory
> Bad exit status from /var/tmp/rpm-tmp.48385 (%prep)
> 
> > > 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 line 

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 patch :)

Finally, here's an exhaustive source of general RPM information:
http://www.rpm.org/max-rpm/

> Regards,
> 
> Peter
> 

Edgar