From 1f439b4062b6d4037ef07c98024fb1aafc9c00e2 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Feb 12 2019 23:42:49 +0000 Subject: Move SCM packages from Requires to Recommends - Drop test coverage from %check - Clean up spec file - Add Python 3 subpackage for EPEL7 --- diff --git a/.gitignore b/.gitignore index 7027aed..5636a07 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /vcstools-0.1.38-09d5a65.tar.gz /vcstools-0.1.39-5117043.tar.gz /vcstools-0.1.40-54418db.tar.gz +/vcstools-0.1.40.tar.gz diff --git a/python-vcstools.spec b/python-vcstools.spec index b5fabd3..25b861c 100644 --- a/python-vcstools.spec +++ b/python-vcstools.spec @@ -1,42 +1,28 @@ -%global commit 54418dbd886821a5ac70062c9dd22833f933a5bf -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global realname vcstools +%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || !(0%{?rhel} >= 8)} +%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7} -%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())")} -%{!?python2_version: %global python2_version %(%{__python2} -c "from sys import stdout, version; stdout.write(version[:3])")} -%endif +%global srcname vcstools -Name: python-%{realname} +Name: python-%{srcname} Version: 0.1.40 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Version Control System tools for Python License: BSD URL: http://www.ros.org/wiki/vcstools -Source0: https://github.com/%{realname}/%{realname}/archive/%{commit}/%{realname}-%{version}-%{shortcommit}.tar.gz +Source0: https://github.com/%{srcname}/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: bzr BuildRequires: git BuildRequires: mercurial -BuildRequires: python2-coverage -BuildRequires: python2-dateutil -BuildRequires: python2-devel -BuildRequires: python2-mock -BuildRequires: python2-nose %if 0%{?rhel} && 0%{?rhel} <= 6 BuildRequires: python-sphinx10 %else BuildRequires: python2-sphinx %endif -BuildRequires: python2-pyyaml BuildRequires: subversion -BuildRequires: glibc-langpack-en %description The vcstools module provides a Python API for interacting with different @@ -45,46 +31,65 @@ for seamless interacting with Git, Mercurial (Hg), Bzr and SVN. The focus of the API is manipulating on-disk checkouts of source-controlled trees. Its main use is to support the rosinstall tool. -%package -n python2-%{realname} +%if 0%{?with_python2} +%package -n python2-%{srcname} Summary: Version Control System tools for Python -%{?python_provide:%python_provide python2-%{realname}} +%{?python_provide:%python_provide python2-%{srcname}} +BuildRequires: python2-dateutil +BuildRequires: python2-devel +BuildRequires: python2-mock +BuildRequires: python2-nose +BuildRequires: python2-pyyaml +Requires: python2-dateutil +Requires: python2-pyyaml +%if 0%{?rhel} && 0%{?rhel} < 8 Requires: bzr Requires: git Requires: mercurial -Requires: python2-dateutil -Requires: python2-pyyaml Requires: subversion +%else +Recommends: bzr +Recommends: git +Recommends: mercurial +Recommends: subversion +%endif # rhel -%description -n python2-%{realname} +%description -n python2-%{srcname} The vcstools module provides a Python API for interacting with different version control systems (VCS/SCMs). The VcsClient class provides an API for seamless interacting with Git, Mercurial (Hg), Bzr and SVN. The focus of the API is manipulating on-disk checkouts of source-controlled trees. Its main use is to support the rosinstall tool. +%endif # with_python2 %if 0%{?with_python3} -%package -n python3-%{realname} +%package -n python%{python3_pkgversion}-%{srcname} Summary: Version Control System tools for Python - -BuildRequires: python3-coverage -BuildRequires: python3-dateutil -BuildRequires: python3-devel -BuildRequires: python3-mock -BuildRequires: python3-nose -BuildRequires: python3-setuptools -BuildRequires: python3-sphinx -BuildRequires: python3-PyYAML - +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +BuildRequires: python%{python3_pkgversion}-dateutil +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-mock +BuildRequires: python%{python3_pkgversion}-nose +BuildRequires: python%{python3_pkgversion}-PyYAML +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-sphinx +Requires: python%{python3_pkgversion}-dateutil +Requires: python%{python3_pkgversion}-PyYAML + +%if 0%{?rhel} && 0%{?rhel} < 8 Requires: bzr Requires: git Requires: mercurial -Requires: python3-dateutil -Requires: python3-PyYAML Requires: subversion -%{?python_provide:%python_provide python3-%{realname}} +%else +Recommends: bzr +Recommends: git +Recommends: mercurial +Recommends: subversion +%endif # rhel -%description -n python3-%{realname} +%description -n python%{python3_pkgversion}-%{srcname} The vcstools module provides a Python API for interacting with different version control systems (VCS/SCMs). The VcsClient class provides an API for seamless interacting with Git, Mercurial (Hg), Bzr and SVN. The focus @@ -93,91 +98,88 @@ Its main use is to support the rosinstall tool. %endif # with_python3 %prep -%setup -qn %{realname}-%{commit} +%autosetup -n %{srcname}-%{version} + sed -i 's/haiku/default/' doc/conf.py sed -i 's/:special-members://' doc/vcstools.rst +%build +%if 0%{?with_python2} +%py2_build +%endif # with_python2 + %if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%py3_build %endif # with_python3 -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' - -%build -%{__python2} setup.py build %if 0%{?rhel} && 0%{?rhel} <= 6 -make -C doc html man SPHINXBUILD=sphinx-1.0-build +%make_build -C doc html man SPHINXBUILD=sphinx-1.0-build %else -make -C doc html man +%make_build -C doc html man %endif -rm -f doc/_build/html/.buildinfo - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -make -C doc html man SPHINXBUILD=sphinx-build-%{python3_version} -rm -f doc/_build/html/.buildinfo -popd -%endif # with_python3 +rm doc/_build/html/.buildinfo %install -%{__python2} setup.py install --root %{buildroot} -mkdir -p %{buildroot}%{_mandir}/man1 -chmod -x doc/_build/man/%{realname}.1 -install -p -m 0644 doc/_build/man/%{realname}.1 %{buildroot}%{_mandir}/man1/ +%if 0%{?with_python2} +%py2_install +install -p -D -m 0644 doc/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 +%endif # with_python2 %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests -mkdir -p %{buildroot}%{_mandir}/man1 -chmod -x doc/_build/man/%{realname}.1 -install -p -m 0644 doc/_build/man/%{realname}.1 %{buildroot}%{_mandir}/man1/python3-%{realname}.1 -popd +%py3_install +install -p -D -m 0644 doc/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/python3-%{srcname}.1 %endif # with_python3 %check -export GIT_AUTHOR_EMAIL="foo@example.com" -export GIT_AUTHOR_NAME="Foo Bar" -export GIT_COMMITTER_EMAIL="foo@example.com" -export GIT_COMMITTER_NAME="Foo Bar" -export HGUSER="Foo Bar " +# Some tests REQUIRE Python 2 to use unicode +%if 0%{?rhel} export LANG=en_US.UTF-8 +%else +export LANG=C.UTF-8 +%endif # rhel # Exclude 5 tests which access remote data -# Exclude a test with a bad unicode conversion on python2.6 machines (filed upstream) +# Exclude a test with a bad unicode conversion on python2.6 machines (Github vcstools/vcstools#77) +%if 0%{?with_python2} %if "%{python2_version}" == "2.6" -nosetests --with-coverage --cover-package %{realname} -w test \ +nosetests test \ -e "^(test_git_subm|test_url_matches_with_shortcut|test_checkout|test_checkout_dir_exists|test_checkout_version|test_get_url_by_reading|test_shell_command_verbose)$" %else -nosetests --with-coverage --cover-package %{realname} -w test \ +%{__python2} -m nose test \ -e "^(test_git_subm|test_url_matches_with_shortcut|test_checkout|test_checkout_dir_exists|test_checkout_version|test_get_url_by_reading)$" %endif +%endif # with_python2 %if 0%{?with_python3} -pushd %{py3dir} -nosetests-%{python3_version} --with-coverage --cover-package %{realname} -w test \ +%{__python3} -m nose test \ -e "^(test_git_subm|test_url_matches_with_shortcut|test_checkout|test_checkout_dir_exists|test_checkout_version|test_get_url_by_reading)$" -popd %endif # with_python3 -%files -n python2-%{realname} -%doc doc/_build/html LICENSE -%{python2_sitelib}/%{realname} -%{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info -%{_mandir}/man1/%{realname}.1.gz +%if 0%{?with_python2} +%files -n python2-%{srcname} +%license LICENSE +%doc doc/_build/html +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/ +%{_mandir}/man1/%{srcname}.1.gz +%endif # with_python2 %if 0%{?with_python3} -%files -n python3-%{realname} -%doc doc/_build/html LICENSE -%{python3_sitelib}/%{realname} -%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info -%{_mandir}/man1/python3-%{realname}.1.gz +%files -n python%{python3_pkgversion}-%{srcname} +%license LICENSE +%doc doc/_build/html +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ +%{_mandir}/man1/python3-%{srcname}.1.gz %endif # with_python3 %changelog +* Tue Feb 12 2019 Scott K Logan - 0.1.40-4 +- Move SCM packages from Requires to Recommends +- Drop test coverage from %%check +- Clean up spec file +- Add Python 3 subpackage for EPEL7 + * Sat Feb 02 2019 Fedora Release Engineering - 0.1.40-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 87a83a4..50b8b34 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (vcstools-0.1.40-54418db.tar.gz) = 7c1a94694517cfd7cd910410d5d4a5c438743b237a6dd394789a6d7d911a39648fc0743bdd22bce620f6cc3d9df8b87ac85d23ef3bae7bdd7fa1a9a7e59d43eb +SHA512 (vcstools-0.1.40.tar.gz) = 7cd062f3c72b27f78361d3000ed8951b1723ea7dd99bf05ea711e8a8b93c42c2acebdfd6c7cf7384730c708da11bd0d2712a54e538dd833eafbcef46f23857cd