Blob Blame History Raw
%global srcname osrf_pycommon
%global pkgname osrf-pycommon
%global sum Commonly needed Python modules used by software developed at OSRF

Name:           python-%{pkgname}
Version:        0.1.2
Release:        3%{?dist}
Summary:        %{sum}

Group:          Development/Libraries
# The entire source code is ASL 2.0 except parts of osrf_pycommon/terminal_color/windows.py which is BSD
License:        ASL 2.0 and BSD
URL:            http://osrf-pycommon.readthedocs.org/
Source0:        https://github.com/osrf/%{srcname}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

%description
osrf_pycommon is a python package which contains commonly used Python
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
colored output from programs using sub-process, or even a simple logging system
which provides some nice functionality over the built-in Python logging system.

The functionality provided here should be generic enough to be reused in
arbitrary scenarios and should avoid bringing in dependencies which are not
part of the standard Python library. Where possible Windows and Linux/OS X
should be supported, and where it cannot it should be gracefully degrading.

%package doc
Summary:        API Documentation for the osrf_pycommon Python modules
BuildRequires:  python-sphinx

%description doc
HTML documentation generated from osrf_pycommon sources to be used in
developing software which uses osrf_pycommon.

%package -n python2-%{pkgname}
Summary:        %{sum}
BuildRequires:  python2-devel
BuildRequires:  python-flake8
BuildRequires:  python-mock
BuildRequires:  python-nose
BuildRequires:  python-setuptools
BuildRequires:  python-trollius
Requires:       python-trollius
Recommends:     %{name}-doc
%{?python_provide:%python_provide python2-%{pkgname}}

%description -n python2-%{pkgname}
osrf_pycommon is a python package which contains commonly used Python
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
colored output from programs using sub-process, or even a simple logging system
which provides some nice functionality over the built-in Python logging system.

The functionality provided here should be generic enough to be reused in
arbitrary scenarios and should avoid bringing in dependencies which are not
part of the standard Python library. Where possible Windows and Linux/OS X
should be supported, and where it cannot it should be gracefully degrading.

%package -n python3-%{pkgname}
Summary:        %{sum}
BuildRequires:  python3-devel
BuildRequires:  python3-flake8
BuildRequires:  python3-mock
BuildRequires:  python3-nose
BuildRequires:  python3-setuptools
Recommends:     %{name}-doc
%{?python_provide:%python_provide python3-%{pkgname}}

%description -n python3-%{pkgname}
osrf_pycommon is a python package which contains commonly used Python
boilerplate code and patterns. Things like ANSI terminal coloring, capturing
colored output from programs using sub-process, or even a simple logging system
which provides some nice functionality over the built-in Python logging system.

The functionality provided here should be generic enough to be reused in
arbitrary scenarios and should avoid bringing in dependencies which are not
part of the standard Python library. Where possible Windows and Linux/OS X
should be supported, and where it cannot it should be gracefully degrading.

%prep
%autosetup -n %{srcname}-%{version}

%build
%py2_build
%py3_build

make -C docs html man
rm docs/_build/html/.buildinfo

%install
%py2_install
%py3_install

install -p -m0644 -D docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1
rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/process_utils/async_execute_process_asyncio

%check
PYTHONASYNCIODEBUG=1 nosetests-%{python2_version} -w tests 
PYTHONASYNCIODEBUG=1 nosetests-%{python3_version} -w tests 

%files doc
%doc docs/_build/html
%license LICENSE

%files -n python2-%{pkgname}
%doc CHANGELOG.rst README.md
%license LICENSE
%{_mandir}/man1/%{srcname}.1.gz
%{python2_sitelib}/%{srcname}/
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info/

%files -n python3-%{pkgname}
%doc CHANGELOG.rst README.md
%license LICENSE
%{_mandir}/man1/%{srcname}.1.gz
%{python3_sitelib}/%{srcname}/
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/

%changelog
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.1.2-3
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Apr 18 2016 Scott K Logan <logans@cottsay.net> - 0.1.2-1
- Initial package