Blob Blame History Raw
%{!?python3_pkgversion:%global python3_pkgversion 3}

%global module tscli
%global name transtats-cli
%global name_with_underscore transtats_cli
%global sum Transtats command line interface to query transtats server
%global project transtats

Name:           %{name}
Version:        0.2.0
Release:        1%{?dist}
Summary:        %{sum}
License:        ASL 2.0
URL:            https://github.com/%{project}/%{name}
Source0:        https://github.com/%{project}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildArch:      noarch

%description
Transtats command line interface to query transtats server.

%package -n python2-%{name}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-mock
%if 0%{?rhel}
BuildRequires: python-click
BuildRequires: python-requests
BuildRequires: python-six
BuildRequires: python-flake8
BuildRequires: python-tabulate
Requires: python-click
Requires: python-requests
Requires: python-six
Requires: python-tabulate
%else
BuildRequires: python2-click
BuildRequires: python2-requests
BuildRequires: python2-six
BuildRequires: python2-flake8
BuildRequires: python2-tabulate
Requires: python2-click
Requires: python2-requests
Requires: python2-six
Requires: python2-tabulate
%endif
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{name}}

%description -n python2-%{name}
Transtats command line interface to query transtats server.

%if 0%{?fedora}
%package -n python3-%{name}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-click
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-mock
BuildRequires: python%{python3_pkgversion}-six
BuildRequires: python%{python3_pkgversion}-flake8
BuildRequires: python%{python3_pkgversion}-tabulate
Requires: python%{python3_pkgversion}-click
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-tabulate
Summary:        %{sum}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}

%description -n python3-%{name}
Transtats command line interface to query transtats server.
%endif


%prep
%autosetup -n %{name}-%{version}
rm -rf *.egg-info

%build
%py2_build
%if 0%{?fedora}
%py3_build
%endif

%install
%py2_install
rm -fr %{buildroot}%{python2_sitelib}/tests
%if 0%{?fedora}
%py3_install
rm -fr %{buildroot}%{python3_sitelib}/tests
%endif


%check
%{__python2} setup.py flake8 test
%if 0%{?fedora}
%{__python3} setup.py flake8 test
%endif

%files -n python2-%{name}
%doc README.md transtats.conf
%license LICENSE
%if !0%{?fedora}
%{_bindir}/%{project}
%endif
%{python2_sitelib}/%{module}
%{python2_sitelib}/%{name_with_underscore}-%{version}-py?.?.egg-info
%{_mandir}/man1/transtats.1.gz
%{_datadir}/bash-completion/completions/transtats.bash

%if 0%{?fedora}
%files -n python3-%{name}
%doc README.md transtats.conf
%license LICENSE
%{_bindir}/%{project}
%{python3_sitelib}/%{module}
%{python3_sitelib}/%{name_with_underscore}-%{version}-py?.?.egg-info
%{_mandir}/man1/transtats.1.gz
%{_datadir}/bash-completion/completions/transtats.bash
%endif

%changelog
* Sat Aug 04 2018 Parag Nemade <pnemade AT redhat DOT com> - 0.2.0-1
- Update to 0.2.0 version

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 0.1.2-2
- Rebuilt for Python 3.7

* Wed Feb 28 2018 Sundeep Anand <suanand AT redhat DOT com> - 0.1.2-1
- Update transtats-cli to version 0.1.2, update 

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 30 2018 Jan Beran <jberan@redhat.com> - 0.1.1-4
- Fix of python3-transtats-cli requires both Python 2 and Python 3 (rhbz#1531568)

* Wed Nov 15 2017 Sundeep Anand <suanand AT redhat DOT com> - 0.1.1-3
- Update transtats-cli to version 0.1.1, update endpoints

* Wed Oct 11 2017 Iryna Shcherbina <ishcherb@redhat.com> - 0.1.0-4
- Fix Python 3 dependency from python2-transtats-cli
Resolves: rhbz#1495860

* Wed Sep 13 2017 Sundeep Anand <suanand AT redhat DOT com> - 0.1.0-3
- Add man page to transtats-cli

* Tue Sep 12 2017 Sundeep Anand <suanand AT redhat DOT com> - 0.1.0-2
- Update Spec file for py2 and py3

* Thu Sep 07 2017 Sundeep Anand <suanand AT redhat DOT com> - 0.1.0-1
- Initial RPM Packaging