From 183cbd577acde169b34bb923f6b89cec463eb5f3 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Mon, 4 May 2015 18:51:35 +0200 Subject: [PATCH] Updated RPM SPEC File to Support Python 3 Signed-off-by: Lars Kiesow --- python-feedgen.spec | 57 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/python-feedgen.spec b/python-feedgen.spec index 5e373b0..7bdbc7e 100644 --- a/python-feedgen.spec +++ b/python-feedgen.spec @@ -2,7 +2,7 @@ Name: python-%{srcname} Version: 0.3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Feed Generator (ATOM, RSS, Podcasts) Group: Development/Libraries @@ -17,6 +17,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools +BuildRequires: python3-devel +BuildRequires: python3-setuptools + Requires: python-lxml Requires: python-dateutil @@ -26,18 +29,49 @@ has support for extensions. Included is for example an extension to produce Podcasts. +%package -n python3-%{srcname} +Summary: Feed Generator (ATOM, RSS, Podcasts) +Group: Development/Libraries + +Requires: python3-lxml +Requires: python3-dateutil + +%description -n python3-%{srcname} +This module can be used to generate web feeds in both ATOM and RSS format. It +has support for extensions. Included is for example an extension to produce +Podcasts. + + %prep %setup -q -n %{srcname}-%{version} +mkdir python2 +mv PKG-INFO docs feedgen license.bsd license.lgpl readme.md setup.py python2 +cp -r python2 python3 + +# ensure the right python version is used +find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build -%{__python} setup.py build +pushd python2 +%{__python2} setup.py build +popd +pushd python3 +%{__python3} setup.py build +popd %install rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -chmod 644 $RPM_BUILD_ROOT%{python_sitelib}/%{srcname}/*.py +pushd python3 +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd +pushd python2 +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd +chmod 644 $RPM_BUILD_ROOT%{python3_sitelib}/%{srcname}/*.py +chmod 644 $RPM_BUILD_ROOT%{python2_sitelib}/%{srcname}/*.py %clean @@ -46,11 +80,22 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc docs/* -%{python_sitelib}/* +%license python2/license.* +%doc python2/docs/* +%{python2_sitelib}/* + + +%files -n python3-%{srcname} +%defattr(-,root,root,-) +%license python3/license.* +%doc python3/docs/* +%{python3_sitelib}/* %changelog +* Mon May 4 2015 Lars Kiesow - 0.3.1-2 +- Building for Python 3 as well + * Fri Jan 16 2015 Lars Kiesow - 0.3.1-1 - Update to 0.3.1