Blob Blame History Raw
%global srcname astral

Name:           python-%{srcname}
Version:        1.3.3
Release:        1%{?dist}
Summary:        Calculations for the position of the sun and moon

License:        ASL 2.0
URL:            http://astral.readthedocs.io
Source0:        https://files.pythonhosted.org/packages/source/a/%{srcname}/%{srcname}-%{version}.zip
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python3-devel
BuildRequires:  pytz
BuildRequires:  python3-pytz
BuildRequires:  python2-pytest
BuildRequires:  python3-pytest

%description
astral is a Python module which calculates including:

- Times for various positions of the sun: dawn, sunrise, solar noon,
  sunset, dusk, solar elevation, solar azimuth and rahukaalam.
- The phase of the moon.

%package -n python2-%{srcname}
Summary:        %{summary}
Requires:       pytz
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
astral is a Python module which calculates including:

- Times for various positions of the sun: dawn, sunrise, solar noon,
  sunset, dusk, solar elevation, solar azimuth and rahukaalam.
- The phase of the moon.

%package -n python3-%{srcname}
Summary:        %{summary}
Requires:       python3-pytz
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
astral is a Python module which calculates including:

- Times for various positions of the sun: dawn, sunrise, solar noon,
  sunset, dusk, solar elevation, solar azimuth and rahukaalam.
- The phase of the moon.

%prep
%autosetup -n %{srcname}-%{version}
sed -i "s|\r||g" README

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

%check
pushd src/test
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -m "not webtest"
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -m "not webtest and not py2only"
popd

%files -n python2-%{srcname}
%doc README
%license LICENSE
%{python2_sitelib}/%{srcname}.py*
%{python2_sitelib}/%{srcname}*.egg-info

%files -n python3-%{srcname}
%doc README
%license LICENSE
%{python3_sitelib}/%{srcname}.py*
%{python3_sitelib}/%{srcname}*.egg-info
%{python3_sitelib}/__pycache__/*

%changelog
* Sat Jan 21 2017 Fabian Affolter <mail@fabian-affolter.ch> - 1.3.3-1
- Update to latest upstream release 1.3.3

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

* Mon Nov 21 2016 Fabian Affolter <mail@fabian-affolter.ch> - 1.3.2-2
- Add license to py2 as well
- Update variable

* Mon Nov 21 2016 Fabian Affolter <mail@fabian-affolter.ch> - 1.3.2-1
- Add license file
- Run test without third party interaction
- Update to latest upstream release 1.3.2

* Mon Nov 14 2016 Fabian Affolter <mail@fabian-affolter.ch> - 2.7.0-1
- Initial version