packages: python-bottle/python-bottle.spec - build python 2 and python 3 ve...
megabajt
megabajt at pld-linux.org
Sun Nov 14 13:35:55 CET 2010
Author: megabajt Date: Sun Nov 14 12:35:55 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- build python 2 and python 3 version from one spec
---- Files affected:
packages/python-bottle:
python-bottle.spec (1.3 -> 1.4)
---- Diffs:
================================================================
Index: packages/python-bottle/python-bottle.spec
diff -u packages/python-bottle/python-bottle.spec:1.3 packages/python-bottle/python-bottle.spec:1.4
--- packages/python-bottle/python-bottle.spec:1.3 Sun Nov 14 12:38:33 2010
+++ packages/python-bottle/python-bottle.spec Sun Nov 14 13:35:50 2010
@@ -1,5 +1,11 @@
# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without python2 # build python 2 module
+%bcond_without python3 # build python 3 module
+#
%define module bottle
+#
Summary: Fast and simple WSGI-framework for small web-applications
Summary(pl.UTF-8): Szybki i prosty szkielet WSGI dla małych aplikacji sieciowych
Name: python-%{module}
@@ -10,10 +16,18 @@
Source0: http://pypi.python.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz
# Source0-md5: 10e58aa1ef4fe66a9e99153df5dc1b09
URL: http://bottle.paws.de/docs/dev/index.html
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.5
+%endif
+%if %{with python3}
+BuildRequires: python3-2to3
+BuildRequires: python3-devel
+BuildRequires: python3-modules
+%endif
BuildRequires: rpm-pythonprov
# if py_postclean is used
BuildRequires: rpmbuild(macros) >= 1.219
-Requires: python-modules
+Requires: python-modules >= 1:2.5
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -32,31 +46,81 @@
silników wzorców. Wszystko w jednym pliku bez zalezności innych niż
standardowej biblioteki Pythona.
+%package -n python3-%{module}
+Summary: Fast and simple WSGI-framework for small web-applications
+Summary(pl.UTF-8): Szybki i prosty szkielet WSGI dla małych aplikacji sieciowych
+Group: Development/Languages/Python
+Requires: python3-modules
+
+%description -n python3-%{module}
+Bottle is a fast and simple micro-framework for small
+web-applications. It offers request dispatching (Routes) with url
+parameter support, Templates, a build-in HTTP Server and adapters for
+many third party WSGI/HTTP-server and template engines. All in a
+single file and with no dependencies other than the Python Standard
+Library.
+
+%description -n python3-%{module} -l pl.UTF-8
+Bottle jest szybkim i prostym szkieletem dla małych aplikcaji WSGI.
+Oferuje mapowanie urli poprzez Routes wspierając urle z parametrami,
+wzroce, wbudowany serwer HTTP i wtyczki dla wielu serwerów WSGI/HTTP i
+silników wzorców. Wszystko w jednym pliku bez zalezności innych niż
+standardowej biblioteki Pythona.
+
%prep
%setup -q -n %{module}-%{version}
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build -b build-2
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build -b build-3
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- --skip-build \
+
+%if %{with python2}
+%{__python} setup.py \
+ build -b build-2 \
+ install \
--optimize=2 \
--root=$RPM_BUILD_ROOT
%py_ocomp $RPM_BUILD_ROOT%%{py_sitescriptdir}
%py_comp $RPM_BUILD_ROOT%%{py_sitescriptdir}
%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build -b build-3 \
+ install \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+%py3_postclean
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
%{py_sitescriptdir}/*.py[co]
%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/%{module}-*.egg-info
%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%{py3_sitescriptdir}/*.py[co]
+%{py3_sitescriptdir}/%{module}-*.egg-info
+%endif
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -64,6 +128,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.4 2010/11/14 12:35:50 megabajt
+- build python 2 and python 3 version from one spec
+
Revision 1.3 2010/11/14 11:38:33 megabajt
- updated to 0.8.5
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-bottle/python-bottle.spec?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list