Hello community,

here is the log from the commit of package libkdumpfile for openSUSE:Factory 
checked in at 2020-09-28 14:28:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libkdumpfile (Old)
 and      /work/SRC/openSUSE:Factory/.libkdumpfile.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libkdumpfile"

Mon Sep 28 14:28:53 2020 rev:13 rq:838137 version:0.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/libkdumpfile/libkdumpfile.changes        
2020-09-23 18:44:14.969533758 +0200
+++ /work/SRC/openSUSE:Factory/.libkdumpfile.new.4249/libkdumpfile.changes      
2020-09-28 14:29:07.714150953 +0200
@@ -1,0 +2,12 @@
+Sun Sep 27 21:13:24 UTC 2020 - Petr Tesařík <[email protected]>
+
+- Switch to Python distutils:
+  * libkdumpfile-use-python-distutils.patch
+  * libkdumpfile-uninstall-using-distutils.patch
+  * libkdumpfile-honour-DESTDIR.patch
+  * libkdumpfile-move-python-setup-command-options.patch
+  * libkdumpfile-python-includedir.patch
+- Merge python-libaddrxlat into python-libkdumpfile.
+- Build both Python2 and Python3 packages.
+
+-------------------------------------------------------------------

New:
----
  libkdumpfile-honour-DESTDIR.patch
  libkdumpfile-move-python-setup-command-options.patch
  libkdumpfile-python-includedir.patch
  libkdumpfile-uninstall-using-distutils.patch
  libkdumpfile-use-python-distutils.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libkdumpfile.spec ++++++
--- /var/tmp/diff_new_pack.85hVOL/_old  2020-09-28 14:29:08.870151955 +0200
+++ /var/tmp/diff_new_pack.85hVOL/_new  2020-09-28 14:29:08.874151959 +0200
@@ -29,25 +29,43 @@
 %endif
 %endif
 
-%if 0%{?suse_version} >= 1500
-%define pycache \{,/__pycache__\}
+# There was no Python single-spec before SLE15
+%if %{defined python_subpackages}
+%define new_python_macros 1
 %else
-%define pycache %nil
+%define new_python_macros 0
+%define python_module() python-%{**} python3-%{**}
+%define ifpython2 %if 0
+%define python_build python setup.py build
+%define python_install python setup.py install --skip-build --root 
%{?buildroot}
+%define python3_build python3 setup.py build
+%define python3_install python3 setup.py install --skip-build --root 
%{?buildroot}
 %endif
 
 #
 # End compatibility cruft
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define oldpython python
 
 Name:           libkdumpfile
 Version:        0.4.0
 Release:        0
+%if "%name" == "libkdumpfile"
 Summary:        Kernel dump file access library
 License:        LGPL-3.0-or-later OR GPL-2.0-or-later
-Group:          Development/Libraries/C and C++
+Group:          Development/Languages/Python
+%else
+Summary:        Python interface for libkdumpfile
+License:        LGPL-3.0-or-later OR GPL-2.0-or-later
+Group:          Development/Languages/Python
+%endif
 URL:            https://github.com/ptesarik/libkdumpfile
-Source:         
https://github.com/ptesarik/libkdumpfile/releases/download/v%version/%name-%version.tar.bz2
+Source:         
https://github.com/ptesarik/libkdumpfile/releases/download/v%{version}/%{name}-%{version}.tar.bz2
+Patch1:         %{name}-use-python-distutils.patch
+Patch2:         %{name}-uninstall-using-distutils.patch
+Patch3:         %{name}-honour-DESTDIR.patch
+Patch4:         %{name}-move-python-setup-command-options.patch
+Patch5:         %{name}-python-includedir.patch
 BuildRequires:  lzo-devel
 BuildRequires:  pkgconfig
 BuildRequires:  zlib-devel
@@ -61,31 +79,70 @@
 %if %{have_snappy}
 BuildRequires:  snappy-devel
 %endif
+%ifpython2
+Provides:       %{oldpython}-libaddrxlat = %{version}-%{release}
+Obsoletes:      %{oldpython}-libaddrxlat < %{version}-%{release}
+%endif
+
+%if %new_python_macros
+%python_subpackages
+%endif
 
 %description
+%if "%name" == "libkdumpfile"
 A library that provides an abstraction layer for reading kernel dump
 core files.  It supports different kernel dump core formats, virtual
 to physical translation, Xen mappings and more.
+%else
+This package contains all necessary python modules to use libkdumpfile via
+the Python interpreter.
+%endif
 
