diff --git a/detect-lib-with-py3.patch b/detect-lib-with-py3.patch index e419b05..fa15aaf 100644 --- a/detect-lib-with-py3.patch +++ b/detect-lib-with-py3.patch @@ -1,5 +1,5 @@ --- - python-dmidecode-3.12.2/src/setup_common.py | 7 +++++-- + src/setup_common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/src/setup_common.py diff --git a/python-dmidecode.changes b/python-dmidecode.changes index d313d43..c236969 100644 --- a/python-dmidecode.changes +++ b/python-dmidecode.changes @@ -1,8 +1,30 @@ +------------------------------------------------------------------- +Mon Mar 7 13:44:33 UTC 2022 - Matej Cepl + +- Add missing Obsoletes + +------------------------------------------------------------------- +Fri Mar 4 09:24:04 UTC 2022 - Matej Cepl + +- Harmonize Factory with the SLE version (update-alternatives + instead of the subpackages). + +------------------------------------------------------------------- +Mon Feb 28 10:41:11 UTC 2022 - Matej Cepl + +- Add proper Provides/Obsoletes + ------------------------------------------------------------------- Thu Feb 24 22:57:21 UTC 2022 - Matej Cepl - Cleanup multi-version builds. +------------------------------------------------------------------- +Thu Feb 24 21:15:44 UTC 2022 - Matej Cepl + +- Introduce update-alternatives for + /usr/share/python-dmidecode/pymap.xml. + ------------------------------------------------------------------- Thu Feb 24 06:32:14 UTC 2022 - Matej Cepl @@ -21,14 +43,20 @@ Sat Dec 04 00:01:25 UTC 2021 - mcepl@cepl.eu * fix RESOURCE_LEAK errors detected by covscan in src/xmlpythonizer.c * Update README * fix RESOURCE_LEAK errors detected by covscan in src/dmidecodemodule.c + * Fixed memory Type Detail map size (bsc#1194351). ------------------------------------------------------------------- Thu Dec 2 23:52:35 UTC 2021 - Matej Cepl - Brutal simplification of the SPEC file to the standard single-spec - Python one. In the end we need one shared package and multiple - python-versioned ones. + Python one. - Removal of support for Python 2 (bsc#1193262) +- Rename huge-memory.diff to huge-memory.patch (i.e., remove + huge-memory.diff and add huge-memory.patch). +- Fix URL of Source0 (their own website is down, use GitHub + release). +- Add 31-version_info-v-version.patch to make tests 3.10 + compatible. ------------------------------------------------------------------- Thu Oct 19 07:53:52 UTC 2017 - mc@suse.com diff --git a/python-dmidecode.spec b/python-dmidecode.spec index 25788f3..da3ab90 100644 --- a/python-dmidecode.spec +++ b/python-dmidecode.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-dmidecode # # Copyright (c) 2022 SUSE LLC # @@ -17,10 +17,8 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define python_subpackage_only 1 %define oldpython python - -Name: %{oldpython}-dmidecode +Name: python-dmidecode Version: 3.12.2+git.1625035095.f0a089a Release: 0 Summary: Python module to access DMI data @@ -35,16 +33,20 @@ Patch2: detect-lib-with-py3.patch # PATCH-FIX-UPSTREAM 31-version_info-v-version.patch gh#nima/python-dmidecode#31 mcepl@suse.com # use sys.version_info instead of sys.version Patch3: 31-version_info-v-version.patch +Obsoletes: %{oldpython}-dmidecode <= 3.12.2+git.1625035095.f0a089a +Obsoletes: python-python-dmidecode <= 3.12.2+git.1625035095.f0a089a BuildRequires: %{python_module devel} %if 0%{?sle_version} && 0%{?sle_version} < 150400 -BuildRequires: %{oldpython}-libxml2-python -BuildRequires: %{oldpython}3-libxml2-python +BuildRequires: python2-libxml2-python +BuildRequires: python3-libxml2-python %else BuildRequires: %{python_module libxml2} %endif BuildRequires: fdupes BuildRequires: libxml2-devel BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun):update-alternatives %python_subpackages %description @@ -52,15 +54,6 @@ python-dmidecode is a python extension module that uses the code-base of the 'dmidecode' utility, and presents the data as python data structures or as XML data using libxml2. -%package -n python-python-dmidecode -Summary: Python module to access DMI data -Requires: %{oldpython}-dmidecode = %{version}-%{release} - -%description -n python-python-dmidecode -A Python extension module that uses the code-base of the -'dmidecode' utility, and presents the data as Python data -structures or as XML data using libxml2. - %prep %autosetup -p1 @@ -72,26 +65,40 @@ sed -i 's/python2/python3/g' Makefile unit-tests/Makefile } %install -%{python_expand $python src/setup.py install --root %{buildroot} --prefix=%{_prefix} +%{python_expand rm -f %{buildroot}%{_datadir}/python-dmidecode/pymap.xml +$python src/setup.py install --root %{buildroot} --prefix=%{_prefix} +ls -l %{buildroot}%{_datadir}/python-dmidecode/ +mv %{buildroot}%{_datadir}/python-dmidecode/pymap{,-%{$python_bin_suffix}}.xml +touch %{buildroot}%{_datadir}/python-dmidecode/pymap.xml %fdupes %{buildroot}%{$python_sitearch} } %check pushd unit-tests -%{python_expand export PYTHON=$python -%make_build -} +%python_expand PYTHON=$python %make_build popd +%post +PRIO=$(echo %{python_version}|tr -d '.') +/usr/sbin/update-alternatives --install %{_datadir}/python-dmidecode/pymap.xml pymap.xml \ + %{_datadir}/python-dmidecode/pymap-%{python_bin_suffix}.xml ${PRIO} + +%postun +if [ ! -f %{_datadir}/python-dmidecode/pymap-%{python_bin_suffix}.xml ] ; then + MAJVER=$(ver=%{python_version}; echo ${ver:0:1}) + /usr/sbin/update-alternatives --remove pymap.xml \ + %{_datadir}/python-dmidecode/pymap-%{python_bin_suffix}.xml +fi + %clean -%files +%files %{python_files} %license doc/LICENSE %doc README doc/README.upstream doc/AUTHORS doc/AUTHORS.upstream %dir %{_datadir}/python-dmidecode/ -%{_datadir}/python-dmidecode/ - -%files %{python_files python-dmidecode} +%ghost %{_sysconfdir}/alternatives/pymap.xml +%ghost %{_datadir}/python-dmidecode/pymap.xml +%{_datadir}/python-dmidecode/pymap-%{python_bin_suffix}.xml %{python_sitearch}/dmidecode* %{python_sitearch}/*.egg-info %pycache_only %{python_sitearch}/__pycache__/*