Refresh SPEC file| Fixed for Python-3.10 (rhbz#1898981)

This commit is contained in:
Antonio T 2020-11-26 18:14:50 +01:00
parent 33154dd6fd
commit d826fb9119
3 changed files with 54 additions and 16 deletions

View File

@ -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

View File

@ -1,10 +1,12 @@
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
Patch0: python-dmidecode-use_python3.patch
BuildRequires: gcc
BuildRequires: libxml2-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 <sagitter@fedoraproject.org> - 3.12.2-22
- Refresh SPEC file
- Fixed for Python-3.10 (rhbz#1898981)
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

View File

@ -1 +1 @@
27317c8f6ba2c0cb003c1fc7e786029e python-dmidecode-3.12.2.tar.gz
SHA512 (python-dmidecode-3.12.2.tar.gz) = da5c4d52d74b77c3aa6fc7b63b9fd29150a6e915286efbcfc4284caa0bacf8a1bc077614c83ee93f14e7d9502713a37f135885a075b96b1bf73bd0704e5a258f