Subject: rmattes pushed to python-bloom (f24). "Update
to new python guidelines"



From 07f7bf213d8970204d7d1270d33162545677c4b2 Mon Sep 17 00:00:00 2001
From: Rich Mattes <[email protected]>
Date: Sun, 3 Apr 2016 20:18:13 -0400
Subject: Update to new python guidelines

---
python-bloom.spec | 90 +++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 74 insertions(+), 16 deletions(-)

diff --git a/python-bloom.spec b/python-bloom.spec
index b11e568..7f06d95 100644
--- a/python-bloom.spec
+++ b/python-bloom.spec
@@ -13,18 +13,12 @@ Source0:
https://github.com/ros-infrastructure/bloom/archive/%{commit}/bl

BuildArch: noarch

-BuildRequires: python-nose
+BuildRequires: python2-nose
+BuildRequires: python3-nose
BuildRequires: python-pep8
BuildRequires: python-sphinx
BuildRequires: python2-devel
-Requires: PyYAML
-Requires: python-catkin_pkg >= 0.2.2
-Requires: python-dateutil
-Requires: python-empy
-Requires: python-rosdep >= 0.10.25
-Requires: python-rosdistro >= 0.4.0
-Requires: python-setuptools
-Requires: python-vcstools >= 0.1.22
+BuildRequires: python3-devel

%description
Bloom provides tools for releasing software on top of a git repository
@@ -33,31 +27,95 @@ bloom leverages meta and build information from catkin
(https://github.com/ros/catkin) to automate release branching and the
generation of platform specific source packages, like debian's src-debs.

+%package -n python2-bloom
+Summary: Bloom is a release automation tool
+%{?python_provide:%python_provide python2-bloom}
+Requires: python2-PyYAML
+Requires: python2-catkin_pkg >= 0.2.2
+Requires: python2-dateutil
+Requires: python2-empy
+Requires: python2-rosdep >= 0.10.25
+Requires: python2-rosdistro >= 0.4.0
+Requires: python2-setuptools
+Requires: python2-vcstools >= 0.1.22
+
+%description -n python2-bloom
+Bloom provides tools for releasing software on top of a git repository
+and leverages tools and patterns from git-buildpackage. Additionally,
+bloom leverages meta and build information from catkin
+(https://github.com/ros/catkin) to automate release branching and the
+generation of platform specific source packages, like debian's src-debs.
+
+%package -n python3-bloom
+Summary: Bloom is a release automation tool
+%{?python_provide:%python_provide python3-bloom}
+Requires: python3-PyYAML
+Requires: python3-catkin_pkg >= 0.2.2
+Requires: python3-dateutil
+Requires: python3-empy
+Requires: python3-rosdep >= 0.10.25
+Requires: python3-rosdistro >= 0.4.0
+Requires: python3-setuptools
+Requires: python3-vcstools >= 0.1.22
+
+%description -n python3-bloom
+Bloom provides tools for releasing software on top of a git repository
+and leverages tools and patterns from git-buildpackage. Additionally,
+bloom leverages meta and build information from catkin
+(https://github.com/ros/catkin) to automate release branching and the
+generation of platform specific source packages, like debian's src-debs.
+
%prep
%setup -qn bloom-%{commit}

%build
-%{__python2} setup.py build
+%py2_build
+%py3_build
PYTHONPATH=%{_builddir}/bloom-%{commit}/build/lib/ make -C docs html man
rm -f docs/_build/html/.buildinfo

%install
-%{__python2} setup.py install --skip-build --root %{buildroot}
+# Make the python2 versions of the binaries the default for now.
+# Create versioned symlinks as per python packaging guidelines.
+%py3_install
+for f in %{buildroot}%{_bindir}/*;
+do
+ mv %{buildroot}%{_bindir}/$(basename $f){,-3}
+ ln -s %{_bindir}/$(basename $f)-3 %{buildroot}%{_bindir}/$(basename
$f)-%{python3_version}
+done
+%py2_install
+for f in %{buildroot}%{_bindir}/*[!3,%{python3_version}];
+do
+ ln -s %{_bindir}/$(basename $f) %{buildroot}%{_bindir}/$(basename $f)-2
+ ln -s %{_bindir}/$(basename $f) %{buildroot}%{_bindir}/$(basename
$f)-%{python2_version}
+done
+
# Test directory should NOT be installed
rm -rf %{buildroot}%{python2_sitelib}/test
+rm -rf %{buildroot}%{python3_sitelib}/test
+
+# Scripts don't install the manpage - do it manually.
install -m0644 -D docs/_build/man/bloom.1
%{buildroot}%{_datadir}/man/man1/bloom.1

%check
-# Many of the tests require rosdep to be functioning, which requires sudo
-# Run only the tests that don't
+# Many of the tests require rosdep to be functioning, which requires sudo.
+# Run only the tests that don't.
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests test/test_code_format.py
+PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version}
test/test_code_format.py

-%files
+%files -n python2-bloom
%doc CHANGELOG.rst LICENSE.txt README.rst docs/_build/html
%{python2_sitelib}/bloom
%{python2_sitelib}/bloom-%{version}-py?.?.egg-info
-%{_bindir}/bloom-*
-%{_bindir}/git-bloom-*
+%{_bindir}/*[!3,%{python3_version}]
+%{_datadir}/man/man1/bloom.1.gz
+
+%files -n python3-bloom
+%doc CHANGELOG.rst LICENSE.txt README.rst docs/_build/html
+%{python3_sitelib}/bloom
+%{python3_sitelib}/bloom-%{version}-py?.?.egg-info
+%{_bindir}/*-3
+%{_bindir}/*-%{python3_version}
%{_datadir}/man/man1/bloom.1.gz

%changelog
--
cgit v0.12



http://pkgs.fedoraproject.org/cgit/python-bloom.git/commit/?h=f24&id=07f7bf213d8970204d7d1270d33162545677c4b2
_______________________________________________
scm-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]



Programming list archiving by: Enterprise Git Hosting