[python-catkin-sphinx/f21] Add python3 package
Scott K Logan
cottsay at fedoraproject.org
Sun Dec 14 08:24:35 UTC 2014
commit 263741dddbe1f51f6f40a27482bbf77d090919fe
Author: Scott K Logan <logans at cottsay.net>
Date: Sat Dec 13 23:40:24 2014 -0800
Add python3 package
python-catkin-sphinx.spec | 73 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 64 insertions(+), 9 deletions(-)
---
diff --git a/python-catkin-sphinx.spec b/python-catkin-sphinx.spec
index 892cdb5..bca10dd 100644
--- a/python-catkin-sphinx.spec
+++ b/python-catkin-sphinx.spec
@@ -2,42 +2,97 @@
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global realname catkin-sphinx
-Name: python-catkin-sphinx
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
+Name: python-%{realname}
Version: 0.2.1
-Release: 4.20130602git%{shortcommit}%{?dist}
+Release: 5.20130602git%{shortcommit}%{?dist}
Summary: Sphinx plugins for Catkin projects
License: BSD
-URL: https://github.com/ros/catkin-sphinx
+URL: https://github.com/ros/%{realname}
Source0: https://github.com/ros/%{realname}/archive/%{commit}/%{realname}-%{version}-%{shortcommit}.tar.gz
-BuildRequires: python2-devel
-Requires: python-sphinx
BuildArch: noarch
+Requires: python-sphinx
+BuildRequires: python2-devel
+
+
+%if 0%{?with_python3}
+%package -n python3-%{realname}
+Summary: Sphinx plugins for Catkin projects
+
+BuildRequires: python3-devel
+Requires: python3-sphinx
+%endif
+
%description
Sphinx plugins for Catkin projects.
+%if 0%{?with_python3}
+%description -n python3-%{realname}
+Sphinx plugins for Catkin projects.
+%endif
+
+
%prep
%setup -qn %{realname}-%{commit}
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif
+
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
+
%build
-%{__python} setup.py build
+%{__python2} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
%install
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+%{__python2} setup.py install --skip-build --root %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
%files
%doc README.md
-%{python_sitelib}/catkin_sphinx
-%{python_sitelib}/catkin_sphinx-%{version}-py?.?.egg-info
+%{python2_sitelib}/catkin_sphinx
+%{python2_sitelib}/catkin_sphinx-%{version}-py?.?.egg-info
+
+
+%if 0%{?with_python3}
+%files -n python3-%{realname}
+%doc README.md
+%{python3_sitelib}/catkin_sphinx
+%{python3_sitelib}/catkin_sphinx-%{version}-py?.?.egg-info
+%endif
+
%changelog
+* Sat Dec 13 2014 Scott K Logan <logans at cottsay.net> - 0.2.1-5.20130602gitc00d68b
+- Add python3 package
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2.1-4.20130602gitc00d68b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list