Reitroduce python2 support for Fedora 29

This commit is contained in:
Vojtech Trefny 2018-07-09 13:21:59 +02:00
parent cdc0d3f311
commit 188a34e8e6
2 changed files with 32 additions and 3 deletions

23
0001-python2-build.patch Normal file
View File

@ -0,0 +1,23 @@
From a4f19b8aecb57f3cee5de4bdc463bf01f6493def Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Mon, 9 Jul 2018 14:02:00 +0200
Subject: [PATCH] Use versioned command for Python 2
---
src/python/gi/overrides/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python/gi/overrides/Makefile.am b/src/python/gi/overrides/Makefile.am
index be3307c..befa43a 100644
--- a/src/python/gi/overrides/Makefile.am
+++ b/src/python/gi/overrides/Makefile.am
@@ -1,5 +1,5 @@
if WITH_PYTHON2
-pylibdir = $(shell python -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
+pylibdir = $(shell python2 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
overridesdir = $(pylibdir)/gi/overrides
dist_overrides_DATA = BlockDev.py
--
1.8.3.1

View File

@ -20,8 +20,8 @@
%define with_escrow 1 %define with_escrow 1
%define with_dmraid 1 %define with_dmraid 1
# python2 is not available on RHEL > 7 and not needed on Fedora > 28 # python2 is not available on RHEL > 7 and not needed on Fedora > 29
%if 0%{?rhel} > 7 || 0%{?fedora} > 28 || %{with_python2} == 0 %if 0%{?rhel} > 7 || 0%{?fedora} > 29 || %{with_python2} == 0
%define with_python2 0 %define with_python2 0
%define python2_copts --without-python2 %define python2_copts --without-python2
%endif %endif
@ -108,11 +108,12 @@
Name: libblockdev Name: libblockdev
Version: 2.18 Version: 2.18
Release: 2%{?dist} Release: 3%{?dist}
Summary: A library for low-level manipulation with block devices Summary: A library for low-level manipulation with block devices
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/storaged-project/libblockdev URL: https://github.com/storaged-project/libblockdev
Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
Patch0: 0001-python2-build.patch
BuildRequires: glib2-devel BuildRequires: glib2-devel
%if %{with_gi} %if %{with_gi}
@ -634,8 +635,10 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
%patch0 -p1
%build %build
autoreconf -ivf
%configure %{?configure_opts} %configure %{?configure_opts}
%{__make} %{?_smp_mflags} %{__make} %{?_smp_mflags}
@ -931,6 +934,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%files plugins-all %files plugins-all
%changelog %changelog
* Mon Jul 09 2018 Vojtech Trefny <vtrefny@redhat.com> - 2.18-3
- Reitroduce python2 support for Fedora 29
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.18-2 * Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.18-2
- Rebuilt for Python 3.7 - Rebuilt for Python 3.7