[packages/libcomps] - up to 0.1.18, python 2 support removed upstream

baggins baggins at pld-linux.org
Fri Apr 1 13:39:56 CEST 2022


commit 959785be5d7362c16bbc01dd9f5b761c91f46066
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Apr 1 13:39:27 2022 +0200

    - up to 0.1.18, python 2 support removed upstream

 libcomps-build.patch     |  2 +-
 libcomps.spec            | 90 ++++++------------------------------------------
 python-install-dir.patch | 11 ------
 3 files changed, 11 insertions(+), 92 deletions(-)
---
diff --git a/libcomps.spec b/libcomps.spec
index 4d72941..8b1ecd3 100644
--- a/libcomps.spec
+++ b/libcomps.spec
@@ -5,37 +5,27 @@
 #
 # Conditional build:
 %bcond_without	doc	# don't build (doxygen and sphinx) docs
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
 
 Summary:	Comps XML file manipulation library
 Summary(pl.UTF-8):	Biblioteka operacji na plikach Comps XML
 Name:		libcomps
-Version:	0.1.15
-Release:	3
+Version:	0.1.18
+Release:	1
 License:	GPL v2+
 Group:		Libraries
 #Source0Download: https://github.com/rpm-software-management/libcomps/releases
-Source0:	https://github.com/rpm-software-management/libcomps/archive/%{name}-%{version}.tar.gz
-# Source0-md5:	5e899d213a28496f3b37236b47293bdf
+Source0:	https://github.com/rpm-software-management/libcomps/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	68cba4a88933667cb6c2c1f496ad014d
 Patch0:		%{name}-build.patch
-Patch1:		python-install-dir.patch
 URL:		https://github.com/rpm-software-management/libcomps
 BuildRequires:	check-devel
 BuildRequires:	cmake >= 2.6
 %{?with_doc:BuildRequires:	doxygen}
 BuildRequires:	expat-devel >= 1.95
 BuildRequires:	libxml2-devel >= 2.0
-%if %{with python2}
-BuildRequires:	python-devel
-BuildRequires:	python-modules
-%{?with_doc:BuildRequires:	sphinx-pdg-2}
-%endif
-%if %{with python3}
 BuildRequires:	python3-devel
 BuildRequires:	python3-modules
 %{?with_doc:BuildRequires:	sphinx-pdg}
-%endif
 BuildRequires:	rpm-pythonprov
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -63,18 +53,6 @@ Development files for libcomps library
 %description devel -l pl.UTF-8
 Pliki programistyczne biblioteki libcomps.
 
-%package -n python-libcomps
-Summary:	Python 2.x bindings for libcomps library
-Summary(pl.UTF-8):	Wiązania Pythona 2.x do biblioteki libcomps
-Group:		Libraries/Python
-Requires:	%{name} = %{version}-%{release}
-
-%description -n python-libcomps
-Python 2.x bindings for libcomps library.
-
-%description -n python-libcomps -l pl.UTF-8
-Wiązania Pythona 2.x do biblioteki libcomps.
-
 %package -n python3-libcomps
 Summary:	Python 3.x bindings for libcomps library
 Summary(pl.UTF-8):	Wiązania Pythona 3.x do biblioteki libcomps
@@ -88,65 +66,30 @@ Python 3.x bindings for libcomps library.
 Wiązania Pythona 3.x do biblioteki libcomps.
 
 %prep
-%setup -qn %{name}-%{name}-%{version}
+%setup -q
 %patch0 -p1
-%patch1 -p1
 
 %build
 install -d build
 cd build
 %cmake ../libcomps \
-	-DENABLE_TESTS:BOOL=NO \
-	-DPYTHON_DESIRED:STRING=2 \
-	-DPYTHON_INSTALL_DIR="%{py_sitedir}" \
-	-DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-2 \
-	-DCMAKE_CXX_COMPILER_WORKS=1 \
-	-DCMAKE_CXX_COMPILER="%{__cc}"
+	-DENABLE_TESTS:BOOL=NO
 
 %{__make}
-%{__make} docs
 %{__make} pydocs
