%?python_enable_dependency_generator
# FIXME unmet dependencies in epel
%if 0%{?fedora}
%global with_tests 1
%endif
%if 0%{?rhel}
%global with_python3_other 1
#%%global with_tests_other 1
%endif
%global srcname slacker
%global _summary Slack API client
Name: python-%{srcname}
Version: 0.12.0
Release: 2%{?dist}
Summary: %_summary
License: ASL 2.0
URL: https://github.com/os/%{srcname}
Source0: %{url}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
BuildArch: noarch
%global _description \
Slacker is a full-featured Python interface for the Slack API.
%description
%_description
%package -n python%{python3_pkgversion}-%{srcname}
Summary: %_summary
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-requests
%if 0%{?with_tests}
BuildRequires: python%{python3_pkgversion}-tox
BuildRequires: python%{python3_pkgversion}-mock
%endif
# runtime
Requires: python%{python3_pkgversion}-requests
%description -n python%{python3_pkgversion}-%{srcname}
%_description
This package is for Python version %{python3_version}.
%if 0%{?with_python3_other}
%package -n python%{python3_other_pkgversion}-%{srcname}
Summary: %_summary
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
BuildRequires: python%{python3_other_pkgversion}-devel
BuildRequires: python%{python3_other_pkgversion}-requests
BuildRequires: python%{python3_other_pkgversion}-setuptools
# FIXME unmet dependencies
%if 0%{?with_tests_other}
BuildRequires: python%{python3_other_pkgversion}-tox
BuildRequires: python%{python3_other_pkgversion}-mock
%endif
# runtime
Requires: python%{python3_other_pkgversion}-requests
%description -n python%{python3_other_pkgversion}-%{srcname}
%_description
This package is for Python version %{python3_other_version}.
%endif
%package doc
Summary: Documentation files for %{name}
BuildArch: noarch
%description doc
%{summary}.
%prep
%autosetup -n%{srcname}-%{version}
# drop useless shebang
sed -i 1s:\#\!.*:\#: %{srcname}/utils.py
%build
%py3_build
%{?with_python3_other: %py3_other_build}
%install
%{?with_python3_other: %py3_other_install}
%py3_install
%check
%{?with_tests: %{__python3} setup.py test}
%{?with_tests_other: %{__python3_other} setup.py test}
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{srcname}/
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
%if 0%{?with_python3_other}
%files -n python%{python3_other_pkgversion}-%{srcname}
%license LICENSE
%doc README.rst
%{python3_other_sitelib}/%{srcname}/
%{python3_other_sitelib}/%{srcname}-%{version}-py?.?.egg-info/
%endif
%files doc
%license LICENSE
%doc examples/
%doc tests/
%changelog
* Tue Dec 18 2018 Raphael Groner <projects.rg@smart.ms> - 0.12.0-2
- drop useless shebang
- add explicitly runtime dependency
* Sat Dec 15 2018 Raphael Groner <projects.rg@smart.ms> - 0.12.0-1
- new version
- prepare to support second python version for epel
- fix execution of tests if supported with all needed dependencies
- add documentation
* Fri Nov 2 2018 Raphael Groner <projects.rg@smart.ms> - 0.9.65-1
- initial