Blob Blame Raw
# For release builds set to 1, for snapshots set to 0
%global relbuild 1 

%if !0%{?relbuild}
%global commit 3fa56a6406ddd7aee0e735aa5ba8b02d11a48780
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global gitdate 20170411
%global git_ver -git%{gitdate}.%{shortcommit}
%global git_rel .git%{gitdate}.%{shortcommit}
%endif # !0%%{?relbuild}

%global srcname pyvo

%global sum Access to remote data and services of the Virtual observatory (VO) using Python
%global desc                                                             \
PyVO is a package providing access to remote data and services of the    \
Virtual Observatory (VO) using Python.                                   \
                                                                         \
The pyvo module currently provides these main capabilities:              \
* Find archives that provide particular data of a particular type and/or \
  relates to a particular topic                                          \
* Search an archive for datasets of a particular type                    \
* Do simple searches on catalogs or databases                            \
* Get information about an object via its name                   

Name:           python-%{srcname}
Version:        0.6.1
Release:        1%{?dist}
Summary:        %{sum}

License:        BSD
URL:            https://github.com/pyvirtobs/%{srcname}
%if 0%{?relbuild}
Source0:        %{url}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
%else  # 0%%{?relbuild}
Source0:        %{url}/archive/%{commit}.tar.gz#/%{srcname}-%{version}%{?git_ver}.tar.gz
%endif # 0%%{?relbuild}
Patch0:         python-pyvo-removes-python-scripts.patch

BuildArch:      noarch
BuildRequires:  python2-astropy
BuildRequires:  python2-astropy-helpers
BuildRequires:  python2-dateutil
BuildRequires:  python2-devel
BuildRequires:  python2-requests
BuildRequires:  python2-six

BuildRequires:  python3-astropy
BuildRequires:  python3-astropy-helpers
BuildRequires:  python3-dateutil
BuildRequires:  python3-devel
BuildRequires:  python3-requests
BuildRequires:  python3-six
# Needed to generate docs
BuildRequires:  python3-numpydoc
BuildRequires:  python3-sphinx

%description
%{desc}

%package -n python2-%{srcname}
Summary:        %{sum}
Requires:       astropy-tools
Requires:       python2-astropy
Requires:       python2-dateutil
Requires:       python2-requests
Requires:       python2-six
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
%{desc}

%package -n python3-%{srcname}
Summary:        %{sum}
Requires:       astropy-tools
Requires:       python3-astropy
Requires:       python3-dateutil
Requires:       python3-requests
Requires:       python3-six
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
%{desc}

%package -n python3-%{srcname}-doc
Summary:        Documentation for PyVO
%{?python_provide:%python_provide python3-%{srcname}-doc}

%description -n python3-%{srcname}-doc
This package contains the HTML documentation for the PyVO package.


%prep
%if 0%{?relbuild}
%autosetup -n %{srcname}-%{version} -p 1
%else  # 0%%{?relbuild}
%autosetup -n %{srcname}-%{commit} -p 1
%endif # 0%%{?relbuild}


%build
%py2_build
%py3_build
# Generate documentation
%{__python3} setup.py build_sphinx
rm -f docs/_build/html/.buildinfo

%install
%py2_install
%py3_install

%files -n python2-%{srcname}
%license licenses/LICENSE.rst
%doc CHANGES.rst CONTRIBUTORS.rst README.rst
%{python2_sitelib}/*

%files -n python3-%{srcname}
%license licenses/LICENSE.rst
%doc CHANGES.rst CONTRIBUTORS.rst README.rst
%{python3_sitelib}/*

%files -n python3-%{srcname}-doc
%license licenses/LICENSE.rst
%doc docs/_build/html

%changelog
* Thu Jun 29 2017 Christian Dersch <lupinix@mailbox.org> - 0.6.1-1
- new version

* Tue Apr 11 2017 Christian Dersch <lupinix@mailbox.org> - 0.6.0-1.git20170411.3fa56a6
- new version

* Thu Feb 09 2017 Christian Dersch <lupinix@mailbox.org> - 0.5.2-1
- new version

* Tue Jan 17 2017 Christian Dersch <lupinix@mailbox.org> - 0.5.0.1-1
- new version

* Mon Jan 16 2017 Christian Dersch <lupinix@mailbox.org> - 0.5.0-1
- new version

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.4.1-3.20161020git823b14a
- Rebuild for Python 3.6

* Sun Dec 04 2016 Christian Dersch <lupinix@mailbox.org> - 0.4.1-2.20161020git823b14a
- Added -doc subpackage
- Added missing requirement for requests

* Mon Oct 31 2016 Christian Dersch <lupinix@mailbox.org> - 0.4.1-1
- new version

* Wed Oct  5 2016 Christian Dersch <lupinix@mailbox.org> - 0.0-0.1.2016100570090d6
- Initial package