Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
9ba48a9566
!50 [sync] PR-47: del sw_64 patch ifarch
From: @openeuler-sync-bot 
Reviewed-by: @weidongkl 
Signed-off-by: @weidongkl
2025-05-14 02:03:30 +00:00
Hailiang
6567a4190d del sw_64 patch ifarch
(cherry picked from commit 1b877fe7575478d5abe4340b82c29cd41c4d3f26)
2025-05-14 09:48:28 +08:00
openeuler-ci-bot
dff6566d11
!33 【LLVM平行宇宙】Add clang compile support
From: @liyunfei33 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2023-09-08 06:40:42 +00:00
liyunfei
4392ad20d0 add clang compile support 2023-08-15 09:47:54 +08:00
openeuler-ci-bot
3af3ff2d5c
!32 fix build error
From: @zhouwenpei 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2023-07-05 08:21:43 +00:00
zhouwenpei
f1a8dbde24 fix build error 2023-07-05 07:44:51 +00:00
openeuler-ci-bot
2cffd90ad1
!26 strip binary file
From: @zhouwenpei 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2023-03-02 01:40:56 +00:00
zhouwenpei
48c90a57d8 strip binary file 2023-03-01 11:03:18 +00:00
openeuler-ci-bot
502d9b89fc
!25 Upgrade package to version v3.12.3
From: @ccdxx 
Reviewed-by: @dou33 
Signed-off-by: @dou33
2022-12-07 11:37:04 +00:00
chendexi
a8a42f3e15 Upgrade package to 3.12.3
modify patch
2022-12-06 11:35:56 +08:00
6 changed files with 164 additions and 35 deletions

View File

