From d826fb9119f5a6d8d7cac98111aa465a313e22ef Mon Sep 17 00:00:00 2001 From: Antonio T Date: Thu, 26 Nov 2020 18:14:50 +0100 Subject: [PATCH] Refresh SPEC file| Fixed for Python-3.10 (rhbz#1898981) --- python-dmidecode-use_python3.patch | 31 +++++++++++++++++++++++++ python-dmidecode.spec | 37 ++++++++++++++++++------------ sources | 2 +- 3 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 python-dmidecode-use_python3.patch diff --git a/python-dmidecode-use_python3.patch b/python-dmidecode-use_python3.patch new file mode 100644 index 0000000..65bca47 --- /dev/null +++ b/python-dmidecode-use_python3.patch @@ -0,0 +1,31 @@ +--- a/Makefile.orig 2020-11-26 17:05:32.097857000 +0100 ++++ b/Makefile 2020-11-26 17:09:31.660779877 +0100 +@@ -38,8 +38,8 @@ + #. $AutoHeaderSerial::20100225 $ + #. ******* AUTOHEADER END v1.2 ******* + +-PY_BIN := python2 +-VERSION := $(shell cd src;$(PY_BIN) -c "from setup_common import *; print(get_version());") ++PY_BIN := $(PYTHON_BIN) ++VERSION := $(PYTHON_VERSION) + PACKAGE := python-dmidecode + 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) +@@ -65,7 +65,7 @@ + $(PY) src/setup.py build + + 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 +--- a/unit-tests/Makefile.orig 2015-06-08 17:19:45.000000000 +0200 ++++ b/unit-tests/Makefile 2020-11-26 17:12:15.222361106 +0100 +@@ -1,5 +1,5 @@ +-PY_BIN := python2 ++PY_BIN := $(PYTHON_BIN) + + test : + $(PY_BIN) unit -vv + diff --git a/python-dmidecode.spec b/python-dmidecode.spec index 26d6914..5209d92 100644 --- a/python-dmidecode.spec +++ b/python-dmidecode.spec @@ -1,12 +1,14 @@ Name: python-dmidecode Summary: Python module to access DMI data Version: 3.12.2 -Release: 21%{?dist} +Release: 22%{?dist} License: GPLv2 -URL: http://projects.autonomy.net.au/python-dmidecode/ -Source0: https://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz +URL: https://github.com/nima/python-dmidecode +Source0: https://github.com/nima/python-dmidecode/archive/v%{version}/%{name}/%{name}-%{version}.tar.gz -BuildRequires: gcc +Patch0: python-dmidecode-use_python3.patch + +BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: python3-devel @@ -29,28 +31,29 @@ Requires: libxml2-python3 %prep -%setup -q -sed -i 's/python2/python3/g' Makefile unit-tests/Makefile - +%autosetup -p1 %build -# Not to get undefined symbol: dmixml_GetContent -export CFLAGS="${CFLAGS-} -std=gnu89" -make build +# -std=gnu89 is there to avoid `undefined symbol: dmixml_GetContent` +export PYTHON_BIN=%{__python3} +export PYTHON_VERSION=%{python3_version} +export CFLAGS="%{build_cflags} -std=gnu89" +export CC=gcc +%make_build %install %{__python3} src/setup.py install --root %{buildroot} --prefix=%{_prefix} %check -pushd unit-tests -make -popd +export PYTHONPATH=%{buildroot}%{python3_sitearch} +export PYTHON_BIN=%{__python3} +make -C unit-tests %files -n python3-dmidecode -%license doc/LICENSE doc/AUTHORS doc/AUTHORS.upstream -%doc README doc/README.upstream +%license doc/LICENSE +%doc README doc/AUTHORS doc/AUTHORS.upstream %{python3_sitearch}/dmidecodemod.cpython-%{python3_version_nodots}*.so %{python3_sitearch}/__pycache__/dmidecode.cpython-%{python3_version_nodots}*.py[co] %{python3_sitearch}/dmidecode.py @@ -58,6 +61,10 @@ popd %{_datadir}/python-dmidecode/ %changelog +* Thu Nov 26 2020 Antonio Trande - 3.12.2-22 +- Refresh SPEC file +- Fixed for Python-3.10 (rhbz#1898981) + * Wed Jul 29 2020 Fedora Release Engineering - 3.12.2-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 8ce26d1..7e07fdf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -27317c8f6ba2c0cb003c1fc7e786029e python-dmidecode-3.12.2.tar.gz +SHA512 (python-dmidecode-3.12.2.tar.gz) = da5c4d52d74b77c3aa6fc7b63b9fd29150a6e915286efbcfc4284caa0bacf8a1bc077614c83ee93f14e7d9502713a37f135885a075b96b1bf73bd0704e5a258f