|
|
|
|
|
##
|
|
|
|
|
|
## python-db.spec -- OpenPKG RPM Package Specification
|
|
|
|
|
|
## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
|
|
|
##
|
|
|
|
|
|
## Permission to use, copy, modify, and distribute this software for
|
|
|
|
|
|
## any purpose with or without fee is hereby granted, provided that
|
|
|
|
|
|
## the above copyright notice and this permission notice appear in all
|
|
|
|
|
|
## copies.
|
|
|
|
|
|
##
|
|
|
|
|
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
|
|
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
|
|
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
|
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
|
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
|
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
|
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
|
## SUCH DAMAGE.
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
# FIXME: rse: Oracle module was blindly packaged
|
|
|
|
|
|
|
|
|
|
|
|
# package version
|
|
|
|
|
|
%define V_python 2.7
|
|
|
|
|
|
%define V_pysqlite 2.6.0
|
|
|
|
|
|
%define V_psycopg2 2.2.2
|
|
|
|
|
|
%define V_mysql_python 1.2.3c1
|
|
|
|
|
|
%define V_cx_oracle 5.0.4
|
|
|
|
|
|
%define V_sqlobject 0.13.0
|
|
|
|
|
|
|
|
|
|
|
|
# package information
|
|
|
|
|
|
Name: python-db
|
|
|
|
|
|
Summary: Python DB-API 2.0 Modules
|
|
|
|
|
|
URL: http://www.python.org/
|
|
|
|
|
|
Vendor: Python Community
|
|
|
|
|
|
Packager: OpenPKG Foundation e.V.
|
|
|
|
|
|
Distribution: OpenPKG Community
|
|
|
|
|
|
Class: EVAL
|
|
|
|
|
|
Group: Language
|
|
|
|
|
|
License: GPL
|
|
|
|
|
|
Version: %{V_python}
|
|
|
|
|
|
Release: 20100812
|
|
|
|
|
|
|
|
|
|
|
|
# package options
|
|
|
|
|
|
%option with_sqlite yes
|
|
|
|
|
|
%option with_pgsql no
|
|
|
|
|
|
%option with_mysql no
|
|
|
|
|
|
%option with_oracle no
|
|
|
|
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
|
|
Source0: http://pysqlite.googlecode.com/files/pysqlite-%{V_pysqlite}.tar.gz
|
|
|
|
|
|
Source1: http://initd.org/pub/software/psycopg/psycopg2-%{V_psycopg2}.tar.gz
|
|
|
|
|
|
Source2: http://switch.dl.sourceforge.net/mysql-python/MySQL-python-%{V_mysql_python}.tar.gz
|
|
|
|
|
|
Source3: http://switch.dl.sourceforge.net/cx-oracle/cx_Oracle-%{V_cx_oracle}.tar.gz
|
|
|
|
|
|
Source4: http://pypi.python.org/packages/source/S/SQLObject/SQLObject-%{V_sqlobject}.tar.gz
|
|
|
|
|
|
Patch0: python-db.patch
|
|
|
|
|
|
|
|
|
|
|
|
# build information
|
|
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20100101, python >= %{V_python}
|
|
|
|
|
|
PreReq: OpenPKG, openpkg >= 20100101, python >= %{V_python}
|
|
|
|
|
|
BuildPreReq: python-setup
|
|
|
|
|
|
%if "%{with_sqlite}" == "yes"
|
|
|
|
|
|
BuildPreReq: sqlite
|
|
|
|
|
|
PreReq: sqlite
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_pgsql}" == "yes"
|
|
|
|
|
|
BuildPreReq: postgresql
|
|
|
|
|
|
PreReq: postgresql
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_mysql}" == "yes"
|
|
|
|
|
|
BuildPreReq: mysql
|
|
|
|
|
|
PreReq: mysql
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_oracle}" == "yes"
|
|
|
|
|
|
BuildPreReq: oracle
|
|
|
|
|
|
PreReq: oracle
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
This packages provides Python DB-API 2.0 compliant bindings to
|
|
|
|
|
|
various RDBMS. It currently supports SQLite, PostgreSQL, MySQL and
|
|
|
|
|
|
Oracle.
|
|
|
|
|
|
|
|
|
|
|
|
%track
|
|
|
|
|
|
prog python-db:pysqlite = {
|
|
|
|
|
|
version = %{V_pysqlite}
|
|
|
|
|
|
url = http://code.google.com/p/pysqlite/downloads/list
|
|
|
|
|
|
regex = pysqlite-(\d+\.\d+\.\d+)\.tar\.gz
|
|
|
|
|
|
}
|
|
|
|
|
|
prog python-db:psycopg2 = {
|
|
|
|
|
|
version = %{V_psycopg2}
|
|
|
|
|
|
url = http://initd.org/pub/software/psycopg/
|
|
|
|
|
|
regex = psycopg2-(__VER__)\.tar\.gz
|
|
|
|
|
|
}
|
|
|
|
|
|
prog python-db:mysql-python = {
|
|
|
|
|
|
version = %{V_mysql_python}
|
|
|
|
|
|
url = http://sourceforge.net/projects/mysql-python/files/
|
|
|
|
|
|
regex = MySQL-python-(__VER__)\.tar\.gz
|
|
|
|
|
|
}
|
|
|
|
|
|
prog python-db:cx_oracle = {
|
|
|
|
|
|
version = %{V_cx_oracle}
|
|
|
|
|
|
url = http://sourceforge.net/projects/cx-oracle/files/
|
|
|
|
|
|
regex = cx_Oracle-(__VER__)\.tar\.gz
|
|
|
|
|
|
}
|
|
|
|
|
|
prog python-db:sqlobject = {
|
|
|
|
|
|
version = %{V_sqlobject}
|
|
|
|
|
|
url = http://pypi.python.org/pypi/SQLObject
|
|
|
|
|
|
regex = pypi/SQLObject/(__VER__)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
%setup -q -c
|
|
|
|
|
|
%setup -q -T -D -a 1
|
|
|
|
|
|
%setup -q -T -D -a 2
|
|
|
|
|
|
%setup -q -T -D -a 3
|
|
|
|
|
|
%setup -q -T -D -a 4
|
|
|
|
|
|
%patch -p0
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
%if "%{with_sqlite}" == "yes"
|
|
|
|
|
|
( cd pysqlite-%{V_pysqlite}
|
|
|
|
|
|
%{l_shtool} subst \
|
|
|
|
|
|
-e 's;^\([ <EFBFBD><EFBFBD><EFBFBD>]*include_dirs = \[\)\([^\]]*\).*$;\1"%{l_prefix}/include"\2;' \
|
|
|
|
|
|
-e 's;^\([ <EFBFBD><EFBFBD><EFBFBD>]*library_dirs = \[\)\([^\]]*\).*$;\1"%{l_prefix}/lib"\2;' \
|
|
|
|
|
|
setup.py
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py build
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_pgsql}" == "yes"
|
|
|
|
|
|
( cd psycopg2-%{V_psycopg2}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py build
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_mysql}" == "yes"
|
|
|
|
|
|
( cd MySQL-python-%{V_mysql_python}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py build
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_oracle}" == "yes"
|
|
|
|
|
|
( cd cx_Oracle-%{V_cx_oracle}
|
|
|
|
|
|
%{l_shtool} subst \
|
|
|
|
|
|
-e 's;^\(PYTHON=\).*$;\1 %{l_prefix}/bin/python;' \
|
|
|
|
|
|
Makefile
|
|
|
|
|
|
ORACLE_HOME="`%{l_rc} --query oracle_home`"
|
|
|
|
|
|
export ORACLE_HOME
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py build
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
( cd SQLObject-%{V_sqlobject}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py build
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}
|
|
|
|
|
|
%if "%{with_sqlite}" == "yes"
|
|
|
|
|
|
( cd pysqlite-%{V_pysqlite}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py install \
|
|
|
|
|
|
--skip-build \
|
|
|
|
|
|
--root=$RPM_BUILD_ROOT \
|
|
|
|
|
|
--prefix=%{l_prefix}
|
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/pysqlite2-doc
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_pgsql}" == "yes"
|
|
|
|
|
|
( cd psycopg2-%{V_psycopg2}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py install \
|
|
|
|
|
|
--skip-build \
|
|
|
|
|
|
--root=$RPM_BUILD_ROOT \
|
|
|
|
|
|
--prefix=%{l_prefix}
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_mysql}" == "yes"
|
|
|
|
|
|
( cd MySQL-python-%{V_mysql_python}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py install \
|
|
|
|
|
|
--skip-build \
|
|
|
|
|
|
--root=$RPM_BUILD_ROOT \
|
|
|
|
|
|
--prefix=%{l_prefix}
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
%if "%{with_oracle}" == "yes"
|
|
|
|
|
|
( cd cx_Oracle-%{V_cx_oracle}
|
|
|
|
|
|
ORACLE_HOME="`%{l_rc} --query oracle_home`"
|
|
|
|
|
|
export ORACLE_HOME
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py install \
|
|
|
|
|
|
--skip-build \
|
|
|
|
|
|
--root=$RPM_BUILD_ROOT \
|
|
|
|
|
|
--prefix=%{l_prefix}
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%endif
|
|
|
|
|
|
( cd SQLObject-%{V_sqlobject}
|
|
|
|
|
|
%{l_prefix}/bin/python setup.py install \
|
|
|
|
|
|
--skip-build \
|
|
|
|
|
|
--root=$RPM_BUILD_ROOT \
|
|
|
|
|
|
--prefix=%{l_prefix}
|
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
|
|
|
|
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
|
|