fdc8cf2
%global srcname osrf_pycommon
fdc8cf2
%global pkgname osrf-pycommon
fdc8cf2
%global sum Commonly needed Python modules used by software developed at OSRF
fdc8cf2
fdc8cf2
Name:           python-%{pkgname}
fdc8cf2
Version:        0.1.2
fdc8cf2
Release:        1%{?dist}
fdc8cf2
Summary:        %{sum}
fdc8cf2
fdc8cf2
Group:          Development/Libraries
fdc8cf2
# The entire source code is ASL 2.0 except parts of osrf_pycommon/terminal_color/windows.py which is BSD
fdc8cf2
License:        ASL 2.0 and BSD
fdc8cf2
URL:            http://osrf-pycommon.readthedocs.org/
fdc8cf2
Source0:        https://github.com/osrf/%{srcname}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
fdc8cf2
fdc8cf2
BuildArch:      noarch
fdc8cf2
fdc8cf2
%description
fdc8cf2
osrf_pycommon is a python package which contains commonly used Python
fdc8cf2
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
fdc8cf2
colored output from programs using sub-process, or even a simple logging system
fdc8cf2
which provides some nice functionality over the built-in Python logging system.
fdc8cf2
fdc8cf2
The functionality provided here should be generic enough to be reused in
fdc8cf2
arbitrary scenarios and should avoid bringing in dependencies which are not
fdc8cf2
part of the standard Python library. Where possible Windows and Linux/OS X
fdc8cf2
should be supported, and where it cannot it should be gracefully degrading.
fdc8cf2
fdc8cf2
%package doc
fdc8cf2
Summary:        API Documentation for the osrf_pycommon Python modules
fdc8cf2
BuildRequires:  python-sphinx
fdc8cf2
fdc8cf2
%description doc
fdc8cf2
HTML documentation generated from osrf_pycommon sources to be used in
fdc8cf2
developing software which uses osrf_pycommon.
fdc8cf2
fdc8cf2
%package -n python2-%{pkgname}
fdc8cf2
Summary:        %{sum}
fdc8cf2
BuildRequires:  python2-devel
fdc8cf2
BuildRequires:  python-flake8
fdc8cf2
BuildRequires:  python-mock
fdc8cf2
BuildRequires:  python-nose
fdc8cf2
BuildRequires:  python-setuptools
fdc8cf2
BuildRequires:  python-trollius
fdc8cf2
Requires:       python-trollius
fdc8cf2
Recommends:     %{name}-doc
fdc8cf2
%{?python_provide:%python_provide python2-%{pkgname}}
fdc8cf2
fdc8cf2
%description -n python2-%{pkgname}
fdc8cf2
osrf_pycommon is a python package which contains commonly used Python
fdc8cf2
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
fdc8cf2
colored output from programs using sub-process, or even a simple logging system
fdc8cf2
which provides some nice functionality over the built-in Python logging system.
fdc8cf2
fdc8cf2
The functionality provided here should be generic enough to be reused in
fdc8cf2
arbitrary scenarios and should avoid bringing in dependencies which are not
fdc8cf2
part of the standard Python library. Where possible Windows and Linux/OS X
fdc8cf2
should be supported, and where it cannot it should be gracefully degrading.
fdc8cf2
fdc8cf2
%package -n python3-%{pkgname}
fdc8cf2
Summary:        %{sum}
fdc8cf2
BuildRequires:  python3-devel
fdc8cf2
BuildRequires:  python3-flake8
fdc8cf2
BuildRequires:  python3-mock
fdc8cf2
BuildRequires:  python3-nose
fdc8cf2
BuildRequires:  python3-setuptools
fdc8cf2
Recommends:     %{name}-doc
fdc8cf2
%{?python_provide:%python_provide python3-%{pkgname}}
fdc8cf2
fdc8cf2
%description -n python3-%{pkgname}
fdc8cf2
osrf_pycommon is a python package which contains commonly used Python
fdc8cf2
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
fdc8cf2
colored output from programs using sub-process, or even a simple logging system
fdc8cf2
which provides some nice functionality over the built-in Python logging system.
fdc8cf2
fdc8cf2
The functionality provided here should be generic enough to be reused in
fdc8cf2
arbitrary scenarios and should avoid bringing in dependencies which are not
fdc8cf2
part of the standard Python library. Where possible Windows and Linux/OS X
fdc8cf2
should be supported, and where it cannot it should be gracefully degrading.
fdc8cf2
fdc8cf2
%prep
fdc8cf2
%autosetup -n %{srcname}-%{version}
fdc8cf2
fdc8cf2
%build
fdc8cf2
%py2_build
fdc8cf2
%py3_build
fdc8cf2
fdc8cf2
make -C docs html man
fdc8cf2
rm docs/_build/html/.buildinfo
fdc8cf2
fdc8cf2
%install
fdc8cf2
%py2_install
fdc8cf2
%py3_install
fdc8cf2
fdc8cf2
install -p -m0644 -D docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1
fdc8cf2
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/process_utils/async_execute_process_asyncio
fdc8cf2
fdc8cf2
%check
fdc8cf2
PYTHONASYNCIODEBUG=1 nosetests-%{python2_version} -w tests 
fdc8cf2
PYTHONASYNCIODEBUG=1 nosetests-%{python3_version} -w tests 
fdc8cf2
fdc8cf2
%files doc
fdc8cf2
%doc docs/_build/html
fdc8cf2
%license LICENSE
fdc8cf2
fdc8cf2
%files -n python2-%{pkgname}
fdc8cf2
%doc CHANGELOG.rst README.md
fdc8cf2
%license LICENSE
fdc8cf2
%{_mandir}/man1/%{srcname}.1.gz
fdc8cf2
%{python2_sitelib}/%{srcname}/
fdc8cf2
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
fdc8cf2
fdc8cf2
%files -n python3-%{pkgname}
fdc8cf2
%doc CHANGELOG.rst README.md
fdc8cf2
%license LICENSE
fdc8cf2
%{_mandir}/man1/%{srcname}.1.gz
fdc8cf2
%{python3_sitelib}/%{srcname}/
fdc8cf2
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
fdc8cf2
fdc8cf2
%changelog
fdc8cf2
* Mon Apr 18 2016 Scott K Logan <logans@cottsay.net> - 0.1.2-1
fdc8cf2
- Initial package