From 7c4397e1f82ef730ffb32e6d1ea5f0894fadfc2e3680202f314d530d1c28ae7b Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 8 Aug 2022 14:06:17 +0000 Subject: [PATCH 1/2] Accepting request 992721 from home:dirkmueller:Factory - build against python3.6 for SLE12 and older OBS-URL: https://build.opensuse.org/request/show/992721 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/osc?expand=0&rev=368 --- osc.changes | 5 +++++ osc.spec | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/osc.changes b/osc.changes index e8519fb..bd2eb93 100644 --- a/osc.changes +++ b/osc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 4 08:31:49 UTC 2022 - Dirk Müller + +- build against python3.6 for SLE12 and older + ------------------------------------------------------------------- Tue Jul 26 19:37:46 UTC 2022 - Daniel Mach diff --git a/osc.spec b/osc.spec index bb5be1e..3e6824b 100644 --- a/osc.spec +++ b/osc.spec @@ -16,13 +16,19 @@ # -%if 0%{?suse_version} >= 1500 || 0%{?fedora} >= 29 || 0%{?rhel} >= 7 || 0%{?mageia} >= 8 +%if 0%{?suse_version} >= 1315 || 0%{?fedora} >= 29 || 0%{?rhel} >= 7 || 0%{?mageia} >= 8 %bcond_without python3 %else %bcond_with python3 %endif %if %{with python3} +%if 0%{?suse_version} >= 1500 %define use_python python3 +%define use_pythonpkg python3 +%else +%define use_python python3.6 +%define use_pythonpkg python36 +%endif %else %define use_python python %endif @@ -46,16 +52,16 @@ Source1: debian.dirs Source2: debian.docs Source3: debian.osc.links BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: %{use_python}-devel -BuildRequires: %{use_python}-setuptools +BuildRequires: %{use_pythonpkg}-devel +BuildRequires: %{use_pythonpkg}-setuptools BuildRequires: diffstat %if 0%{?mandriva_version} || 0%{?mageia} BuildRequires: python-rpm Requires: python-rpm %else %if 0%{?suse_version} >= 1500 || 0%{?fedora} >= 32 || 0%{?rhel} >= 7 -BuildRequires: %{use_python}-rpm -Requires: %{use_python}-rpm +BuildRequires: %{use_pythonpkg}-rpm +Requires: %{use_pythonpkg}-rpm %else BuildRequires: rpm-python Requires: rpm-python @@ -65,10 +71,10 @@ Requires: rpm-python BuildArch: noarch %endif %if 0%{?suse_version} -Requires: %{use_python} -Recommends: %{use_python}-progressbar -BuildRequires: %{use_python}-xml -Requires: %{use_python}-xml +Requires: %{use_pythonpkg} +Recommends: %{use_pythonpkg}-progressbar +BuildRequires: %{use_pythonpkg}-xml +Requires: %{use_pythonpkg}-xml %if !%{with python3} && 0%{?suse_version} < 1020 BuildRequires: python-elementtree Requires: python-elementtree From 6cea7d1951b9dddaaff5200a78c82626569855689e3325debcee2260218860b1 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 11 Aug 2022 12:58:08 +0000 Subject: [PATCH 2/2] Accepting request 994527 from home:dmach:branches:openSUSE:Tools - fix building on distros that are not openSUSE or SLE OBS-URL: https://build.opensuse.org/request/show/994527 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/osc?expand=0&rev=369 --- osc.changes | 5 +++++ osc.spec | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/osc.changes b/osc.changes index bd2eb93..de91e48 100644 --- a/osc.changes +++ b/osc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 11 11:38:19 UTC 2022 - Daniel Mach + +- fix building on distros that are not openSUSE or SLE + ------------------------------------------------------------------- Thu Aug 4 08:31:49 UTC 2022 - Dirk Müller diff --git a/osc.spec b/osc.spec index 3e6824b..ba78d69 100644 --- a/osc.spec +++ b/osc.spec @@ -21,16 +21,20 @@ %else %bcond_with python3 %endif + %if %{with python3} -%if 0%{?suse_version} >= 1500 + %define use_python python3 %define use_pythonpkg python3 -%else +%if 0%{?suse_version} && 0%{?suse_version} < 1500 %define use_python python3.6 %define use_pythonpkg python36 %endif + +# else if with python3 %else %define use_python python +%define use_pythonpkg python %endif %define version_unconverted 0.181.0