[Distutils] creating rpms of setuptools, sqlobject and formencode

Pau Aliagas pau at smsarena.com
Fri Oct 21 20:22:40 CEST 2005


I'm trying to create rpms for sqlobject, as I've been doing for a while, 
but since it works with setuptools, I'm unable to do it properly.

sqlobject requires formencode and also requires setuptools. If I build he 
rpm with the attached specs, it downloads both of them and packs them in 
the same rpm.

This is part of the output:

+ /usr/bin/python setup.py build
---------------------------------------------------------------------------
This script requires setuptools version 0.6a5 to run (even to display
help).  I will attempt to download it for you (from
http://cheeseshop.python.org/packages/2.3/s/setuptools/), but
you may need to enable firewall access for this script first.
I will start the download in 15 seconds.
---------------------------------------------------------------------------
Downloading 
http://cheeseshop.python.org/packages/2.3/s/setuptools/setuptools-0.6a5-py2.3.egg

But it is installed in:
/usr/lib/python2.3/site-packages/setuptools-0.6a6-py2.3.egg

What do I want? I want to create an rpm of setuptools, install it and 
then, I'd expect setuptools to find it. I've tried it, I've built the 
setupttols rpm, installed it (it goes in the site-packages dir), but still 
setup.py does not find it :( and adds it to the rpm. The same happens with 
formencode.

My question is: how can I create an rpm of setuptools that sqlobject can 
find when setup.py build is executed?

What am I doing wrong?

Thanks for your help.

-- 
____________________________________
Pau Aliagas
(((smsARENA
smsarena.com
Tel. 902010292
____________________________________
-------------- next part --------------
# TemplateVer:  0.4

%{?!python:%define python python}
%{?!pybasever:%{expand:%%define pybasever %(%{__python} -c "import sys ; print sys.version[:3]")}}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define origname FormEncode

Name:		%{python}-formencode 
Version:	0.2.2
Release:	1026.1
Summary:	HTML form validation, generation, and convertion package

Group:		Development/Libraries
License:	Python Software Foundation License
URL:		http://formencode.org/
Source0:	%{origname}-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:	noarch
BuildRequires:	%{python}-devel
Requires:	python-abi = %{pybasever}

%description
FormEncode performs look-before-you-leap validation. The idea being that you check all the data related to an operation, then apply it.

%prep
%setup -n %{origname}-%{version} -q

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --record=INSTALLED_FILES.tmp

# Ghost optimized 
sed 's/\(.*\.pyo\)/%ghost \1/' < INSTALLED_FILES.tmp > INSTALLED_FILES
find $RPM_BUILD_ROOT%{python_sitearch} -type d \
| sed "s|^$RPM_BUILD_ROOT|%dir |" >> INSTALLED_FILES

%clean
rm -rf $RPM_BUILD_ROOT

%files -f INSTALLED_FILES
%defattr(-,root,root,-)
%doc docs/*

%changelog
* Sat Oct  1 2005 Pau Aliagas <pau at newtral.org> 0.2.3-1026.1
- updated version from svn trunk

* Tue Sep 13 2005 Pau Aliagas <pau at newtral.org> 0.2.2-2088.1
- updated version from svn trunk

* Mon Aug 29 2005 Pau Aliagas <pau at newtral.org> 1.0-763
- first version from svn trunk
-------------- next part --------------
# TemplateVer:  0.4

%{?!python:%define python python}
%{?!pybasever:%{expand:%%define pybasever %(%{__python} -c "import sys ; print sys.version[:3]")}}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define origname SQLObject

Name:		%{python}-sqlobject 
Version:	0.7.0
Release:	1.pau
Summary:	SQLObject is an object-relational mapper.

Group:		Development/Libraries
License:	LGPL
URL:		http://sqlobject.org 
Source0:	%{origname}-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:	noarch
BuildRequires:	%{python}-devel
Requires:	python-abi = %{pybasever}

%description
SQLObject is an *object-relational mapper*. It allows you to
translate RDBMS table rows into Python objects, and manipulate those
objects to transparently manipulate the database.

In using SQLObject, you will create a class definition that will
describe how the object translates to the database table. SQLObject
will produce the code to access the database, and update the database
with your changes. The generated interface looks similar to any other
interface, and callers need not be aware of the database backend.

%prep
%setup -n %{origname}-%{version} -q

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --record=INSTALLED_FILES.tmp

# Ghost optimized 
sed 's/\(.*\.pyo\)/%ghost \1/' < INSTALLED_FILES.tmp > INSTALLED_FILES
find $RPM_BUILD_ROOT%{python_sitearch} -type d \
| sed "s|^$RPM_BUILD_ROOT|%dir |" >> INSTALLED_FILES

%clean
rm -rf $RPM_BUILD_ROOT

%files -f INSTALLED_FILES
%defattr(-,root,root,-)
%doc README.txt docs/*

%changelog
* Thu Oct 20 2005 Pau Aliagas <pau at newtral.org> 0.7.0-1.pau
- latest CVS
- require FormEncode

* Sat Oct  1 2005 Pau Aliagas <pau at newtral.org> 0.7b1-2.pau
- latest CVS
- require FormEncode

* Mon Aug 29 2005 Pau Aliagas <pau at newtral.org> 0.6.1-94.pau
- latest CVS
- require FormEncode

* Mon Jul  4 2005 Pau Aliagas <pau at newtral.org> 0.6.1-93.pau
- latest CVS

* Wed Jun  1 2005 Pau Aliagas <pau at newtral.org> 0.6.1-92.pau
- latest CVS with SingleJoin
- update spec file

* Wed May 25 2005 Pau Aliagas <pau at newtral.org> 0.6.1-91.pau
- modify installed files to fix x86_64 version

* Tue May 24 2005 Pau Aliagas <pau at newtral.org> 0.6.1-91
- svn version
- try to update to MySQL-python-1.2.0 to access mysql-4.1

* Wed Apr 24 2005 Pau Aliagas <pau at newtral.org> 0.6.1-90
- svn version

* Wed Apr 20 2005 Pau Aliagas <pau at newtral.org> 0.6.1-1
- new version

* Wed Sep 22 2004 Jeff Pitman <symbiont+pyvault at berlios.de> 0.6-1
- new version

* Tue Sep 07 2004 Jeff Pitman <symbiont+pyvault at berlios.de> 0.5.2-1
- new version

-------------- next part --------------
# TemplateVer:  0.4

%{?!python:%define python python}
%{?!pybasever:%{expand:%%define pybasever %(%{__python} -c "import sys ; print sys.version[:3]")}}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define origname setuptools

Name:		%{python}-setuptools 
Version:	0.6a5
Release:	1
Summary:	HTML form validation, generation, and convertion package

Group:		Development/Libraries
License:	Python Software Foundation License
URL:		http://setuptools.org/
Source0:	%{origname}-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:	noarch
BuildRequires:	%{python}-devel
Requires:	python-abi = %{pybasever}

%description
FormEncode performs look-before-you-leap validation. The idea being that you check all the data related to an operation, then apply it.

%prep
%setup -n %{origname}-%{version} -q

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --record=INSTALLED_FILES.tmp

# Ghost optimized 
sed 's/\(.*\.pyo\)/%ghost \1/' < INSTALLED_FILES.tmp > INSTALLED_FILES
find $RPM_BUILD_ROOT%{python_sitearch} -type d \
| sed "s|^$RPM_BUILD_ROOT|%dir |" >> INSTALLED_FILES

%clean
rm -rf $RPM_BUILD_ROOT

%files -f INSTALLED_FILES
%defattr(-,root,root,-)
%doc *.txt

%changelog
* Sat Oct  1 2005 Pau Aliagas <pau at newtral.org> 0.2.3-1026.1
- updated version from svn trunk

* Tue Sep 13 2005 Pau Aliagas <pau at newtral.org> 0.2.2-2088.1
- updated version from svn trunk

* Mon Aug 29 2005 Pau Aliagas <pau at newtral.org> 1.0-763
- first version from svn trunk


More information about the Distutils-SIG mailing list