Tue, 22 Mar 2011 19:33:14 +0100
Import package vendor original specs for necessary manipulations.
python-db/python-db.patch | file | annotate | diff | comparison | revisions | |
python-db/python-db.spec | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/python-db/python-db.patch Tue Mar 22 19:33:14 2011 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +Index: psycopg2-2.0.14/psycopg/config.h 1.5 +--- psycopg2-2.0.14/psycopg/config.h.orig 2009-04-26 14:09:21 +0200 1.6 ++++ psycopg2-2.0.14/psycopg/config.h 2009-10-08 22:31:01 +0200 1.7 +@@ -140,10 +140,11 @@ 1.8 + 1.9 + #if (defined(__FreeBSD__) && __FreeBSD_version < 503000) || (defined(_WIN32) && !defined(__GNUC__)) || defined(__sun__) || defined(sun) 1.10 + /* what's this, we have no round function either? */ 1.11 +-static double round(double num) 1.12 ++static double my_round(double num) 1.13 + { 1.14 + return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5); 1.15 + } 1.16 ++#define round(num) my_round(num) 1.17 + #endif 1.18 + 1.19 + /* postgresql < 7.4 does not have PQfreemem */ 1.20 +Index: psycopg2-2.0.14/setup.py 1.21 +--- psycopg2-2.0.14/setup.py.orig 2009-10-04 23:37:14 +0200 1.22 ++++ psycopg2-2.0.14/setup.py 2009-10-08 23:15:48 +0200 1.23 +@@ -203,6 +203,9 @@ 1.24 + os.path.join(self.get_pg_config("libdir"), "libpq.a")) 1.25 + else: 1.26 + self.libraries.append("pq") 1.27 ++ self.libraries.append("ssl") 1.28 ++ self.libraries.append("crypto") 1.29 ++ self.libraries.append("crypt") 1.30 + 1.31 + try: 1.32 + self.library_dirs.append(self.get_pg_config("libdir"))
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/python-db/python-db.spec Tue Mar 22 19:33:14 2011 +0100 2.3 @@ -0,0 +1,210 @@ 2.4 +## 2.5 +## python-db.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# FIXME: rse: Oracle module was blindly packaged 2.28 + 2.29 +# package version 2.30 +%define V_python 2.5 2.31 +%define V_pysqlite_major 2.4 2.32 +%define V_pysqlite 2.4.1 2.33 +%define V_psycopg2 2.0.14 2.34 +%define V_mysql_python 1.2.3c1 2.35 +%define V_cx_oracle 5.0.3 2.36 +%define V_sqlobject 0.12.4 2.37 + 2.38 +# package information 2.39 +Name: python-db 2.40 +Summary: Python DB-API 2.0 Modules 2.41 +URL: http://www.python.org/ 2.42 +Vendor: Python Community 2.43 +Packager: OpenPKG Foundation e.V. 2.44 +Distribution: OpenPKG Community 2.45 +Class: EVAL 2.46 +Group: Language 2.47 +License: GPL 2.48 +Version: %{V_python} 2.49 +Release: 20100506 2.50 + 2.51 +# package options 2.52 +%option with_sqlite yes 2.53 +%option with_pgsql no 2.54 +%option with_mysql no 2.55 +%option with_oracle no 2.56 + 2.57 +# list of sources 2.58 +Source0: http://initd.org/pub/software/pysqlite/releases/%{V_pysqlite_major}/%{V_pysqlite}/pysqlite-%{V_pysqlite}.tar.gz 2.59 +Source1: http://initd.org/pub/software/psycopg/psycopg2-%{V_psycopg2}.tar.gz 2.60 +Source2: http://switch.dl.sourceforge.net/mysql-python/MySQL-python-%{V_mysql_python}.tar.gz 2.61 +Source3: http://switch.dl.sourceforge.net/cx-oracle/cx_Oracle-%{V_cx_oracle}.tar.gz 2.62 +Source4: http://pypi.python.org/packages/source/S/SQLObject/SQLObject-%{V_sqlobject}.tar.gz 2.63 +Patch0: python-db.patch 2.64 + 2.65 +# build information 2.66 +BuildPreReq: OpenPKG, openpkg >= 20100101, python >= %{V_python} 2.67 +PreReq: OpenPKG, openpkg >= 20100101, python >= %{V_python} 2.68 +BuildPreReq: python-setup 2.69 +%if "%{with_sqlite}" == "yes" 2.70 +BuildPreReq: sqlite 2.71 +PreReq: sqlite 2.72 +%endif 2.73 +%if "%{with_pgsql}" == "yes" 2.74 +BuildPreReq: postgresql 2.75 +PreReq: postgresql 2.76 +%endif 2.77 +%if "%{with_mysql}" == "yes" 2.78 +BuildPreReq: mysql 2.79 +PreReq: mysql 2.80 +%endif 2.81 +%if "%{with_oracle}" == "yes" 2.82 +BuildPreReq: oracle 2.83 +PreReq: oracle 2.84 +%endif 2.85 + 2.86 +%description 2.87 + This packages provides Python DB-API 2.0 compliant bindings to 2.88 + various RDBMS. It currently supports SQLite, PostgreSQL, MySQL and 2.89 + Oracle. 2.90 + 2.91 +%track 2.92 + prog python-db:pysqlite = { 2.93 + version = %{V_pysqlite} 2.94 + url = http://initd.org/pub/software/pysqlite/releases/ 2.95 + regex = (\d+\.\d+)/ 2.96 + url = http://initd.org/pub/software/pysqlite/releases/__NEWVER1__/ 2.97 + regex = (\d+\.\d+\.\d+)/ 2.98 + url = http://initd.org/pub/software/pysqlite/releases/__NEWVER1__/__NEWVER2__/ 2.99 + regex = pysqlite-(__VER__)\.tar\.gz 2.100 + } 2.101 + prog python-db:psycopg2 = { 2.102 + version = %{V_psycopg2} 2.103 + url = http://initd.org/pub/software/psycopg/ 2.104 + regex = psycopg2-(__VER__)\.tar\.gz 2.105 + } 2.106 + prog python-db:mysql-python = { 2.107 + version = %{V_mysql_python} 2.108 + url = http://sourceforge.net/projects/mysql-python/files/ 2.109 + regex = MySQL-python-(__VER__)\.tar\.gz 2.110 + } 2.111 + prog python-db:cx_oracle = { 2.112 + version = %{V_cx_oracle} 2.113 + url = http://sourceforge.net/projects/cx-oracle/files/ 2.114 + regex = cx_Oracle-(__VER__)\.tar\.gz 2.115 + } 2.116 + prog python-db:sqlobject = { 2.117 + version = %{V_sqlobject} 2.118 + url = http://pypi.python.org/pypi/SQLObject 2.119 + regex = pypi/SQLObject/(__VER__) 2.120 + } 2.121 + 2.122 +%prep 2.123 + %setup -q -c 2.124 + %setup -q -T -D -a 1 2.125 + %setup -q -T -D -a 2 2.126 + %setup -q -T -D -a 3 2.127 + %setup -q -T -D -a 4 2.128 + %patch -p0 2.129 + 2.130 +%build 2.131 +%if "%{with_sqlite}" == "yes" 2.132 + ( cd pysqlite-%{V_pysqlite} 2.133 + %{l_shtool} subst \ 2.134 + -e 's;^\([ »··]*include_dirs = \[\)\([^\]]*\).*$;\1"%{l_prefix}/include"\2;' \ 2.135 + -e 's;^\([ »··]*library_dirs = \[\)\([^\]]*\).*$;\1"%{l_prefix}/lib"\2;' \ 2.136 + setup.py 2.137 + %{l_prefix}/bin/python setup.py build 2.138 + ) || exit $? 2.139 +%endif 2.140 +%if "%{with_pgsql}" == "yes" 2.141 + ( cd psycopg2-%{V_psycopg2} 2.142 + %{l_prefix}/bin/python setup.py build 2.143 + ) || exit $? 2.144 +%endif 2.145 +%if "%{with_mysql}" == "yes" 2.146 + ( cd MySQL-python-%{V_mysql_python} 2.147 + %{l_prefix}/bin/python setup.py build 2.148 + ) || exit $? 2.149 +%endif 2.150 +%if "%{with_oracle}" == "yes" 2.151 + ( cd cx_Oracle-%{V_cx_oracle} 2.152 + %{l_shtool} subst \ 2.153 + -e 's;^\(PYTHON=\).*$;\1 %{l_prefix}/bin/python;' \ 2.154 + Makefile 2.155 + ORACLE_HOME="`%{l_rc} --query oracle_home`" 2.156 + export ORACLE_HOME 2.157 + %{l_prefix}/bin/python setup.py build 2.158 + ) || exit $? 2.159 +%endif 2.160 + ( cd SQLObject-%{V_sqlobject} 2.161 + %{l_prefix}/bin/python setup.py build 2.162 + ) || exit $? 2.163 + 2.164 +%install 2.165 + %{l_shtool} mkdir -f -p -m 755 \ 2.166 + $RPM_BUILD_ROOT%{l_prefix} 2.167 +%if "%{with_sqlite}" == "yes" 2.168 + ( cd pysqlite-%{V_pysqlite} 2.169 + %{l_prefix}/bin/python setup.py install \ 2.170 + --skip-build \ 2.171 + --root=$RPM_BUILD_ROOT \ 2.172 + --prefix=%{l_prefix} 2.173 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/pysqlite2-doc 2.174 + ) || exit $? 2.175 +%endif 2.176 +%if "%{with_pgsql}" == "yes" 2.177 + ( cd psycopg2-%{V_psycopg2} 2.178 + %{l_prefix}/bin/python setup.py install \ 2.179 + --skip-build \ 2.180 + --root=$RPM_BUILD_ROOT \ 2.181 + --prefix=%{l_prefix} 2.182 + ) || exit $? 2.183 +%endif 2.184 +%if "%{with_mysql}" == "yes" 2.185 + ( cd MySQL-python-%{V_mysql_python} 2.186 + %{l_prefix}/bin/python setup.py install \ 2.187 + --skip-build \ 2.188 + --root=$RPM_BUILD_ROOT \ 2.189 + --prefix=%{l_prefix} 2.190 + ) || exit $? 2.191 +%endif 2.192 +%if "%{with_oracle}" == "yes" 2.193 + ( cd cx_Oracle-%{V_cx_oracle} 2.194 + ORACLE_HOME="`%{l_rc} --query oracle_home`" 2.195 + export ORACLE_HOME 2.196 + %{l_prefix}/bin/python setup.py install \ 2.197 + --skip-build \ 2.198 + --root=$RPM_BUILD_ROOT \ 2.199 + --prefix=%{l_prefix} 2.200 + ) || exit $? 2.201 +%endif 2.202 + ( cd SQLObject-%{V_sqlobject} 2.203 + %{l_prefix}/bin/python setup.py install \ 2.204 + --skip-build \ 2.205 + --root=$RPM_BUILD_ROOT \ 2.206 + --prefix=%{l_prefix} 2.207 + ) || exit $? 2.208 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 2.209 + 2.210 +%files -f files 2.211 + 2.212 +%clean 2.213 +