Notification time stamped 2023-05-31 16:59:53 UTC
From fc5b3cac06827995bdc14f85e4788cf225d1b032 Mon Sep 17 00:00:00 2001
From: Alan Pevec <alan.pevec(a)redhat.com>
Date: Oct 30 2017 18:43:49 +0000
Subject: Add py3 guards
---
diff --git a/python-croniter.spec b/python-croniter.spec
index ef77bed..a828634 100644
--- a/python-croniter.spec
+++ b/python-croniter.spec
@@ -1,6 +1,10 @@
# Created by pyp2rpm-3.2.3
%global pypi_name croniter
+%if 0%{?fedora}
+%global with_python3 1
+%endif
+
Name: python-%{pypi_name}
Version: 0.3.19
Release: 1%{?dist}
@@ -14,8 +18,10 @@ BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
+%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
+%endif
%description
croniter provides iteration for the datetime object with a cron like format.
@@ -28,6 +34,7 @@ Requires: python2-dateutil
%description -n python2-%{pypi_name}
croniter provides iteration for the datetime object with a cron like format.
+%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
@@ -35,6 +42,7 @@ Summary: %{summary}
Requires: python3-dateutil
%description -n python3-%{pypi_name}
croniter provides iteration for the datetime object with a cron like format.
+%endif
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
@@ -47,12 +55,16 @@ find -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}'
{} +
%build
%py2_build
+%if 0%{?with_python3}
%py3_build
+%endif
%install
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install.
+%if 0%{?with_python3}
%py3_install
+%endif
%py2_install
@@ -63,12 +75,14 @@ find -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}'
{} +
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license docs/LICENSE
%doc README.rst
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%endif
%changelog
* Sat Oct 21 2017 Thomas Andrejak <thomas.andrejak(a)c-s.fr> - 0.3.19-1
https://src.fedoraproject.org/rpms/python-croniter/c/fc5b3cac06827995bdc1...