| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- ##
- ## python-db.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## 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.4
- %define V_pysqlite_major 2.1
- %define V_pysqlite 2.1.3
- %define V_psycopg2 2.0b8
- %define V_dcoracle2 1.2
- %define V_mysql_python 1.2.1c7
- # package information
- Name: python-db
- Summary: Python DB-API 2.0 Modules
- URL: http://www.python.org/
- Vendor: Python Community
- Packager: OpenPKG
- Distribution: OpenPKG
- Class: EVAL
- Group: Language
- License: GPL
- Version: %{V_python}
- Release: 20060307
- # package options
- %option with_sqlite yes
- %option with_pgsql no
- %option with_mysql no
- %option with_oracle no
- # list of sources
- Source0: http://initd.org/pub/software/pysqlite/releases/%{V_pysqlite_major}/%{V_pysqlite}/pysqlite-%{V_pysqlite}.tar.gz
- Source1: http://initd.org/pub/software/psycopg/psycopg2-%{V_psycopg2}.tar.gz
- Source2: http://www.zope.org/Members/matt/dco2/%{V_dcoracle2}/DCOracle2-%{V_dcoracle2}.tgz
- Source3: http://osdn.dl.sourceforge.net/mysql-python/MySQL-python-%{V_mysql_python}.tar.gz
- Patch0: python-db.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130, python
- PreReq: OpenPKG, openpkg >= 20040130, python
- %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
- AutoReq: no
- AutoReqProv: no
- %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://initd.org/pub/software/pysqlite/releases/
- regex = (\d+\.\d+)/
- url = http://initd.org/pub/software/pysqlite/releases/__NEWVER1__/
- regex = (\d+\.\d+\.\d+)/
- url = http://initd.org/pub/software/pysqlite/releases/__NEWVER1__/__NEWVER2__/
- regex = pysqlite-(__VER__)\.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://prdownloads.sourceforge.net/mysql-python/
- regex = MySQL-python-(__VER__)\.tar\.gz
- }
- prog python-db:dcoracle2 = {
- version = %{V_dcoracle2}
- url = http://www.zope.org/Members/matt/dco2/
- regex = DCOracle2-(\d+\.[\d\.]+)\.tgz
- }
- %prep
- %setup -q -c
- %setup -q -T -D -a 1
- %setup -q -T -D -a 2
- %setup -q -T -D -a 3
- %patch -p0
- %build
- %if "%{with_sqlite}" == "yes"
- ( cd pysqlite-%{V_pysqlite}
- %{l_shtool} subst \
- -e 's;/usr/local/include;%{l_prefix}/include;' \
- -e 's;/usr/local/lib;%{l_prefix}/lib;' \
- setup.cfg
- %{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 DCOracle2-%{V_dcoracle2}
- %{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
- MAKE="%{l_make}" %{l_make} %{l_mflags -O} DCOracle2/dco2.so
- ) || exit $?
- %endif
- %install
- rm -rf $RPM_BUILD_ROOT
- %{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 DCOracle2-%{V_dcoracle2}
- 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
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
|