Skip to content

Commit 33fd972

Browse files
Upgrade: python-dmidecode version to 3.12.3 (#13562)
1 parent a25cb13 commit 33fd972

4 files changed

Lines changed: 215 additions & 29 deletions

File tree

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
From 2d6530941682595b26067a8b679ec2eb3aceae54 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
3+
Date: Tue, 17 May 2022 16:00:47 +0200
4+
Subject: [PATCH 1/3] Make the code future-proof against removal of distutils
5+
module.
6+
7+
---
8+
src/setup_common.py | 14 +++++++++++---
9+
1 file changed, 11 insertions(+), 3 deletions(-)
10+
11+
diff --git a/src/setup_common.py b/src/setup_common.py
12+
index aec1f9b..3fb9086 100644
13+
--- a/src/setup_common.py
14+
+++ b/src/setup_common.py
15+
@@ -30,7 +30,12 @@
16+
if sys.version_info[0] < 3:
17+
import commands as subprocess
18+
from os import path as os_path
19+
-from distutils.sysconfig import get_python_lib
20+
+try:
21+
+ from distutils.sysconfig import get_python_lib, get_config_var
22+
+ __python_lib = get_python_lib(1)
23+
+except ImportError:
24+
+ from sysconfig import get_config_var, get_path
25+
+ __python_lib = get_path('platlib')
26+
27+
# libxml2 - C flags
28+
def libxml2_include(incdir):
29+
@@ -50,7 +55,7 @@ def libxml2_include(incdir):
30+
31+
# libxml2 - library flags
32+
def libxml2_lib(libdir, libs):
33+
- libdir.append(get_python_lib(1))
34+
+ libdir.append(__python_lib)
35+
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
36+
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
37+
38+
From 7c0788b5c5ed7d1c79f70a74047abab161dca13a Mon Sep 17 00:00:00 2001
39+
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
40+
Date: Mon, 17 Oct 2022 19:59:52 +0200
41+
Subject: [PATCH 2/3] Don't be too complicated.
42+
43+
There is actually no reason to use distutils.sysconfig at all,
44+
plain sysconfig works even on 2.7.
45+
---
46+
Makefile | 3 ++-
47+
src/setup_common.py | 9 ++-------
48+
2 files changed, 4 insertions(+), 8 deletions(-)
49+
50+
diff --git a/src/setup_common.py b/src/setup_common.py
51+
index 3fb9086..97ece95 100644
52+
--- a/src/setup_common.py
53+
+++ b/src/setup_common.py
54+
@@ -30,12 +30,7 @@
55+
if sys.version_info[0] < 3:
56+
import commands as subprocess
57+
from os import path as os_path
58+
-try:
59+
- from distutils.sysconfig import get_python_lib, get_config_var
60+
- __python_lib = get_python_lib(1)
61+
-except ImportError:
62+
- from sysconfig import get_config_var, get_path
63+
- __python_lib = get_path('platlib')
64+
+from sysconfig import get_config_var, get_path
65+
66+
# libxml2 - C flags
67+
def libxml2_include(incdir):
68+
@@ -55,7 +50,7 @@ def libxml2_include(incdir):
69+
70+
# libxml2 - library flags
71+
def libxml2_lib(libdir, libs):
72+
- libdir.append(__python_lib)
73+
+ libdir.append(get_path('platlib'))
74+
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
75+
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
76+
77+
78+
From 860c730309366d6062c410ee975a2fc159452dc6 Mon Sep 17 00:00:00 2001
79+
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
80+
Date: Wed, 26 Oct 2022 17:39:47 +0200
81+
Subject: [PATCH 3/3] Make the discovery of the build .so file more robust.
82+
83+
Different versions of Python apparently generate different
84+
directory names, there doesn't seem to be any more reliable
85+
method of the .so file discovery than brutal force of the shell
86+
find command.
87+
---
88+
Makefile | 12 +++++-------
89+
1 file changed, 5 insertions(+), 7 deletions(-)
90+
91+
--- a/Makefile.backup 2022-11-17 06:51:28.000000000 +0100
92+
+++ b/Makefile 2023-05-20 12:56:07.590575539 +0200
93+
@@ -44,12 +44,11 @@
94+
PY_VER := $(shell $(PY_BIN) -c 'import sys; print("%d.%d"%sys.version_info[0:2])')
95+
PY_MV := $(shell echo $(PY_VER) | cut -b 1)
96+
PY := python$(PY_VER)
97+
-SO_PATH := build/lib.linux-$(shell uname -m)-$(PY_VER)
98+
ifeq ($(PY_MV),2)
99+
- SO := $(SO_PATH)/dmidecodemod.so
100+
+ SOLIB := dmidecodemod.so
101+
else
102+
SOABI := $(shell $(PY_BIN) -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))')
103+
- SO := $(SO_PATH)/dmidecodemod.$(SOABI).so
104+
+ SOLIB := dmidecodemod.$(SOABI).so
105+
endif
106+
SHELL := /bin/bash
107+
108+
@@ -59,13 +58,13 @@
109+
all : build dmidump
110+
111+
build: $(PY)-dmidecodemod.so
112+
-$(PY)-dmidecodemod.so: $(SO)
113+
- cp $< $@
114+
-$(SO):
115+
+
116+
+$(PY)-dmidecodemod.so:
117+
$(PY) src/setup.py build
118+
+ cp $$(find build -name $(SOLIB)) $@
119+
120+
dmidump : src/util.o src/efi.o src/dmilog.o
121+
- $(CC) -o $@ src/dmidump.c $^ -g -Wall -D_DMIDUMP_MAIN_
122+
+ $(CC) -o $@ src/dmidump.c $^ ${CFLAGS} -D_DMIDUMP_MAIN_
123+
124+
install:
125+
$(PY) src/setup.py install
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"python-dmidecode-3.12.2.tar.gz": "22ea8c96de989cf2072f942d9fb0fa028087602bfee6e5eb860b8047cc6fe7d5"
3+
"python-dmidecode-3.12.3.tar.gz": "44d45d7d8344290c259c989d3af3f614c7837cbd85052d486adfa46a1c777164"
44
}
5-
}
5+
}