-%package -n libkdumpfile8
-Summary:        Kernel dump file access library
-Group:          System/Libraries
+%if !%new_python_macros
 
-%description -n libkdumpfile8
-A library that provides an abstraction layer for reading kernel dump
-core files.  It supports different kernel dump core formats, virtual
-to physical translation, Xen mappings and more.
+%package -n python2-libkdumpfile
+Summary:        Python interface for libkdumpfile
+Group:          Development/Languages/Python
+Provides:       python-libkdumpfile = %{version}-%{release}
+Obsoletes:      python-libkdumpfile < %{version}-%{release}
+Provides:       python-libaddrxlat = %{version}-%{release}
+Obsoletes:      python-libaddrxlat < %{version}-%{release}
+
+%description -n python2-libkdumpfile
+This package contains all necessary python modules to use libkdumpfile via
+the Python interpreter.
+
+%package -n python3-libkdumpfile
+Summary:        Python interface for libkdumpfile
+Group:          Development/Languages/Python
+
+%description -n python3-libkdumpfile
+This package contains all necessary python modules to use libkdumpfile via
+the Python interpreter.
 
-%package devel
+%endif
+
+%package -n %{name}-devel
 Summary:        Include files and libraries for libkdumpfile development
 Group:          Development/Libraries/C and C++
 Requires:       glibc-devel
 Requires:       libkdumpfile8 = %{version}
 
-%description devel
+%description -n %{name}-devel
 This package contains all necessary include files and libraries needed
 to develop applications that require libkdumpfile.
 
+%package -n libkdumpfile8
+Summary:        Kernel dump file access library
+Group:          System/Libraries
+
+%description -n libkdumpfile8
+A library that provides an abstraction layer for reading kernel dump
+core files.  It supports different kernel dump core formats, virtual
+to physical translation, Xen mappings and more.
+
+This package contains the libkdumpfile library.
+
 %package -n libaddrxlat1
 Summary:        Address translation library used primarily by libkdumpfile
 Group:          System/Libraries
@@ -94,7 +151,7 @@
 A library that provides an abstraction layer for translating addresses
 between address spaces (i.e. physical vs virtual).
 
-This package contains the libxattrxlat library.
+This package contains the libaddrxlat library.
 
 %package -n libaddrxlat-devel
 Summary:        Include files and libraries for libaddrxlat development
@@ -106,24 +163,6 @@
 This package contains all necessary include files and libraries needed
 to develop applications that require libaddrxlat.
 
-%package -n python-libkdumpfile
-Summary:        Python interface for libkdumpfile
-Group:          Development/Languages/Python
-Requires:       libkdumpfile8 = %{version}
-
-%description -n python-libkdumpfile
-This package contains all necessary python modules to use libkdumpfile via
-the Python interpreter.
-
-%package -n python-libaddrxlat
-Summary:        Python interface for libaddrxlat
-Group:          Development/Languages/Python
-Requires:       libaddrxlat1 = %{version}
-
-%description -n python-libaddrxlat
-This package contains all necessary python modules to use libaddrxlat via
-the Python interpreter.
-
 # Compatibility cruft
 # there is no %%license prior to SLE12
 %if %{undefined _defaultlicensedir}
@@ -138,24 +177,59 @@
 
 %prep
 %setup -q
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 # Avoid autotools recheck after patching config*
 touch aclocal.m4 Makefile.in config.h.in configure
 
 %build
-%configure --disable-static
+%configure --disable-static --without-python
 make %{?_smp_mflags}
+cd python
+%if %new_python_macros
+%{python_expand # Build for each Python version
+rm -f setup.cfg
+make setup.cfg DESTDIR=%{?buildroot} pyexecdir=%{$python_sitearch}
+%$python_build
+}
+%else
+make setup.cfg DESTDIR=%{?buildroot} pyexecdir=%{python_sitearch}
+%python_build
+rm -f setup.cfg
+make setup.cfg DESTDIR=%{?buildroot} pyexecdir=%{python3_sitearch}
+%python3_build
+%endif
 
 %install
 %make_install
