[Zope-dev] python 2.1.3 on RedHat 8.0

Adam Manock abmanock@earthlink.net
10 Dec 2002 11:34:34 -0500


--=-NwDJFRiD98Y5ANd4pz0W
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I am working on spec/RPM for Zope 2.6.x, but obviously a working
python2.1.3 install is a pre-req if I want to support RH8.0 with the
Zope RPMS :-)

Attached are the changes made to the spec so that the python 2.1.3 SRPM
from python.org would --rebuild nicely on RedHat 8.0

Changes:
Made tools optional
Used "%{__prefix}/lib/python2.1/Tools" instead of tools.files for
"tools" sub-package.
Removed BuildPrereq for db1-devel. No longer included in RH8
(see: http://www.redhat.com/software/linux/technical/packages.html)

I don't have a RH7.x box to test on anymore..  (should have kept one of
my dev boxes at 7.x.......) could someone please test the below on
RedHat 7.2 and/or 7.3?

-------------------------------------------------
To build the source RPM as a NON ROOT user

Create necessary directories in your home directory:

mkdir $HOME/rpm
mkdir $HOME/rpm/SOURCES
mkdir $HOME/rpm/SPECS
mkdir $HOME/rpm/BUILD
mkdir $HOME/rpm/SRPMS
mkdir $HOME/rpm/RPMS
mkdir $HOME/rpm/RPMS/i386

Tell RPM to use your private rpm/ tree:
echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros

Install the source RPM:
rpm -Uvh python2.1-2.1.3-1.src.rpm

Patch the spec file
cd $HOME/rpm/SPECS
patch -p0 </path_to_attached/python2.1.spec.10-22.patch

Build:
rpmbuild -ba --without tkinter python-2.1.spec

Install:
su -l
rpm -Uvh ~yourusername/rpm/RPMS/i386/python2.1*.rpm
exit

Test:
python2.1 /usr/lib/python2.1/test/regrtest.py

I got:
128 tests OK.
13 tests skipped:
-------------------------------------------------

Adam

--=-NwDJFRiD98Y5ANd4pz0W
Content-Disposition: attachment; filename=python2.1.spec.10-22.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=python2.1.spec.10-22.patch; charset=UTF-8

--- python-2.1.spec	2002-04-10 00:24:47.000000000 -0400
+++ python-2.1.spec.10-22	2002-10-22 16:24:36.000000000 -0400
@@ -31,6 +31,9 @@
 %define config_tkinter 1
 %{?_without_tkinter: %{expand: %%define config_tkinter 0}}
=20
+%define config_tools 1
+%{?_without_tools: %{expand: %%define config_tools 0}}
+
 %define config_pymalloc --without-pymalloc
 %{?_with_pymalloc: %{expand: %%define config_pymalloc --with-pymalloc}}
=20
@@ -49,7 +52,7 @@
 Patch2: Python-2.1-expat.patch
 BuildRoot: /var/tmp/%{name}-%{version}-root
 BuildPrereq: expat-devel >=3D 1.1-3tummy
-BuildPrereq: db1-devel
+#BuildPrereq: db1-devel
 BuildPrereq: gdbm-devel
 Prefix: %{__prefix}
 Packager: Sean Reifschneider <jafo-rpms@tummy.com>
@@ -324,5 +327,8 @@
 %{__prefix}/lib/python2.1/lib-dynload/_tkinter.so*
 %endif
=20
-%files -f tools.files tools
+%if %{config_tools}
+%files tools
 %defattr(-,root,root)
+%{__prefix}/lib/python2.1/Tools
+%endif

--=-NwDJFRiD98Y5ANd4pz0W--