From 188a34e8e688dec939bfa6fbc1489d2083270df0 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Mon, 9 Jul 2018 13:21:59 +0200 Subject: [PATCH] Reitroduce python2 support for Fedora 29 --- 0001-python2-build.patch | 23 +++++++++++++++++++++++ libblockdev.spec | 12 +++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 0001-python2-build.patch diff --git a/0001-python2-build.patch b/0001-python2-build.patch new file mode 100644 index 0000000..0f17870 --- /dev/null +++ b/0001-python2-build.patch @@ -0,0 +1,23 @@ +From a4f19b8aecb57f3cee5de4bdc463bf01f6493def Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +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 + diff --git a/libblockdev.spec b/libblockdev.spec index 0d74237..aea1e4c 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -20,8 +20,8 @@ %define with_escrow 1 %define with_dmraid 1 -# python2 is not available on RHEL > 7 and not needed on Fedora > 28 -%if 0%{?rhel} > 7 || 0%{?fedora} > 28 || %{with_python2} == 0 +# python2 is not available on RHEL > 7 and not needed on Fedora > 29 +%if 0%{?rhel} > 7 || 0%{?fedora} > 29 || %{with_python2} == 0 %define with_python2 0 %define python2_copts --without-python2 %endif @@ -108,11 +108,12 @@ Name: libblockdev Version: 2.18 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ URL: https://github.com/storaged-project/libblockdev Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz +Patch0: 0001-python2-build.patch BuildRequires: glib2-devel %if %{with_gi} @@ -634,8 +635,10 @@ A meta-package that pulls all the libblockdev plugins as dependencies. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build +autoreconf -ivf %configure %{?configure_opts} %{__make} %{?_smp_mflags} @@ -931,6 +934,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %files plugins-all %changelog +* Mon Jul 09 2018 Vojtech Trefny - 2.18-3 +- Reitroduce python2 support for Fedora 29 + * Mon Jul 02 2018 Miro HronĨok - 2.18-2 - Rebuilt for Python 3.7