From 29b7913d47cb3561ea23d39e146e1ec02be5c87fad300e03bce9791305b13170 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 10 Oct 2022 12:25:00 +0000 Subject: [PATCH 1/2] Small SPEC cleanups OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dmidecode?expand=0&rev=17 --- python-dmidecode.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-dmidecode.spec b/python-dmidecode.spec index 89d5291..a3c6a94 100644 --- a/python-dmidecode.spec +++ b/python-dmidecode.spec @@ -38,8 +38,8 @@ Patch2: detect-lib-with-py3.patch # PATCH-FIX-UPSTREAM 31-version_info-v-version.patch gh#nima/python-dmidecode#31 mcepl@suse.com # use sys.version_info instead of sys.version Patch3: 31-version_info-v-version.patch -Obsoletes: %{oldpython}-dmidecode <= 3.12.2+git.1625035095.f0a089a -Obsoletes: python-python-dmidecode <= 3.12.2+git.1625035095.f0a089a +Obsoletes: %{oldpython}-dmidecode <= %{version} +Obsoletes: python-python-dmidecode <= %{version} BuildRequires: %{python_module devel} %if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1550 BuildRequires: %{python_module libxml2} @@ -107,7 +107,7 @@ fi %ghost %{_sysconfdir}/alternatives/pymap.xml %ghost %{_datadir}/python-dmidecode/pymap.xml %{_datadir}/python-dmidecode/pymap-%{python_bin_suffix}.xml -# %{python_sitearch}/python_dmidecode-%{version}*-info +# %%{python_sitearch}/python_dmidecode-%%{version}*-info %{python_sitearch}/python_dmidecode-3.12.2*-info %{python_sitearch}/dmidecode* %pycache_only %{python_sitearch}/__pycache__/dmidecode*.py[co] From 1b62766a1910f358225f2d3a1b56cb5924ecac310ddacc38e56baeeb0454ec65 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 17 Oct 2022 18:06:25 +0000 Subject: [PATCH 2/2] - Add Makefile_libdir.patch to make package building even with faulty distutils.sysconfig (bsc#1204395). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dmidecode?expand=0&rev=18 --- Makefile_libdir.patch | 44 ++++++++++++++++++++++++++++++++++++++++ python-dmidecode.changes | 6 ++++++ python-dmidecode.spec | 3 +++ 3 files changed, 53 insertions(+) create mode 100644 Makefile_libdir.patch diff --git a/Makefile_libdir.patch b/Makefile_libdir.patch new file mode 100644 index 0000000..03f7ee1 --- /dev/null +++ b/Makefile_libdir.patch @@ -0,0 +1,44 @@ +--- + Makefile | 3 ++- + src/setup_common.py | 9 ++------- + 2 files changed, 4 insertions(+), 8 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -42,9 +42,10 @@ PY_BIN := python3 + VERSION := $(shell cd src;$(PY_BIN) -c "from setup_common import *; print(get_version());") + PACKAGE := python-dmidecode + PY_VER := $(shell $(PY_BIN) -c 'import sys; print("%d.%d"%sys.version_info[0:2])') ++PY_VER_DL := $(shell echo $(PY_VER) | tr -d '.') + PY_MV := $(shell echo $(PY_VER) | cut -b 1) + PY := python$(PY_VER) +-SO_PATH := build/lib.linux-$(shell uname -m)-$(PY_VER) ++SO_PATH := build/lib.linux-$(shell uname -m)-cpython-$(PY_VER_DL) + ifeq ($(PY_MV),2) + SO := $(SO_PATH)/dmidecodemod.so + else +--- a/src/setup_common.py ++++ b/src/setup_common.py +@@ -30,12 +30,7 @@ import subprocess, sys + if sys.version_info[0] < 3: + import commands as subprocess + from os import path as os_path +-try: +- from distutils.sysconfig import get_python_lib, get_config_var +- __python_lib = get_python_lib(1) +-except ImportError: +- from sysconfig import get_config_var, get_path +- __python_lib = get_path('platlib') ++from sysconfig import get_config_var, get_path + + # libxml2 - C flags + def libxml2_include(incdir): +@@ -55,7 +50,7 @@ def libxml2_include(incdir): + + # libxml2 - library flags + def libxml2_lib(libdir, libs): +- libdir.append(__python_lib) ++ libdir.append(get_path('platlib')) + if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround... + libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2]) + diff --git a/python-dmidecode.changes b/python-dmidecode.changes index 8718175..7a8b6e2 100644 --- a/python-dmidecode.changes +++ b/python-dmidecode.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Oct 17 18:05:41 UTC 2022 - Matej Cepl + +- Add Makefile_libdir.patch to make package building even with + faulty distutils.sysconfig (bsc#1204395). + ------------------------------------------------------------------- Fri May 20 15:07:23 UTC 2022 - Matej Cepl diff --git a/python-dmidecode.spec b/python-dmidecode.spec index a3c6a94..e8eb010 100644 --- a/python-dmidecode.spec +++ b/python-dmidecode.spec @@ -38,6 +38,9 @@ Patch2: detect-lib-with-py3.patch # PATCH-FIX-UPSTREAM 31-version_info-v-version.patch gh#nima/python-dmidecode#31 mcepl@suse.com # use sys.version_info instead of sys.version Patch3: 31-version_info-v-version.patch +# PATCH-FIX-UPSTREAM Makefile_libdir.patch bsc#[0-9]+ mcepl@suse.com +# Something's wrong with finding libdirs +Patch4: Makefile_libdir.patch Obsoletes: %{oldpython}-dmidecode <= %{version} Obsoletes: python-python-dmidecode <= %{version} BuildRequires: %{python_module devel}