-cd ..
-
-%if %{with python3}
-install -d build-py3
-cd build-py3
-%cmake ../libcomps \
-	-DENABLE_TESTS:BOOL=NO \
-	-DPYTHON_DESIRED:STRING=3 \
-	-DPYTHON_INSTALL_DIR="%{py3_sitedir}" \
-	-DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3 \
-	-DCMAKE_CXX_COMPILER_WORKS=1 \
-	-DCMAKE_CXX_COMPILER="%{__cc}"
-
-%{__make}
-%{__make} pydocs
-cd ..
-%endif
-
 %if %{with tests}
-%{__make} -C build test
-%if %{with python3}
-%{__make} -C build-py3 pytest
-%endif
+%{__make} test
 %endif
 
+
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} -C build install \
-	DESTDIR=$RPM_BUILD_ROOT
 
-%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
-%py_comp $RPM_BUILD_ROOT%{py_sitedir}
-%py_postclean
-
-%if %{with python3}
-%{__make} -C build-py3 install \
+%{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
-%endif
 
 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
 %{__sed} -e 's,^prefix=.*,prefix=%{_prefix},' \
@@ -169,28 +112,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%doc build/docs/libcomps-doc/html/*
 %attr(755,root,root) %{_libdir}/libcomps.so
 %{_includedir}/libcomps
 %{_pkgconfigdir}/libcomps.pc
 
-%if %{with python2}
-%files -n python-libcomps
-%defattr(644,root,root,755)
-%doc build/src/python/docs/html/{*.html,*.js,_static}
-%dir %{py_sitedir}/libcomps
-%{py_sitedir}/libcomps/__init__.py[co]
-%attr(755,root,root) %{py_sitedir}/libcomps/_libpycomps.so
-%{py_sitedir}/libcomps-*-py*.egg-info
-%endif
-
-%if %{with python3}
 %files -n python3-libcomps
-%doc build-py3/src/python/docs/html/{*.html,*.js,_static}
+%doc build/src/python/docs/html/{*.html,*.js,_static}
 %defattr(644,root,root,755)
 %dir %{py3_sitedir}/libcomps
 %{py3_sitedir}/libcomps/__init__.py
 %attr(755,root,root) %{py3_sitedir}/libcomps/_libpycomps.so
 %{py3_sitedir}/libcomps/__pycache__
 %{py3_sitedir}/libcomps-*-py*.egg-info
-%endif
diff --git a/libcomps-build.patch b/libcomps-build.patch
index df99993..369266b 100644
--- a/libcomps-build.patch
+++ b/libcomps-build.patch
@@ -7,5 +7,5 @@ diff -urNp -x '*.orig' libcomps-libcomps-0.1.11.org/libcomps/src/python/docs/CMa
  include(../pycopy.cmake)
 -add_custom_command(TARGET pydocs PRE_BUILD COMMAND set -E $ENV{LD_LIBRARY_PATH} "${LIBCOMPS_OUT}:$ENV{LD_LIBRARY_PATH}")
  
- add_custom_command(TARGET pydocs COMMAND python${pversion} ${SPHINX_EXECUTABLE} -E -b html
+ add_custom_command(TARGET pydocs COMMAND ${PYTHON_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html
                                    "${CMAKE_CURRENT_SOURCE_DIR}/doc-sources/"
diff --git a/python-install-dir.patch b/python-install-dir.patch
deleted file mode 100644
index b1bd0be..0000000
--- a/python-install-dir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- libcomps-libcomps-0.1.15/libcomps/src/python/src/CMakeLists.txt~	2020-03-31 11:39:29.000000000 +0200
-+++ libcomps-libcomps-0.1.15/libcomps/src/python/src/CMakeLists.txt	2021-03-11 22:02:58.111049060 +0100
-@@ -115,8 +115,6 @@
-     INSTALL(FILES libcomps/__init__.py DESTINATION libcomps/src/python/src/libcomps)
-     INSTALL(TARGETS pycomps LIBRARY DESTINATION libcomps/src/python/src/libcomps)
- ELSE ()
--    EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
--
-     INSTALL(FILES ${pycomps_SRCDIR}/libcomps/__init__.py DESTINATION ${PYTHON_INSTALL_DIR}/libcomps)
-     #INSTALL(FILES ${pycomps_SRCDIR}/tests/__test.py DESTINATION
-     #              ${PYTHON_INSTALL_DIR}/libcomps/)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libcomps.git/commitdiff/959785be5d7362c16bbc01dd9f5b761c91f46066



More information about the pld-cvs-commit mailing list