-rm -v %{buildroot}%{_libdir}/libkdumpfile.la
-rm -v %{buildroot}%{_libdir}/libaddrxlat.la
-rm -v %{buildroot}%{python_sitearch}/_kdumpfile.la
-rm -v %{buildroot}%{python_sitearch}/_addrxlat.la
-# Do not install this example code
-rm -v %{buildroot}%{_bindir}/dumpattr
-rm -v %{buildroot}%{_bindir}/listxendoms
-rm -v %{buildroot}%{_bindir}/showxlat
+cd python
+%python_install
+%if !%new_python_macros
+%python3_install
+%endif
+
+# Do not install example code
+rm -v %{?buildroot}%{_bindir}/dumpattr
+rm -v %{?buildroot}%{_bindir}/listxendoms
+rm -v %{?buildroot}%{_bindir}/showxlat
+# Remove Libtool files
+rm -v %{?buildroot}%{_libdir}/libkdumpfile.la
+rm -v %{?buildroot}%{_libdir}/libaddrxlat.la
+%if %new_python_macros
+%{python_expand # Libtool files for extension modules
+rm -v %{?buildroot}%{$python_sitearch}/_kdumpfile*.la
+rm -v %{?buildroot}%{$python_sitearch}/_addrxlat*.la
+}
+%else
+rm -v %{?buildroot}%{python_sitearch}/_kdumpfile*.la
+rm -v %{?buildroot}%{python_sitearch}/_addrxlat*.la
+rm -v %{?buildroot}%{python3_sitearch}/_kdumpfile*.la
+rm -v %{?buildroot}%{python3_sitearch}/_addrxlat*.la
+%endif
 
 %post -n libkdumpfile8 -p /sbin/ldconfig
 
@@ -171,7 +245,7 @@
 %license COPYING COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv3
 %doc README.md NEWS
 
-%files devel
+%files -n libkdumpfile-devel
 %defattr(-,root,root)
 %{_includedir}/libkdumpfile/kdumpfile.h
 %{_libdir}/libkdumpfile.so
@@ -190,19 +264,22 @@
 %{_libdir}/libaddrxlat.so
 %{_libdir}/pkgconfig/libaddrxlat.pc
 
-%files -n python-libkdumpfile
+%if %new_python_macros
+
+%files %{python_files}
 %defattr(-,root,root)