SPECS-EXTENDED/python-dmidecode/python-dmidecode.spec

Lines changed: 86 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
Vendor: Microsoft Corporation
2-
Distribution: Azure Linux
31
Name: python-dmidecode
42
Summary: Python module to access DMI data
5-
Version: 3.12.2
6-
Release: 20%{?dist}
7-
License: GPLv2
3+
Version: 3.12.3
4+
Release: 10%{?dist}
5+
License: GPL-2.0-only
6+
Vendor: Microsoft Corporation
7+
Distribution: Azure Linux
88
URL: https://github.com/nima/python-dmidecode
9-
# source0: https://github.com/nima/python-dmidecode/archive/refs/tags/v3.12.2.tar.gz
10-
Source0: https://github.com/nima/python-dmidecode/archive/refs/tags/%{name}-%{version}.tar.gz
9+
Source0: https://github.com/nima/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1110

12-
BuildRequires: gcc
13-
BuildRequires: libxml2-devel
11+
Patch0: python-dmidecode-rhbz2154949.patch
1412

13+
BuildRequires: make
14+
BuildRequires: gcc
15+
BuildRequires: libxml2-devel
1516
BuildRequires: python3-devel
1617
BuildRequires: libxml2-python3
18+
BuildRequires: python3-setuptools
1719

1820
%global _description\
1921
python-dmidecode is a python extension module that uses the\
2022
code-base of the 'dmidecode' utility, and presents the data\
2123
as python data structures or as XML data using libxml2.\
2224
\
2325

24-
2526
%description %_description
2627

2728
%package -n python3-dmidecode
@@ -32,37 +33,97 @@ Requires: libxml2-python3
3233

3334

3435
%prep
35-
%setup -q
36-
sed -i 's/python2/python3/g' Makefile unit-tests/Makefile
37-
36+
%autosetup -p1 -n %{name}-%{version}
3837

