[packages/python-logilab-astng] Python3 support
jajcus
jajcus at pld-linux.org
Mon May 27 19:57:17 CEST 2013
commit 797e8d54ba45349e9a175177ae1ede62537d4662
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Mon May 27 19:56:55 2013 +0200
Python3 support
Release: 3
python-logilab-astng.spec | 57 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
---
diff --git a/python-logilab-astng.spec b/python-logilab-astng.spec
index c4f62da..9eae44b 100644
--- a/python-logilab-astng.spec
+++ b/python-logilab-astng.spec
@@ -1,18 +1,31 @@
+
+# Conditional build:
+%bcond_without python2 # Python 2.x module
+%bcond_without python3 # Python 3.x module
+
%define module logilab-astng
Summary: Python Abstract Syntax Tree New Generation
Summary(pl.UTF-8): Abstrakcyjne drzewa składniowe Pythona nowej generacji
Name: python-logilab-astng
Version: 0.24.3
-Release: 2
+Release: 3
License: LGPL v2.1+
Group: Development/Languages/Python
Source0: http://download.logilab.org/pub/astng/%{module}-%{version}.tar.gz
# Source0-md5: 11d9a33a00790dc30b851afbeaf1fb4e
URL: http://www.logilab.org/projects/astng
+%if %{with python2}
BuildRequires: python-devel
BuildRequires: python-modules >= 1:2.5
+%endif
+%if %{with python3}
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: python3-2to3
+BuildRequires: python3-devel
+BuildRequires: python3-distribute
+BuildRequires: python3-modules >= 1:3.1
+%endif
%pyrequires_eq python-modules
Requires: python-logilab-common >= 0.53.0
BuildArch: noarch
@@ -30,22 +43,57 @@ kodu źródłowego Pythona dla projektów takich jak pychecker, pyreverse,
pylint... Właściwie tworzenie tej biblioteki jest istotnie kierowane
potrzebami pylinta.
+%package -n python3-%{module}
+Summary: Python Abstract Syntax Tree New Generation
+Summary(pl.UTF-8): Abstrakcyjne drzewa składniowe Pythona nowej generacji
+Group: Development/Languages/Python
+%pyrequires_eq python3-modules
+Requires: python3-logilab-common >= 0.53.0
+
+%description -n python3-%{module}
+The aim of this module is to provide a common base representation of
+Python source code for projects such as pychecker, pyreverse,
+pylint... Well, actually the development of this library is essentialy
+governed by pylint's needs.
+
+%description -n python3-%{module} -l pl.UTF-8
+Celem tego modułu jest dostarczenie wspólnej bazowej reprezentacji
+kodu źródłowego Pythona dla projektów takich jak pychecker, pyreverse,
+pylint... Właściwie tworzenie tej biblioteki jest istotnie kierowane
+potrzebami pylinta.
+
%prep
%setup -q -n %{module}-%{version}
# drop python 2.5 egg deps
rm */*/*py2.5.egg
%build
+%if %{with python2}
%{__python} setup.py build
+%endif
+%if %{with python3}
+%{__python3} setup.py build --build-base=build3
+%endif
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with python3}
+%{__python3} setup.py build --build-base=build3 install \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+# this file is packaged with python3-logilab-common
+rm $RPM_BUILD_ROOT%{py3_sitescriptdir}/logilab/__init__.py
+%endif
+
+%if %{with python2}
%{__python} setup.py install \
--optimize=2 \
--root=$RPM_BUILD_ROOT
%py_postclean
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -56,3 +104,10 @@ rm -rf $RPM_BUILD_ROOT
%{py_sitescriptdir}/logilab/astng
%{py_sitescriptdir}/logilab_astng-%{version}-py*.egg-info
%{py_sitescriptdir}/logilab_astng-%{version}-py*-nspkg.pth
+
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc ChangeLog README
+%{py3_sitescriptdir}/logilab/astng
+%{py3_sitescriptdir}/logilab_astng-%{version}-py*.egg-info
+%{py3_sitescriptdir}/logilab_astng-%{version}-py*-nspkg.pth
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-logilab-astng.git/commitdiff/797e8d54ba45349e9a175177ae1ede62537d4662
More information about the pld-cvs-commit
mailing list