@ -1,26 +0,0 @@
diff -Nuar python-dmidecode-3.12.2.org/src/dmidecode.c python-dmidecode-3.12.2.sw/src/dmidecode.c
--- python-dmidecode-3.12.2.org/src/dmidecode.c 2022-02-26 07:07:27.810000000 +0000
+++ python-dmidecode-3.12.2.sw/src/dmidecode.c 2022-02-26 07:08:59.290000000 +0000
@@ -2,10 +2,10 @@
/*. ******* coding:utf-8 AUTOHEADER START v1.1 *******
*. vim: fileencoding=utf-8 syntax=c sw=2 ts=2 et
*.
- *. © 2007-2013 Nima Talebi <nima@autonomy.net.au>
- *. © 2009-2013 David Sommerseth <davids@redhat.com>
- *. © 2002-2010 Jean Delvare <khali@linux-fr.org>
- *. © 2000-2002 Alan Cox <alan@redhat.com>
+ *. © 2007-2013 Nima Talebi <nima@autonomy.net.au>
+ *. © 2009-2013 David Sommerseth <davids@redhat.com>
+ *. © 2002-2010 Jean Delvare <khali@linux-fr.org>
+ *. © 2000-2002 Alan Cox <alan@redhat.com>
*.
*. This file is part of Python DMI-Decode.
*.
@@ -831,6 +831,7 @@
{ 0x2B, "Atom" },
{ 0x30, "Alpha" },
+ { 0x9916, "Sw_64" },
{ 0x31, "Alpha 21064" },
{ 0x32, "Alpha 21066" },
{ 0x33, "Alpha 21164" },

View File

@ -0,0 +1,11 @@
diff -Naru python-dmidecode-3.12.3.org/src/dmidecode.c python-dmidecode-3.12.3.sw/src/dmidecode.c
--- python-dmidecode-3.12.3.org/src/dmidecode.c 2022-11-17 13:51:28.000000000 +0800
+++ python-dmidecode-3.12.3.sw/src/dmidecode.c 2022-12-06 11:13:37.911806178 +0800
@@ -882,6 +882,7 @@
{ 0x2F, "Core m7" },
{ 0x30, "Alpha" },
+ { 0x9916, "Sw_64" },
{ 0x31, "Alpha 21064" },
{ 0x32, "Alpha 21066" },
{ 0x33, "Alpha 21164" },

Binary file not shown.

View File

@ -0,0 +1,126 @@
From 2d6530941682595b26067a8b679ec2eb3aceae54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
Date: Tue, 17 May 2022 16:00:47 +0200
Subject: [PATCH 1/3] Make the code future-proof against removal of distutils
module.
---
src/setup_common.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/setup_common.py b/src/setup_common.py
index aec1f9b..3fb9086 100644
--- a/src/setup_common.py
+++ b/src/setup_common.py
@@ -30,7 +30,12 @@
if sys.version_info[0] < 3:
import commands as subprocess
from os import path as os_path
-from distutils.sysconfig import get_python_lib
+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')
# libxml2 - C flags
def libxml2_include(incdir):
@@ -50,7 +55,7 @@ def libxml2_include(incdir):
# libxml2 - library flags
def libxml2_lib(libdir, libs):
- libdir.append(get_python_lib(1))
+ libdir.append(__python_lib)
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
From 7c0788b5c5ed7d1c79f70a74047abab161dca13a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
Date: Mon, 17 Oct 2022 19:59:52 +0200
Subject: [PATCH 2/3] Don't be too complicated.
There is actually no reason to use distutils.sysconfig at all,
plain sysconfig works even on 2.7.
---
Makefile | 3 ++-
src/setup_common.py | 9 ++-------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/setup_common.py b/src/setup_common.py
index 3fb9086..97ece95 100644
--- a/src/setup_common.py
+++ b/src/setup_common.py
@@ -30,12 +30,7 @@
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])
From 860c730309366d6062c410ee975a2fc159452dc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
Date: Wed, 26 Oct 2022 17:39:47 +0200
Subject: [PATCH 3/3] Make the discovery of the build .so file more robust.
Different versions of Python apparently generate different
directory names, there doesn't seem to be any more reliable
method of the .so file discovery than brutal force of the shell
find command.
---
Makefile | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
--- a/Makefile.backup 2022-11-17 06:51:28.000000000 +0100
+++ b/Makefile 2023-05-20 12:56:07.590575539 +0200
@@ -44,12 +44,11 @@
PY_VER := $(shell $(PY_BIN) -c 'import sys; print("%d.%d"%sys.version_info[0:2])')
PY_MV := $(shell echo $(PY_VER) | cut -b 1)
PY := python$(PY_VER)
-SO_PATH := build/lib.linux-$(shell uname -m)-$(PY_VER)
ifeq ($(PY_MV),2)
- SO := $(SO_PATH)/dmidecodemod.so
+ SOLIB := dmidecodemod.so
else
SOABI := $(shell $(PY_BIN) -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))')
- SO := $(SO_PATH)/dmidecodemod.$(SOABI).so
+ SOLIB := dmidecodemod.$(SOABI).so
endif
SHELL := /bin/bash
@@ -59,13 +58,13 @@
all : build dmidump
build: $(PY)-dmidecodemod.so
-$(PY)-dmidecodemod.so: $(SO)
- cp $< $@
-$(SO):
+
+$(PY)-dmidecodemod.so:
$(PY) src/setup.py build
+ cp $$(find build -name $(SOLIB)) $@
dmidump : src/util.o src/efi.o src/dmilog.o
- $(CC) -o $@ src/dmidump.c $^ -g -Wall -D_DMIDUMP_MAIN_
+ $(CC) -o $@ src/dmidump.c $^ ${CFLAGS} -D_DMIDUMP_MAIN_
install:
$(PY) src/setup.py install

View File

@ -1,18 +1,19 @@
%define debug_package %{nil}
Name: python-dmidecode
Version: 3.12.2
Release: 24
Version: 3.12.3
Release: 5
Summary: Python extension module for dmidecode
License: GPLv2
URL: http://projects.autonomy.net.au/python-dmidecode/
Source0: https://github.com/nima/python-dmidecode/archive/v%{version}.tar.gz
%ifarch sw_64
Patch1: python-dmidecode-3.12.2-sw.patch
%endif
Source0: https://github.com/nima/python-dmidecode/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch1: python-dmidecode-3.12.3-sw.patch
#Reference:https://src.fedoraproject.org/rpms/python-dmidecode/blob/rawhide/f/python-dmidecode-rhbz2154949.patch
Patch2: python-dmidecode-rhbz2154949.patch
BuildRequires: gcc libxml2-devel python3-libxml2 python3-devel
%if "%toolchain" == "clang"
BuildRequires: clang llvm lld
%endif
%description
Dmidecode reports information about your system's hardware as described in
@ -47,7 +48,9 @@ sed -i 's/python2/python3/g' Makefile unit-tests/Makefile
export PYTHON_BIN=%{__python3}
export PYTHON_VERSION=%{python3_version}
export CFLAGS="%{build_cflags} -std=gnu89"
export CC=gcc
%if "%toolchain" == "clang"
export CFLAGS="$CFLAGS -Wno-error=int-conversion"
%endif
%make_build
%install
@ -71,6 +74,21 @@ make -C unit-tests
%doc README doc/README.upstream
%changelog
* Tue May 13 2025 mahailiang <mahailiang@uniontech.com> - 3.12.3-5
- del sw_64 patch ifarch
* Fri Aug 11 2023 liyunfei <liyunfei33@huawei.com> - 3.12.3-4
- add clang compile support
* Wed Jul 05 2023 zhouwenpei <zhouwenpei@h-partners.com> - 3.12.3-3
- fix build error
* Wed Mar 01 2023 zhouwenpei <zhouwenpei@h-partners.com> - 3.12.3-2
- strip binary file
* Tue Dec 6 2022 chendexi <chendexi@kylinos.cn> - 3.12.3-1
- Upgrade to 3.12.3
* Wed Nov 23 2022 wuzx<wuzx1226@qq.com> - 3.12.2-24
- Add sw64 architecture

Binary file not shown.