3938
%build
40-
# Not to get undefined symbol: dmixml_GetContent
41-
export CFLAGS="${CFLAGS-} -std=gnu89"
42-
make build
39+
# -std=gnu89 is there to avoid `undefined symbol: dmixml_GetContent`
40+
export PYTHON_BIN=%{__python3}
41+
export CFLAGS="%{build_cflags} -std=gnu89"
42+
export CXXFLAGS="%{build_cxxflags} -std=gnu89"
43+
export CC=gcc
44+
export CXX=g++
45+
%make_build
4346

4447
%install
4548
%{__python3} src/setup.py install --root %{buildroot} --prefix=%{_prefix}
4649

47-
4850
%check
4951
pushd unit-tests
5052
make
5153
popd
5254

53-
5455
%files -n python3-dmidecode
55-
%license doc/LICENSE doc/AUTHORS doc/AUTHORS.upstream
56-
%doc README doc/README.upstream
56+
%license doc/LICENSE
57+
%doc README doc/AUTHORS doc/AUTHORS.upstream
5758
%{python3_sitearch}/dmidecodemod.cpython-%{python3_version_nodots}*.so
58-
%{python3_sitearch}/__pycache__/dmidecode.cpython-%{python3_version_nodots}*.py[co]
59-
%{python3_sitearch}/dmidecode.py
59+
%pycached %{python3_sitearch}/dmidecode.py
6060
%{python3_sitearch}/*.egg-info
61-
%{_datadir}/python-dmidecode/
61+
%{_datadir}/%{name}/
6262

6363
%changelog
64-
* Fri Oct 15 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 3.12.2-20
65-
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
64+
* Wed Apr 23 2025 Akhila Guruju <v-guakhila@microsoft.com> - 3.12.3-10
65+
- Initial Azure Linux import from Fedora 41 (license: MIT).
66+
- License verified
67+
68+
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.3-9
69+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
70+
71+
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 3.12.3-8
72+
- Rebuilt for Python 3.13
73+
74+
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.3-7
75+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
76+
77+
* Thu Aug 10 2023 Lichen Liu <lichliu@redhat.com> - 3.12.3-6
78+
- Use SPDX identifiers for license
79+
80+
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.3-5
81+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
82+
83+
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 3.12.3-4
84+
- Rebuilt for Python 3.12
85+
86+
* Sat May 20 2023 Antonio Trande <sagitter@fedoraproject.org> - 3.12.3-3
87+
- Fix BuildRequires packages for Python-3.12
88+
89+
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.3-2
90+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
91+
92+
* Sun Dec 25 2022 Antonio Trande <sagitter@fedoraproject.org> - 3.12.3-1
93+
- Release 3.12.3
94+
- Temporary fix for rhbz#2154949
95+
96+
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-29.20210630gitf0a089a1
97+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
98+
99+
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 3.12.2-28.20210630gitf0a089a1
100+
- Rebuilt for Python 3.11
101+
102+
* Sun Apr 24 2022 Antonio Trande <sagitter@fedoraproject.org> - 3.12.2-27.20210630gitf0a089a1
103+
- Build commit #f0a089a1 (include covscan error fixes)
104+
105+
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-26
106+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
107+
108+
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-25
109+
- Second attempt - Rebuilt for
110+
https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
111+
112+
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 3.12.2-24
113+
- Rebuilt for Python 3.10
114+
115+
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-23
116+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
117+
118+
* Thu Nov 26 2020 Antonio Trande <sagitter@fedoraproject.org> - 3.12.2-22
119+
- Refresh SPEC file
120+
- Fixed for Python-3.10 (rhbz#1898981)
121+
122+
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-21
123+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
124+
125+
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.12.2-20
126+
- Rebuilt for Python 3.9
66127

67128
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-19
68129
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22603,8 +22603,8 @@
2260322603
"type": "other",
2260422604
"other": {
2260522605
"name": "python-dmidecode",
22606-
"version": "3.12.2",
22607-
"downloadUrl": "https://github.com/nima/python-dmidecode/archive/refs/tags/python-dmidecode-3.12.2.tar.gz"
22606+
"version": "3.12.3",
22607+
"downloadUrl": "https://github.com/nima/python-dmidecode/archive/refs/tags/v3.12.3.tar.gz"
2260822608
}
2260922609
}
2261022610
},

0 commit comments

Comments
 (0)