Updated RPM SPEC File to Support Python 3
Signed-off-by: Lars Kiesow <lkiesow@uos.de>
This commit is contained in:
parent
bf8d0729f6
commit
183cbd577a
1 changed files with 51 additions and 6 deletions
|
@ -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 <lkiesow@uos.de> - 0.3.1-2
|
||||
- Building for Python 3 as well
|
||||
|
||||
* Fri Jan 16 2015 Lars Kiesow <lkiesow@uos.de> - 0.3.1-1
|
||||
- Update to 0.3.1
|
||||
|
||||
|
|
Loading…
Reference in a new issue