tummy compile Mandrake 7.2

Joal Heagney s713221 at student.gu.edu.au
Tue Jun 12 07:04:34 EDT 2001


myself wrote:

> > It depends on how the tummy-expat spec file was built. Some packagers
> > just throw everything in together, binaries, libraries, documents and
> > header files into a package called <Foo>. Others split up a build into a
> > <Foo>.rpm, <Foo>-docs.rpm, <Foo>-devel.rpm and maybe even a
> > <Foo>-lib.rpm As well as removing the buildprereq: expat-devel, you can
> > also mung it by changing it to expat only (I.E. get rid of the -devel
> > bit.).
> >
> ok, but Sean didn't seem to indicate this was the source of the error,
> but perhaps I misunderstood. I installed expat as per instructions on
> tummy site- I probably don't "need" it at all at this point- first I need
> a *basic* understanding of the language :-). Just out of curiosity,
> doesn't the -devel part install the header files necessary to build the
> actual expat support?

Depends on the package builder's preference. If you look at a spec file,
you'll see a whole load of %package directives, which define additional
packages such as devel. However, if you're in a hurry to fold a tar
source up into an rpm, most people write a basic spec file that installs
binaries, libraries and headers in one go. The reason why the build
fails is because it looks for the rpm expat-devel, which isn't in your
rpm database, even though the files it theoretically would provide are
on your system (from the package expat).

> > If you want a prebuilt rpm for Mandrake 7.2, I could always email you my
> > build, but I understand if you want to build it from source.
> >
> thanks for the offer. But if you don't mind, since you've sucessfully
> built for LM7.2, perhaps you could give me a few pointers on how? I
> really don't care if I use srpm or source- my prob. w/ srpm is detailed
> to best of my ability in this thread, failure w/ source in a later
> thread. Since Sean already pointed out that my prob. w/ srpm seems to be
> a Mandrake thing, unless you have further advice on this, would you mind
> checking out later post (source compile) and perhaps helping there? For
> all I know I don't even really have a problem, maybe this is the way the
> install is supposed to act, but so far no response on that topic.....
> 
> BTW, did you update or do you have 1.5.2 and 2.1 coexisting? I'm trying
> to do latter, being fearful 2.1 will break something if I replace 1.5.2.
> Comments?
> 
> thanks a heap!

Good idea to go for the coexistance thing. I ran rpm -q --whatrequires
python and got the following list back
pygtk-0.6.6-4mdk rpm-devel-3.0.5-27mdk rpm-python-3.0.5-27mdk
icepref-1.1-3mdk python-devel-1.5.2-12mdk rpmlint-0.24-1mdk
tkinter-1.5.2-12mdk python-imaging-1.1-2mdk pythonlib-1.23-2mdk
Theoretically I could do without these, but I'd have to give up some of
my favourite Mandrake features. Either that, or rebuild them for
python2.1

Anycase, here's my hack on the rpm spec file. After a lot of mucking
around, it turns out to be something really insignificant. Look ahead to
step 8.

1.First, install the src.rpm under /usr/src/RPM
rpm -i python2-2.1-4.src.rpm

2. Cd to the spec file location
cd /usr/src/RPM/SPECS

3. Prep and compile the package
rpm -bc python-2.1.spec

Now begins the hacking on the spec file.
4. Make sure you fix that depend to expat, not expat-devel

This next step is optional. I've tried with and without, and it doesn't
have any effect whatsoever. If you use emacs however, restoring the
colours does make it easier to errorcheck
5. Go through the changelog and backslash all occurances of " and (one)
' (E.g. " -> \"). Add a " to the end of the changelog. I'm not to sure
this does anything, but it does restore my emacs colours to what they
should be.


Again this next step is optional. If you're only going to develop with
python 2.1, you're better off leaving it the same, removing your already
installed python-tools and replace it with your new 2.1 based
python-tools.
6. Replace the "idle" on the ends of lines 191, 192 and 193 with
idle%{binsuffix}, so they look like this:
########
#  Tools
echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
echo 'exec %{_prefix}/bin/python%{binsuffix}
/usr/lib/python2.1/Tools/idle/idle.py'
>>${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
cp -a Tools ${RPM_BUILD_ROOT}%{_prefix}/lib/python2.1

Note that the second echo and the >>${PRM_BUILD_ROOT} line are the one
line in the spec file. Netscape is just TOO helpful.

7. In the make files section, do as for step 6 and replace line 208
echo "%{__prefix}"/bin/idle >>tools.files 		with this
echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files

This makes sure your python 2.1 version of idle is installed as idle2.
This prevents conflicts when you try to install your new python2-tools
rpm with an already installed python-tools.


This next step ISN'T optional. I've found (Through a LOT of trial and
error) that THIS this that chokes rpm during the install.
8. On line 217 you'll find the following
%{__prefix}/man/man1/python%{binsuffix}.1.gz
Unfortunatly Mandrake doesn't package man pages as gzips, but as bzip2s.
So change this line to
%{__prefix}/man/man1/python%{binsuffix}.1.*z*
and it work for gzip or bzip2

9. Now we go ahead with our install.

rpm -bi --short-circuit python-2.1.spec

Now you may see lots of error messages that state:

"Finding  Provides: (using /usr/lib/rpm/find-provides)...
Finding  Requires: (using /usr/lib/rpm/find-requires)...
line 246: Dependency tokens must begin with alpha-numeric, '_' or '/':
%defattr(-, root, root)
 
Failed to find Requires:" 

This is the bit that really had me stumped. After a LONG time trying to
remember how I got around the error messages, I rediscovered that get
your RPMS if you just go ahead and build the damn things.

10. rpm -bb --short-circuit python-2.1.spec

If you look under RPMS/i586 you should see four python2 rpms. Feel free
to check them using package query mode, listing all the files in each.
rpm -qpl python2-2.1-4.i586.rpm
rpm -qpl python2-devel-2.1-4.i586.rpm
rpm -qpl python2-tkinter-2.1-4.i586.rpm
rpm -qpl python2-tools-2.1-4.i586.rpm

After all that rubbish and it's just a matter of Mandrake using a
different file compression tool to mainstream. *sheesh*

As you can see, source building is a mixture of applied knowledge (Which
usually comes from incomplete documentation and previous attempts),
trial-and-error and some days, a good voodoo curse and a heavy
dependency on alchohol/coffee/frustration-relief-aid-of-choice. In this
case, a blind willingness to do what seems to be a bad thing helps a
little, "just to see what happens". *evil grin* Have fun. 
-- 
      Joal Heagney is: _____           _____
   /\ _     __   __ _    |     | _  ___  |
  /__\|\  ||   ||__ |\  || |___|/_\|___] |
 /    \ \_||__ ||___| \_|! |   |   \   \ !



More information about the Python-list mailing list