Refresh SPEC file| Fixed for Python-3.10 (rhbz#1898981)
This commit is contained in:
parent
33154dd6fd
commit
d826fb9119
31
python-dmidecode-use_python3.patch
Normal file
31
python-dmidecode-use_python3.patch
Normal 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
|
||||||
|
|
@ -1,12 +1,14 @@
|
|||||||
Name: python-dmidecode
|
Name: python-dmidecode
|
||||||
Summary: Python module to access DMI data
|
Summary: Python module to access DMI data
|
||||||
Version: 3.12.2
|
Version: 3.12.2
|
||||||
Release: 21%{?dist}
|
Release: 22%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: http://projects.autonomy.net.au/python-dmidecode/
|
URL: https://github.com/nima/python-dmidecode
|
||||||
Source0: https://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz
|
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: libxml2-devel
|
||||||
|
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
@ -29,28 +31,29 @@ Requires: libxml2-python3
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
sed -i 's/python2/python3/g' Makefile unit-tests/Makefile
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Not to get undefined symbol: dmixml_GetContent
|
# -std=gnu89 is there to avoid `undefined symbol: dmixml_GetContent`
|
||||||
export CFLAGS="${CFLAGS-} -std=gnu89"
|
export PYTHON_BIN=%{__python3}
|
||||||
make build
|
export PYTHON_VERSION=%{python3_version}
|
||||||
|
export CFLAGS="%{build_cflags} -std=gnu89"
|
||||||
|
export CC=gcc
|
||||||
|
%make_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{__python3} src/setup.py install --root %{buildroot} --prefix=%{_prefix}
|
%{__python3} src/setup.py install --root %{buildroot} --prefix=%{_prefix}
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
pushd unit-tests
|
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
||||||
make
|
export PYTHON_BIN=%{__python3}
|
||||||
popd
|
make -C unit-tests
|
||||||
|
|
||||||
|
|
||||||
%files -n python3-dmidecode
|
%files -n python3-dmidecode
|
||||||
%license doc/LICENSE doc/AUTHORS doc/AUTHORS.upstream
|
%license doc/LICENSE
|
||||||
%doc README doc/README.upstream
|
%doc README doc/AUTHORS doc/AUTHORS.upstream
|
||||||
%{python3_sitearch}/dmidecodemod.cpython-%{python3_version_nodots}*.so
|
%{python3_sitearch}/dmidecodemod.cpython-%{python3_version_nodots}*.so
|
||||||
%{python3_sitearch}/__pycache__/dmidecode.cpython-%{python3_version_nodots}*.py[co]
|
%{python3_sitearch}/__pycache__/dmidecode.cpython-%{python3_version_nodots}*.py[co]
|
||||||
%{python3_sitearch}/dmidecode.py
|
%{python3_sitearch}/dmidecode.py
|
||||||
@ -58,6 +61,10 @@ popd
|
|||||||
%{_datadir}/python-dmidecode/
|
%{_datadir}/python-dmidecode/
|
||||||
|
|
||||||
%changelog
|
%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
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.2-21
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user