-%dir %{python_sitelib}/kdumpfile%{pycache}
-%{python_sitelib}/kdumpfile%{pycache}/__init__.*py*
-%{python_sitelib}/kdumpfile%{pycache}/exceptions.*py*
-%{python_sitelib}/kdumpfile%{pycache}/views.*py*
-%{python_sitearch}/_kdumpfile.so
-
-%files -n python-libaddrxlat
-%defattr(-,root,root)
-%dir %{python_sitelib}/addrxlat%{pycache}
-%{python_sitelib}/addrxlat%{pycache}/__init__.*py*
-%{python_sitelib}/addrxlat%{pycache}/exceptions.*py*
-%{python_sitearch}/_addrxlat.so
+%{python_sitearch}/*
+
+%else
+
+%files -n python2-libkdumpfile
+%defattr(-,root,root)
+%{python_sitearch}/*
+
+%files -n python3-libkdumpfile
+%defattr(-,root,root)
+%{python3_sitearch}/*
+
+%endif
 
 %changelog

++++++ libkdumpfile-honour-DESTDIR.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Sat, 26 Sep 2020 09:55:27 +0200
Subject: Honour DESTDIR for install/uninstall
Upstream: merged
Git-commit: f44f3a690dc74435d8a4cf232b2b8da4a1170089

Support GNU Automake staged installation. Note that `make
distcheck` fails when this feature is not implemented.

Signed-off-by: Petr Tesarik <[email protected]>
---
 python/Makefile.am |    3 ++-
 python/Makefile.in |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -40,13 +40,14 @@ all-local: setup.cfg
 
 install-exec-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py install \
+               --root "$(DESTDIR)"/ \
                --install-purelib $(pythondir) \
                --install-platlib $(pyexecdir) \
                --record $(installed_list)
 
 uninstall-local: $(installed_list)
        while read f ; do \
-           $(LIBTOOL) --mode=uninstall rm -f "$$f" ; \
+           $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)/$$f" ; \
        done < $<
 
 mostlyclean-local: setup.cfg
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1077,13 +1077,14 @@ all-local: setup.cfg
 
 install-exec-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py install \
+               --root "$(DESTDIR)"/ \
                --install-purelib $(pythondir) \
                --install-platlib $(pyexecdir) \
                --record $(installed_list)
 
 uninstall-local: $(installed_list)
        while read f ; do \
-           $(LIBTOOL) --mode=uninstall rm -f "$$f" ; \
+           $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)/$$f" ; \
        done < $<
 
 mostlyclean-local: setup.cfg
++++++ libkdumpfile-move-python-setup-command-options.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Sat, 26 Sep 2020 13:11:41 +0200
Subject: Move Python setup command options to their own sections
Upstream: merged
Git-commit: 0c17b7f3f85866f70d2670398a5a67164d23ebef

This is more straightforward than reading them in setup.py and
passing them down to setup via the 'options' argument.

Signed-off-by: Petr Tesarik <[email protected]>
---
 python/Makefile.am |   10 +++++++---
 python/Makefile.in |   10 +++++++---
 python/setup.py    |    9 ---------
 3 files changed, 14 insertions(+), 15 deletions(-)

--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -29,11 +29,15 @@ setup.cfg: Makefile
        $(AM_V_GEN)
        $(AM_V_at)echo "[kdumpfile]" > $@
        $(AM_V_at)echo "version=$(VERSION)" >> $@
-       $(AM_V_at)echo "libtool=$(LIBTOOL)" >> $@
-       $(AM_V_at)echo "libtool_install=$(LIBTOOL) --mode=install $(INSTALL)" 
>> $@
-       $(AM_V_at)echo "pyexecdir=$(pyexecdir)" >> $@
        $(AM_V_at)echo "srcdir=$(srcdir)" >> $@
        $(AM_V_at)echo "top_builddir=$(top_builddir)" >> $@
+       $(AM_V_at)echo >> $@
+       $(AM_V_at)echo "[build_ext]" >> $@
+       $(AM_V_at)echo "libtool=$(LIBTOOL)" >> $@
+       $(AM_V_at)echo "pyexecdir=$(pyexecdir)" >> $@
+       $(AM_V_at)echo >> $@
+       $(AM_V_at)echo "[install_lib]" >> $@
+       $(AM_V_at)echo "libtool_install=$(LIBTOOL) --mode=install $(INSTALL)" 
>> $@
 
 all-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py build
--- a/python/setup.py
+++ b/python/setup.py
@@ -39,15 +39,6 @@ setup(name='libkdumpfile',
           Extension('_kdumpfile', [os.path.join(srcdir, 'kdumpfile.c')],
                     extra_objects=[kdumpfile_la]),
       ],
-      options={
-          'build_ext': {
-              'libtool': cfg.get('kdumpfile', 'libtool'),
-              'pyexecdir': cfg.get('kdumpfile', 'pyexecdir'),
-          },
-          'install_lib': {
-              'libtool_install': cfg.get('kdumpfile', 'libtool_install'),
-          },
-      },
       cmdclass={
           'build_ext': libtoolize.build_ext,
           'install_lib': libtoolize.install_lib,
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1066,11 +1066,15 @@ setup.cfg: Makefile
        $(AM_V_GEN)
        $(AM_V_at)echo "[kdumpfile]" > $@
        $(AM_V_at)echo "version=$(VERSION)" >> $@
-       $(AM_V_at)echo "libtool=$(LIBTOOL)" >> $@
-       $(AM_V_at)echo "libtool_install=$(LIBTOOL) --mode=install $(INSTALL)" 
>> $@
-       $(AM_V_at)echo "pyexecdir=$(pyexecdir)" >> $@
        $(AM_V_at)echo "srcdir=$(srcdir)" >> $@
        $(AM_V_at)echo "top_builddir=$(top_builddir)" >> $@
+       $(AM_V_at)echo >> $@
+       $(AM_V_at)echo "[build_ext]" >> $@
+       $(AM_V_at)echo "libtool=$(LIBTOOL)" >> $@
+       $(AM_V_at)echo "pyexecdir=$(pyexecdir)" >> $@
+       $(AM_V_at)echo >> $@
+       $(AM_V_at)echo "[install_lib]" >> $@
+       $(AM_V_at)echo "libtool_install=$(LIBTOOL) --mode=install $(INSTALL)" 
>> $@
 
 all-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py build
++++++ libkdumpfile-python-includedir.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Sun, 27 Sep 2020 07:34:39 +0200
Subject: python: Specify includedir for extension modules
Upstream: merged
Git-commit: 613192c375727ce190f6a4a793ffa3772b10a522

This bug was not found during development, because the include
files were already installed on the system, but of course, the
path to the not yet installed include directory must be given to
the compiler.

Fixes: 330148658156ce9a20ef55781ef5055f1992221d
Signed-off-by: Petr Tesarik <[email protected]>
---
 python/setup.py |    3 +++
 1 file changed, 3 insertions(+)

--- a/python/setup.py
+++ b/python/setup.py
@@ -11,6 +11,7 @@ cfg = ConfigParser()
 cfg.read('setup.cfg')
 srcdir = cfg.get('kdumpfile', 'srcdir')
 top_builddir = cfg.get('kdumpfile', 'top_builddir')
+include_dir=os.path.join(top_builddir, 'include'),
 addrxlat_la = os.path.join(
     top_builddir, 'src', 'addrxlat', 'libaddrxlat.la')
 kdumpfile_la = os.path.join(
@@ -35,8 +36,10 @@ setup(name='libkdumpfile',
       package_dir={'': srcdir},
       ext_modules=[
           Extension('_addrxlat', [os.path.join(srcdir, 'addrxlat.c')],
+                    include_dirs=[include_dir],
                     extra_objects=[addrxlat_la]),
           Extension('_kdumpfile', [os.path.join(srcdir, 'kdumpfile.c')],
+                    include_dirs=[include_dir],
                     extra_objects=[kdumpfile_la]),
       ],
       cmdclass={
++++++ libkdumpfile-uninstall-using-distutils.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Sat, 26 Sep 2020 09:51:22 +0200
Subject: Implement uninstall using distutils
Upstream: merged
Git-commit: 4ddedc04beef165e3f10f70124c117d30e805045

There is no `uninstall` command in distutils. However, the
`install` command can create a list of all files that were
installed, and this list can be used to remove them.

Signed-off-by: Petr Tesarik <[email protected]>
---
 python/Makefile.am |   12 +++++++++++-
 python/Makefile.in |   15 ++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)

--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -23,6 +23,8 @@ AM_CPPFLAGS = -I$(top_builddir)/include
 AM_CFLAGS = $(PYTHON_CFLAGS)
 AM_LDFLAGS = -module -avoid-version
 
+installed_list = installed.list
+
 setup.cfg: Makefile
        $(AM_V_GEN)
        $(AM_V_at)echo "[kdumpfile]" > $@
@@ -39,12 +41,20 @@ all-local: setup.cfg
 install-exec-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py install \
                --install-purelib $(pythondir) \
-               --install-platlib $(pyexecdir)
+               --install-platlib $(pyexecdir) \
+               --record $(installed_list)
+
+uninstall-local: $(installed_list)
+       while read f ; do \
+           $(LIBTOOL) --mode=uninstall rm -f "$$f" ; \
+       done < $<
 
 mostlyclean-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py clean --all
        rm $<
 
+CLEANFILES = $(installed_list)
+
 check_LTLIBRARIES = _test_addrxlat.la
 
 _test_addrxlat_la_SOURCES = test_addrxlat.c
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -560,6 +560,8 @@ top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -I$(top_builddir)/include
 AM_CFLAGS = $(PYTHON_CFLAGS)
 AM_LDFLAGS = -module -avoid-version
+installed_list = installed.list
+CLEANFILES = $(installed_list)
 check_LTLIBRARIES = _test_addrxlat.la
 _test_addrxlat_la_SOURCES = test_addrxlat.c
 _test_addrxlat_la_LDFLAGS = \
@@ -960,6 +962,7 @@ mostlyclean-generic:
        -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -1037,7 +1040,7 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am:
+uninstall-am: uninstall-local
 
 .MAKE: check-am install-am install-strip
 
@@ -1054,7 +1057,7 @@ uninstall-am:
        installdirs maintainer-clean maintainer-clean-generic \
        mostlyclean mostlyclean-compile mostlyclean-generic \
        mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am \
-       recheck tags tags-am uninstall uninstall-am
+       recheck tags tags-am uninstall uninstall-am uninstall-local
 
 .PRECIOUS: Makefile
 
@@ -1075,7 +1078,13 @@ all-local: setup.cfg
 install-exec-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py install \
                --install-purelib $(pythondir) \
-               --install-platlib $(pyexecdir)
+               --install-platlib $(pyexecdir) \
+               --record $(installed_list)
+
+uninstall-local: $(installed_list)
+       while read f ; do \
+           $(LIBTOOL) --mode=uninstall rm -f "$$f" ; \
+       done < $<
 
 mostlyclean-local: setup.cfg
        $(PYTHON) $(srcdir)/setup.py clean --all
++++++ libkdumpfile-use-python-distutils.patch ++++++
++++ 947 lines (skipped)


Reply via email to