-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
%if 0%{?rhel} && 0%{?rhel} <= 7 | ||
%{!?py2_build: %global py2_build %{__python2} setup.py build} | ||
%{!?py2_install: %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot}} | ||
%endif | ||
|
||
%if (0%{?fedora} >= 21 || 0%{?rhel} >= 8) | ||
%global with_python3 1 | ||
%endif | ||
|
||
%define srcname pypureomapi | ||
%define version 0.4 | ||
%define release 1 | ||
%define sum Cygnus Networks GmbH %{srcname} package | ||
|
||
Name: python-%{srcname} | ||
Version: %{version} | ||
Release: %{release}%{?dist} | ||
Summary: %{sum} | ||
License: proprietary | ||
Source0: python-%{srcname}-%{version}.tar.gz | ||
|
||
BuildArch: noarch | ||
BuildRequires: python2-devel, python-setuptools | ||
%if 0%{?with_check} | ||
BuildRequires: pytest | ||
%endif # with_check | ||
Requires: python-setuptools | ||
|
||
%{?python_provide:%python_provide python-%{project}} | ||
|
||
%if 0%{?with_python3} | ||
BuildRequires: python3-devel | ||
BuildRequires: python3-setuptools | ||
%if 0%{?with_check} | ||
BuildRequires: python3-pytest | ||
%endif # with_check | ||
%endif # with_python3 | ||
|
||
%description | ||
%{sum} | ||
|
||
%if 0%{?with_python3} | ||
%package -n python3-%{project} | ||
Summary: %{sum} | ||
%{?python_provide:%python_provide python3-%{project}} | ||
Requires: python3-setuptools | ||
|
||
%description -n python3-%{project} | ||
%{sum} | ||
%endif # with_python3 | ||
|
||
%prep | ||
%setup -q -n python-%{srcname}-%{version} | ||
|
||
%build | ||
%py2_build | ||
|
||
%if 0%{?with_python3} | ||
%py3_build | ||
%endif # with_python3 | ||
|
||
|
||
%install | ||
%py2_install | ||
|
||
%if 0%{?with_python3} | ||
%py3_install | ||
%endif # with_python3 | ||
|
||
%if 0%{?with_check} | ||
%check | ||
LANG=en_US.utf8 py.test-%{python2_version} -vv tests | ||
|
||
%if 0%{?with_python3} | ||
LANG=en_US.utf8 py.test-%{python3_version} -vv tests | ||
%endif # with_python3 | ||
%endif # with_check | ||
|
||
%files | ||
%{python2_sitelib}/%{srcname}.py* | ||
%{python2_sitelib}/%{srcname}-%{version}-py2.*.egg-info | ||
|
||
%if 0%{?with_python3} | ||
%files -n python3-%{project} | ||
%dir %{python3_sitelib}/%{srcname}/__pycache__ | ||
%{python2_sitelib}/%{srcname}.py* | ||
%{python3_sitelib}/%{srcname}-%{version}-py3.*.egg-info | ||
%{python3_sitelib}/%{srcname}/__pycache__/*.py* | ||
%endif # with_python3 |