File: python-pysolar.spec

package info (click to toggle)
pysolar 0.10%2Brepack-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,804 kB
  • sloc: python: 2,774; makefile: 146
file content (117 lines) | stat: -rw-r--r-- 2,709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# what it's called on pypi
%global srcname Pysolar
# what it's imported asn
%global libname pysolar
# name of egg info directory
%global eggname pysolar
# package name fragment
%global pkgname pysolar

%if %{defined rhel} || (%{defined fedora} && 0%{?fedora} < 30)
%bcond_without python2
%endif
%bcond_without python3

Name:           python-%{pkgname}
Version:        0.8
Release:        1%{?dist}
Summary:        Python library to perform solar calculations
License:        LGPLv3+
URL:            http://pysolar.org/
Source0:        https://github.com/pingswept/pysolar/archive/0.8.tar.gz
BuildArch:      noarch

%global _description \
Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.

%description %{_description}

%if %{with python2}
%package -n     python2-%{pkgname}
Summary:        %{summary}
BuildRequires:  make
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-sphinx
Provides:       python-%{srcname} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{pkgname}}

%description -n python2-%{pkgname} %{_description}
%endif

%if %{with python3}
%package -n     python%{python3_pkgversion}-%{pkgname}
Summary:        %{summary}
BuildRequires:  make
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-sphinx
Provides:       python%{python3_pkgversion}-%{srcname} = %{version}-%{release}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}

%description -n python%{python3_pkgversion}-%{pkgname} %{_description}
%endif

%prep
%autosetup -p 1 -n %{pkgname}-%{version}

%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%if %{with python2}
%py2_build
%endif

%if %{with python3}
pushd %{py3dir}
%py3_build
popd
%endif

make -C doc html

%install
%if %{with python2}
%py2_install
%endif

%if %{with python3}
pushd %{py3dir}
%py3_install
popd
%endif

%check
%if %{with python2}
%{__python2} setup.py test
%endif

%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif

%if %{with python2}
%files -n python2-%{pkgname}
%license COPYING
%doc doc/_build/html
%{python2_sitelib}/%{libname}
%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info
%endif

%if %{with python3}
%files -n python%{python3_pkgversion}-%{pkgname}
%license COPYING
%doc doc/_build/html
%{python3_sitelib}/%{libname}
%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info
%endif

%changelog
* Mon Sep 16 2019 Elliot Lee <sopwith@gmail.com> - 0.8-1
- Initial version