[packages/python-apsw] - up to 3.8.5; add python3 subpackage
arekm
arekm at pld-linux.org
Thu Jun 12 14:19:12 CEST 2014
commit b3b3252f733556e60eaee106d122c31d361e6be9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Jun 12 14:19:09 2014 +0200
- up to 3.8.5; add python3 subpackage
python-apsw.spec | 122 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 106 insertions(+), 16 deletions(-)
---
diff --git a/python-apsw.spec b/python-apsw.spec
index 3fa4ee3..c3a97e7 100644
--- a/python-apsw.spec
+++ b/python-apsw.spec
@@ -1,23 +1,35 @@
+#
+# Conditional build:
+%bcond_with tests # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
%define module apsw
-%define sqlite_ver 3.8.0.1
+%define sqlite_ver 3.8.5
Summary: Another Python SQLite Wrapper
Summary(pl.UTF-8): Another Python SQLite Wrapper - jeszcze jeden pythonowy wrapper dla SQLite
Name: python-%{module}
-Version: 3.8.0.1
+Version: 3.8.5
Release: 1
License: Free
-Group: Development/Languages/Python
-Source0: http://apsw.googlecode.com/files/%{module}-%{version}-r1.zip
-# Source0-md5: 2ea61c66ce40cbe3d10ea16c633867de
-URL: http://code.google.com/p/apsw/
-%pyrequires_eq python-modules
-BuildRequires: python-devel >= 1:2.3
-BuildRequires: python-modules
+Group: Libraries/Python
+Source0: https://github.com/rogerbinns/apsw/archive/%{version}-r1.tar.gz
+# Source0-md5: 09eb9f39d7cf9d320ee8e89f9e9ab7ea
+URL: http://rogerbinns.github.io/apsw/
BuildRequires: rpm-pythonprov
BuildRequires: sqlite3-devel >= %{sqlite_ver}
BuildRequires: unzip
+%if %{with python2}
+BuildRequires: python-devel
+BuildRequires: python-distribute
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-distribute
+BuildRequires: python3-modules
+%endif
+Requires: python-modules
Requires: sqlite3 >= %{sqlite_ver}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -35,25 +47,103 @@ C SQLite 3 można zrobić także z poziomu Pythona. Chociaż APSQ wygląda
dosyć podobnie do DBAPI, nie jest kompatybilne z tym API, natomiast
działa tak, jak SQLite 3.
+%package -n python3-%{module}
+Summary: -
+Summary(pl.UTF-8): -
+Group: Libraries/Python
+Requires: sqlite3 >= %{sqlite_ver}
+
+%description -n python3-%{module}
+APSW provides an SQLite 3 wrapper that provides the thinnest layer
+over SQLite 3 possible. Everything you can do from the C API to SQLite
+3, you can do from Python. Although APSW looks vaguely similar to the
+DBAPI, it is not compliant with that API and instead works the way
+SQLite 3 does.
+
+%description -n python3-%{module} -l pl.UTF-8
+APSW udostępnia wrapper SQLite 3 dostarczający najcieńszą jak to tylko
+możliwe warstwę ponad SQLite 3. Wszystko co można zrobić z poziomu API
+C SQLite 3 można zrobić także z poziomu Pythona. Chociaż APSQ wygląda
+dosyć podobnie do DBAPI, nie jest kompatybilne z tym API, natomiast
+działa tak, jak SQLite 3.
+
+%package apidocs
+Summary: %{module} API documentation
+Summary(pl.UTF-8): Dokumentacja API %{module}
+Group: Documentation
+
+%description apidocs
+API documentation for %{module}.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API %{module}.
+
%prep
%setup -q -n %{module}-%{version}-r1
%build
-CFLAGS="%{rpmcflags}"
-export CFLAGS
-python setup.py build
+%if %{with python2}
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%if %{with doc}
+cd docs
+%{__make} -j1 html
+rm -rf _build/html/_sources
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-python setup.py install \
- --root=$RPM_BUILD_ROOT --optimize=2
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc doc
-%attr(755,root,root) %{py_sitedir}/%{module}.so
+%doc LICENSE README.rst
+%attr(755,root,root) %{py_sitedir}/*.so
+%if "%{py_ver}" > "2.4"
%{py_sitedir}/%{module}-*.egg-info
+%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc LICENSE README.rst
+%{py3_sitedir}/%{module}*.so
+%{py3_sitedir}/%{module}-%{version}*-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/*
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-apsw.git/commitdiff/b3b3252f733556e60eaee106d122c31d361e6be9
More information about the pld-cvs-commit
mailing list