[python-xlrd] Python3 support added.

Ján ONDREJ ondrejj at fedoraproject.org
Wed Aug 28 06:44:41 UTC 2013


commit 12173f49b54c066f53277f795ceeefd71f9c1a82
Author: Jan ONDREJ (SAL) <ondrejj(at)salstar.sk>
Date:   Wed Aug 28 08:44:10 2013 +0200

    Python3 support added.

 python-xlrd.spec |   48 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 43 insertions(+), 5 deletions(-)
---
diff --git a/python-xlrd.spec b/python-xlrd.spec
index cc21c24..85ae19d 100644
--- a/python-xlrd.spec
+++ b/python-xlrd.spec
@@ -2,7 +2,7 @@
 
 Name:           python-xlrd
 Version:        0.9.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Library to extract data from Microsoft Excel (TM) spreadsheet files
 
 Group:          Development/Languages
@@ -12,17 +12,25 @@ Source0:        http://pypi.python.org/packages/source/x/xlrd/xlrd-%{version}.ta
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
-BuildRequires:  python-devel, dos2unix
+BuildRequires:  python-devel, python3-devel, dos2unix
 
 %description
 Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 onwards)
 on any platform.  Pure Python (2.6, 2.7, 3.2+).  Strong support for Excel
 dates.  Unicode-aware.
 
+%package -n python3-xlrd
+Summary:        Library to extract data from Microsoft Excel (TM) spreadsheet files
+Group:          Development/Languages
+
+%description -n python3-xlrd
+Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 onwards)
+on any platform.  Pure Python (2.6, 2.7, 3.2+).  Strong support for Excel
+dates.  Unicode-aware.
+
 %prep
 %setup -q -n xlrd-%{version}
 
-%build
 # fix CRLF to LF
 for i in */*.py *.html xlrd/doc/* xlrd/examples/*; do
   # ignore missing files, they was may be only removed by mistake
@@ -32,19 +40,37 @@ for i in xlrd/doc/* xlrd/examples/xlrdnameAPIdemo.py; do
   iconv -f iso8859-1 -t UTF-8 $i > $i.tmp
   mv -f $i.tmp $i
 done
+
+# py3
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+
+%build
 %{__python} setup.py build
 
+pushd %{py3dir}
+CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
+popd
+
 %install
 rm -rf $RPM_BUILD_ROOT
+
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
+popd
+
 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-# add shebang and remove .py file
+
+# add shebang and remove .py extension
 (
   echo '#!%{__python}'
   cat $RPM_BUILD_ROOT%{_bindir}/runxlrd.py
 ) >> $RPM_BUILD_ROOT%{_bindir}/runxlrd
 rm -rf $RPM_BUILD_ROOT%{_bindir}/runxlrd.py* \
   $RPM_BUILD_ROOT/%{python_sitelib}/xlrd/doc \
-  $RPM_BUILD_ROOT/%{python_sitelib}/xlrd/examples
+  $RPM_BUILD_ROOT/%{python_sitelib}/xlrd/examples \
+  $RPM_BUILD_ROOT/%{python3_sitelib}/xlrd/doc \
+  $RPM_BUILD_ROOT/%{python3_sitelib}/xlrd/examples
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -59,7 +85,19 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 %attr(755,root,root) %{_bindir}/*
 
+%files -n python3-xlrd
+%defattr(-,root,root,-)
+%doc xlrd/doc/* xlrd/examples
+%attr(755,root,root) %dir %{python3_sitelib}/xlrd
+%{python3_sitelib}/xlrd/*
+%if 0%{fedora} > 8
+%{python3_sitelib}/*egg-info
+%endif
+
 %changelog
+* Tue Aug 27 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.9.2-3
+- add py3 support (bz#995971)
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.9.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list