From 0a1a7326d50e447e9d6d5cedfa59b20b754fb6164b5f5bdfd0bf48d67acc3f47 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 10 Jul 2024 20:05:21 +0000 Subject: [PATCH 1/3] - Add libcomps-c99.patch in order to avoid C99 violations which are errors by default with GCC 14. [boo#1221700] If the request is OK, please also forward it to Factory soonish so that we can switch the default compiler soon. OBS-URL: https://build.opensuse.org/package/show/system:packagemanager:dnf/libcomps?expand=0&rev=39 --- .gitattributes | 23 ++++++ .gitignore | 1 + libcomps-0.1.20.tar.gz | 3 + libcomps-c99.patch | 48 +++++++++++++ libcomps.changes | 138 ++++++++++++++++++++++++++++++++++++ libcomps.spec | 154 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 367 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 libcomps-0.1.20.tar.gz create mode 100644 libcomps-c99.patch create mode 100644 libcomps.changes create mode 100644 libcomps.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/libcomps-0.1.20.tar.gz b/libcomps-0.1.20.tar.gz new file mode 100644 index 0000000..3e6798e --- /dev/null +++ b/libcomps-0.1.20.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e93299e34da26c14b210f48f324c0c2540515f79f9d748311139f77498317a18 +size 3710869 diff --git a/libcomps-c99.patch b/libcomps-c99.patch new file mode 100644 index 0000000..751f2b5 --- /dev/null +++ b/libcomps-c99.patch @@ -0,0 +1,48 @@ +From a71bce7e62990550a57688e51b14eb82d6de196b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Tue, 2 Jan 2024 08:32:55 +0100 +Subject: [PATCH] Fix build: use correct variable for category and env +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Upstream: this is a backport of a commit actually pushed upstream +References: boo#1221700 + + +Fixes: +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocCategory *’ +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocEnv *’ + +For: https://fedoraproject.org/wiki/Changes/PortingToModernC +(https://fedoraproject.org/wiki/Toolchain/PortingToModernC) +(https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/blob/main/logs/l/libcomps.log) +--- + libcomps/tests/check_parse.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libcomps/tests/check_parse.c b/libcomps/tests/check_parse.c +index 9c2874b..f279708 100644 +--- a/libcomps/tests/check_parse.c ++++ b/libcomps/tests/check_parse.c +@@ -585,8 +585,8 @@ START_TEST(test_arch) + list = comps_doc_categories(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocCategory*)it->comps_obj; +- str = (COMPS_Str*)comps_doccategory_get_id(g); ++ c = (COMPS_DocCategory*)it->comps_obj; ++ str = (COMPS_Str*)comps_doccategory_get_id(c); + ck_assert_msg(strcmp(str->val, cats[0][x]) == 0, "%s != %s", + str->val, cats[0][x]); + COMPS_OBJECT_DESTROY(str); +@@ -605,8 +605,8 @@ START_TEST(test_arch) + list = comps_doc_environments(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocEnv*)it->comps_obj; +- str = (COMPS_Str*)comps_docenv_get_id(g); ++ e = (COMPS_DocEnv*)it->comps_obj; ++ str = (COMPS_Str*)comps_docenv_get_id(e); + ck_assert_msg(strcmp(str->val, envs[0][x]) == 0, "%s != %s", + str->val, envs[0][x]); + COMPS_OBJECT_DESTROY(str); diff --git a/libcomps.changes b/libcomps.changes new file mode 100644 index 0000000..5213c70 --- /dev/null +++ b/libcomps.changes @@ -0,0 +1,138 @@ +------------------------------------------------------------------- +Wed Jul 10 14:05:56 UTC 2024 - Martin Jambor + +- Add libcomps-c99.patch in order to avoid C99 violations which are + errors by default with GCC 14. [boo#1221700] + +------------------------------------------------------------------- +Mon Dec 4 14:34:19 UTC 2023 - Ana Guerrero + +- Add BuildRequires on python-setuptools to create python egg and + install it properly. Previously this was pulled by python-Sphinx + in the build environment. +- Use %license instead of %doc + +------------------------------------------------------------------- +Sat Nov 4 18:18:46 UTC 2023 - Neal Gompa + +- Update to 0.1.20 + + Fixes of xml parsing + + Fix non-optimized builds by removing inline keyword + + Use Py_hash_t instead of long + +------------------------------------------------------------------- +Fri Feb 24 15:38:14 UTC 2023 - Bruno Pitrus + +- Precompile python bytecode (boo#1208151) + +------------------------------------------------------------------- +Sat Sep 24 09:03:42 UTC 2022 - Dirk Müller + +- update to 0.1.19: + * handle upload to pypi + +------------------------------------------------------------------- +Wed Nov 3 10:42:20 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.18 + + Fix several covscan warnings + +------------------------------------------------------------------- +Fri Aug 27 03:36:32 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.17 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Don't print empty requires + + Fix memory leaks and resource leaks + + Remove Python 2 support +- Drop patch included in this release + + Patch: fix-sphinx.patch + +------------------------------------------------------------------- +Wed Jun 9 08:47:28 UTC 2021 - Martin Liška + +- Add upstream patch fix-sphinx.patch which fixes build with Sphinx 4.x. + +------------------------------------------------------------------- +Tue Apr 13 12:40:10 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.16 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Fixes for leaks and crashes + +------------------------------------------------------------------- +Sat Jun 6 22:27:58 UTC 2020 - Neal Gompa + +- Upgrade to 0.1.15 + + Do not skip type=mandatory in xml output and test it (rh#1771224) + + Remove unused global variable UnfoObjListIt (rh#1793424) + + Make inline function __comps_objmrtree_all also static (rh#1793424) + +------------------------------------------------------------------- +Tue Dec 3 13:02:29 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.14 + + Fix reference to versioned libcomps.so + +------------------------------------------------------------------- +Tue Dec 3 12:42:44 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.13 + + Fix massively broken libcomps pkgconfig file + + Change libcomps soversion to use only the version major + +------------------------------------------------------------------- +Sun Dec 1 15:46:52 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.12 + + Fix order of asserts() in unit test (rh#1713220) + + Fix Python method descriptors for Python 3.8 (rh#1734777) + + Refactor pkgconfig file generation and install properly + + Fix segfault when converting empty dict to string (rh#1757959) + + Add missing python metadata to python3-libcomps + + Refactor building and installing Python bindings + +------------------------------------------------------------------- +Sun Mar 31 14:53:26 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.11 + + Fix missing braces + + Fix UAF in comps_objmrtree_unite function +- Drop merged patches + * 0001-Fix-Missing-braces.patch + * 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch + * libcomps-0.1.7-Add-zlib-as-an-explicit-dependency.patch + +------------------------------------------------------------------- +Thu Feb 7 15:45:43 UTC 2019 - Jan Engelhardt + +- Update RPM groups + +------------------------------------------------------------------- +Sun Feb 3 19:07:56 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.9 + + Fix memory leaks + + Remove unused code +- Backport fix for logic error + * Patch: 0001-Fix-Missing-braces.patch +- Backport fix for CVE-2019-3817 (boo#1122841) + * Patch: 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch +- Drop Python 2 subpackage +- Adjust changes entries to use full author identities + +------------------------------------------------------------------- +Sun Sep 17 19:12:56 UTC 2017 - Bernhard Wiedemann + +- Drop environment.pickle from doc to make build reproducible + +------------------------------------------------------------------- +Sun Aug 13 19:12:57 UTC 2017 - Neal Gompa + +- Upgrade to 0.1.8 + +------------------------------------------------------------------- +Mon Feb 1 06:43:39 UTC 2016 - Neal Gompa + +- Initial packaging of libcomps based on Mageia packaging + diff --git a/libcomps.spec b/libcomps.spec new file mode 100644 index 0000000..203f5f6 --- /dev/null +++ b/libcomps.spec @@ -0,0 +1,154 @@ +# +# spec file for package libcomps +# +# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2021 Neal Gompa . +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define major 0 +%define minor 1 +%define patch 20 +%define libname %{name}%{major} +%define devname %{name}-devel + +Name: libcomps +Version: %{major}.%{minor}.%{patch} +Release: 0 +Summary: Comps XML file manipulation library +License: GPL-2.0-or-later +Group: Development/Libraries/C and C++ +URL: https://github.com/rpm-software-management/libcomps +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: libcomps-c99.patch + +BuildRequires: %{python_module setuptools} +BuildRequires: check-devel +BuildRequires: cmake +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: libexpat-devel +BuildRequires: libxml2-devel +BuildRequires: python-rpm-macros +BuildRequires: zlib-devel + +# prevent provides from nonstandard paths: +%define __provides_exclude ^(%{python3_sitearch}/.*\\.so)$ + +%description +Libcomps is library for structure-like manipulation with content of +comps XML files. Supports read/write XML file, structure(s) modification. + +%package -n %{libname} +Summary: Libraries for %{name} +Group: System/Libraries + +%description -n %{libname} +Libraries for %{name} + +%package -n %{devname} +Summary: Development files for the libcomps library +Group: Development/Libraries/C and C++ +Requires: %{libname}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n %{devname} +This package provides the development files for %{name}. + +%package doc +Summary: Documentation files for libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: doxygen + +%description doc +Documentation files for libcomps library. + +%package -n python-libcomps-doc +Summary: Documentation files for python bindings libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: python3-Sphinx + +%description -n python-libcomps-doc +Documentation files for python bindings libcomps library. + +%package -n python3-libcomps +Summary: Python 3 bindings for libcomps library +Group: Development/Libraries/Python +BuildRequires: python3-devel +Requires: %{libname}%{?_isa} = %{version}-%{release} +# There is no more Python 2 subpackage +Obsoletes: python2-libcomps < 0.1.9 + +%description -n python3-libcomps +This package provides the Python 3 bindings for libcomps library. + +%prep +%autosetup -p1 + +%build +%cmake -DPYTHON_DESIRED:STRING=3 ../libcomps/ +%make_build +make docs +make pydocs + +%check +pushd ./build +make test +popd + +%install +pushd ./build +%make_install +popd + +mkdir -p %{buildroot}%{_datadir}/doc/libcomps/ +cp -a build/docs/libcomps-doc/html %{buildroot}%{_datadir}/doc/libcomps/ + +mkdir -p %{buildroot}%{_datadir}/doc/python-libcomps/ +rm build/src/python/docs/html/.doctrees/environment.pickle +cp -a build/src/python/docs/html %{buildroot}%{_datadir}/doc/python-libcomps/ + +%python_compileall +%fdupes %{buildroot}%{python3_sitearch} + +%fdupes %{buildroot}%{_datadir}/doc/libcomps +%fdupes %{buildroot}%{_datadir}/doc/python-libcomps + +%post -n %{libname} -p /sbin/ldconfig + +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%{_libdir}/libcomps.so.%{major} +%doc README.md +%license COPYING + +%files -n %{devname} +%{_libdir}/libcomps.so +%{_libdir}/pkgconfig/libcomps.pc +%{_includedir}/* + +%files doc +%doc %{_datadir}/doc/libcomps + +%files -n python-libcomps-doc +%doc %{_datadir}/doc/python-libcomps + +%files -n python3-libcomps +%{python3_sitearch}/libcomps/ +%{python3_sitearch}/libcomps-%{version}*-info + +%changelog -- 2.51.1 From 3300cf12326a8dd7aa059c78a55f95935640ead91bfd52d805c02eb7447419cc Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 16 Jul 2025 13:48:37 +0000 Subject: [PATCH 2/3] - Update to version 0.1.21: + tests: Don't print parsing errors during tests + tests: Unify formatting of current test announcements + build: Restore compatiblity with libxml2-2.12.0 + Fix build: use correct variable for category and env - Drop libcomps-c99.patch: fixed upstream. - Add 702ec142.patch: Upstream commit, support builds with cmake 4.x. OBS-URL: https://build.opensuse.org/package/show/system:packagemanager:dnf/libcomps?expand=0&rev=41 --- .gitattributes | 23 ++++++ .gitignore | 1 + 702ec142.patch | 129 ++++++++++++++++++++++++++++++++++ libcomps-0.1.20.tar.gz | 3 + libcomps-0.1.21.tar.gz | 3 + libcomps-c99.patch | 48 +++++++++++++ libcomps.changes | 150 +++++++++++++++++++++++++++++++++++++++ libcomps.spec | 154 +++++++++++++++++++++++++++++++++++++++++ 8 files changed, 511 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 702ec142.patch create mode 100644 libcomps-0.1.20.tar.gz create mode 100644 libcomps-0.1.21.tar.gz create mode 100644 libcomps-c99.patch create mode 100644 libcomps.changes create mode 100644 libcomps.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/702ec142.patch b/702ec142.patch new file mode 100644 index 0000000..4b7b24b --- /dev/null +++ b/702ec142.patch @@ -0,0 +1,129 @@ +From 702ec1423fb9b53244b902923fd87ef19b63a7f5 Mon Sep 17 00:00:00 2001 +From: Moritz Haase +Date: Mon, 23 Jun 2025 08:32:18 +0200 +Subject: [PATCH] libcomps: Support builds with CMake 4+ + +- Bump minimum required version to 3.10, the lowest one CMake 4+ don't complain + about. It's also possible to use 3.5, but that results in a deprecation + warning. The 'cmake_minimum_required()' invocation has been moved before the + initial 'project()' call as CMake complained about the wrong order. + +- Set policy CMP0148 [0] to OLD to unblock build without additional changes. + Eventually, the usage of the 'PythonInterp' and 'PythonLibs' find modules will + be need to be updated to use 'Python3' instead. + +- Set policy CMP0175 [1] to NEW and fix warnings. + +- Fix the 'No TARGET ... has been created in this directory' error in + 'src/python'. + +- Fix 'Utility target must not be used as the target of a + target_link_libraries call' errors (see [2]). + +- Mark the 'check' library as required when tests are enabled to prevent test + targets from linking a non-existing library in case it's not installed. + +[0]: https://cmake.org/cmake/help/latest/policy/CMP0148.html +[1]: https://cmake.org/cmake/help/latest/policy/CMP0175.html +[2]: https://cmake.org/cmake/help/latest/policy/CMP0039.html +--- + README.md | 3 +-- + libcomps/CMakeLists.txt | 7 +++++-- + libcomps/src/python/docs/CMakeLists.txt | 3 ++- + libcomps/src/python/pycopy.cmake | 7 ++++--- + libcomps/tests/CMakeLists.txt | 2 -- + 5 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/README.md b/README.md +index 7f8314d..24bf8a2 100644 +--- a/README.md ++++ b/README.md +@@ -27,7 +27,7 @@ for python bindings: + + for C library tests: + +-* check http://check.sourceforge.net/ ++* check https://github.com/libcheck/check + + for documentation build: + +@@ -128,4 +128,3 @@ Here's the most direct way to get your work merged into the project. + + 1. Push the branch to your fork + 1. Send a pull request for your branch +- +diff --git a/libcomps/CMakeLists.txt b/libcomps/CMakeLists.txt +index d8d628a..3957e63 100644 +--- a/libcomps/CMakeLists.txt ++++ b/libcomps/CMakeLists.txt +@@ -1,5 +1,8 @@ ++cmake_minimum_required (VERSION 3.10) + project(libcomps C) +-cmake_minimum_required (VERSION 2.8.10) ++ ++cmake_policy(SET CMP0148 OLD) ++cmake_policy(SET CMP0175 NEW) + + include (GNUInstallDirs) + include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +@@ -32,7 +35,7 @@ include_directories("${PROJECT_SOURCE_DIR}/src") + #include_directories("${PROJECT_SOURCE_DIR}/src/libcomps") + + if (ENABLE_TESTS) +- find_library(CHECK_LIBRARY NAMES check) ++ find_library(CHECK_LIBRARY REQUIRED NAMES check) + endif() + find_library(EXPAT_LIBRARY NAMES expat) + +diff --git a/libcomps/src/python/docs/CMakeLists.txt b/libcomps/src/python/docs/CMakeLists.txt +index c4b388c..9c92b2d 100644 +--- a/libcomps/src/python/docs/CMakeLists.txt ++++ b/libcomps/src/python/docs/CMakeLists.txt +@@ -26,7 +26,8 @@ add_dependencies(pydocs pycomps) + 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_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html ++add_custom_command(TARGET pydocs POST_BUILD ++ COMMAND ${PYTHON_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html + "${CMAKE_CURRENT_SOURCE_DIR}/doc-sources/" + "${CMAKE_CURRENT_BINARY_DIR}/html/" + COMMENT "LDLP $ENV{LD_LIBRARY_PATH}") +diff --git a/libcomps/src/python/pycopy.cmake b/libcomps/src/python/pycopy.cmake +index b22f835..0e99e38 100644 +--- a/libcomps/src/python/pycopy.cmake ++++ b/libcomps/src/python/pycopy.cmake +@@ -6,9 +6,10 @@ math (EXPR len "${len} - 1") + + #set(pycopy "py${pversion}-copy") + +-#if (NOT TARGET ${pycopy}) ++if (NOT TARGET ${pycopy}) ++ add_custom_target(${pycopy} DEPENDS pycomps) ++endif() + +-#add_custom_target(${pycopy} DEPENDS pycomps) + set (pycomps_SRCDIR "${PROJECT_SOURCE_DIR}/src/python/src/") + set (pycomps_TESTDIR "${PROJECT_SOURCE_DIR}/src/python/tests/") + set (pycomps_LIBPATH ${PYCOMPS_LIB_PATH})#"${PROJECT_BINARY_DIR}/src/python/src/python${pversion}") +@@ -16,7 +17,7 @@ set (pycomps_LIBPATH ${PYCOMPS_LIB_PATH})#"${PROJECT_BINARY_DIR}/src/python/src/ + #add_custom_command(TARGET pycopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E + # make_directory "${CP_DST}") + +-add_custom_command(TARGET ${pycopy} COMMAND ${CMAKE_COMMAND} -E ++add_custom_command(TARGET ${pycopy} POST_BUILD COMMAND ${CMAKE_COMMAND} -E + make_directory ${pycomps_LIBPATH}/libcomps/comps/) + + foreach(x RANGE 0 ${len}) +diff --git a/libcomps/tests/CMakeLists.txt b/libcomps/tests/CMakeLists.txt +index 23ced74..9d6e428 100644 +--- a/libcomps/tests/CMakeLists.txt ++++ b/libcomps/tests/CMakeLists.txt +@@ -87,7 +87,5 @@ add_custom_target(test_parse_run + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS test_parse + COMMENT "Running comps_parse test") +-target_link_libraries(test_parse_run libcomps) +-target_link_libraries(test_comps_run libcomps) + + add_dependencies(ctest test_comps_run test_parse_run) diff --git a/libcomps-0.1.20.tar.gz b/libcomps-0.1.20.tar.gz new file mode 100644 index 0000000..3e6798e --- /dev/null +++ b/libcomps-0.1.20.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e93299e34da26c14b210f48f324c0c2540515f79f9d748311139f77498317a18 +size 3710869 diff --git a/libcomps-0.1.21.tar.gz b/libcomps-0.1.21.tar.gz new file mode 100644 index 0000000..d0f26a4 --- /dev/null +++ b/libcomps-0.1.21.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d7555ed795458f3799d57cceccb096634c38461c3db7cb1739d42c038b2785 +size 3711111 diff --git a/libcomps-c99.patch b/libcomps-c99.patch new file mode 100644 index 0000000..751f2b5 --- /dev/null +++ b/libcomps-c99.patch @@ -0,0 +1,48 @@ +From a71bce7e62990550a57688e51b14eb82d6de196b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Tue, 2 Jan 2024 08:32:55 +0100 +Subject: [PATCH] Fix build: use correct variable for category and env +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Upstream: this is a backport of a commit actually pushed upstream +References: boo#1221700 + + +Fixes: +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocCategory *’ +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocEnv *’ + +For: https://fedoraproject.org/wiki/Changes/PortingToModernC +(https://fedoraproject.org/wiki/Toolchain/PortingToModernC) +(https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/blob/main/logs/l/libcomps.log) +--- + libcomps/tests/check_parse.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libcomps/tests/check_parse.c b/libcomps/tests/check_parse.c +index 9c2874b..f279708 100644 +--- a/libcomps/tests/check_parse.c ++++ b/libcomps/tests/check_parse.c +@@ -585,8 +585,8 @@ START_TEST(test_arch) + list = comps_doc_categories(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocCategory*)it->comps_obj; +- str = (COMPS_Str*)comps_doccategory_get_id(g); ++ c = (COMPS_DocCategory*)it->comps_obj; ++ str = (COMPS_Str*)comps_doccategory_get_id(c); + ck_assert_msg(strcmp(str->val, cats[0][x]) == 0, "%s != %s", + str->val, cats[0][x]); + COMPS_OBJECT_DESTROY(str); +@@ -605,8 +605,8 @@ START_TEST(test_arch) + list = comps_doc_environments(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocEnv*)it->comps_obj; +- str = (COMPS_Str*)comps_docenv_get_id(g); ++ e = (COMPS_DocEnv*)it->comps_obj; ++ str = (COMPS_Str*)comps_docenv_get_id(e); + ck_assert_msg(strcmp(str->val, envs[0][x]) == 0, "%s != %s", + str->val, envs[0][x]); + COMPS_OBJECT_DESTROY(str); diff --git a/libcomps.changes b/libcomps.changes new file mode 100644 index 0000000..a078037 --- /dev/null +++ b/libcomps.changes @@ -0,0 +1,150 @@ +------------------------------------------------------------------- +Wed Jul 16 13:28:17 UTC 2025 - Dominique Leuenberger + +- Update to version 0.1.21: + + tests: Don't print parsing errors during tests + + tests: Unify formatting of current test announcements + + build: Restore compatiblity with libxml2-2.12.0 + + Fix build: use correct variable for category and env +- Drop libcomps-c99.patch: fixed upstream. +- Add 702ec142.patch: Upstream commit, support builds with cmake + 4.x. + +------------------------------------------------------------------- +Wed Jul 10 14:05:56 UTC 2024 - Martin Jambor + +- Add libcomps-c99.patch in order to avoid C99 violations which are + errors by default with GCC 14. [boo#1221700] + +------------------------------------------------------------------- +Mon Dec 4 14:34:19 UTC 2023 - Ana Guerrero + +- Add BuildRequires on python-setuptools to create python egg and + install it properly. Previously this was pulled by python-Sphinx + in the build environment. +- Use %license instead of %doc + +------------------------------------------------------------------- +Sat Nov 4 18:18:46 UTC 2023 - Neal Gompa + +- Update to 0.1.20 + + Fixes of xml parsing + + Fix non-optimized builds by removing inline keyword + + Use Py_hash_t instead of long + +------------------------------------------------------------------- +Fri Feb 24 15:38:14 UTC 2023 - Bruno Pitrus + +- Precompile python bytecode (boo#1208151) + +------------------------------------------------------------------- +Sat Sep 24 09:03:42 UTC 2022 - Dirk Müller + +- update to 0.1.19: + * handle upload to pypi + +------------------------------------------------------------------- +Wed Nov 3 10:42:20 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.18 + + Fix several covscan warnings + +------------------------------------------------------------------- +Fri Aug 27 03:36:32 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.17 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Don't print empty requires + + Fix memory leaks and resource leaks + + Remove Python 2 support +- Drop patch included in this release + + Patch: fix-sphinx.patch + +------------------------------------------------------------------- +Wed Jun 9 08:47:28 UTC 2021 - Martin Liška + +- Add upstream patch fix-sphinx.patch which fixes build with Sphinx 4.x. + +------------------------------------------------------------------- +Tue Apr 13 12:40:10 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.16 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Fixes for leaks and crashes + +------------------------------------------------------------------- +Sat Jun 6 22:27:58 UTC 2020 - Neal Gompa + +- Upgrade to 0.1.15 + + Do not skip type=mandatory in xml output and test it (rh#1771224) + + Remove unused global variable UnfoObjListIt (rh#1793424) + + Make inline function __comps_objmrtree_all also static (rh#1793424) + +------------------------------------------------------------------- +Tue Dec 3 13:02:29 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.14 + + Fix reference to versioned libcomps.so + +------------------------------------------------------------------- +Tue Dec 3 12:42:44 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.13 + + Fix massively broken libcomps pkgconfig file + + Change libcomps soversion to use only the version major + +------------------------------------------------------------------- +Sun Dec 1 15:46:52 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.12 + + Fix order of asserts() in unit test (rh#1713220) + + Fix Python method descriptors for Python 3.8 (rh#1734777) + + Refactor pkgconfig file generation and install properly + + Fix segfault when converting empty dict to string (rh#1757959) + + Add missing python metadata to python3-libcomps + + Refactor building and installing Python bindings + +------------------------------------------------------------------- +Sun Mar 31 14:53:26 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.11 + + Fix missing braces + + Fix UAF in comps_objmrtree_unite function +- Drop merged patches + * 0001-Fix-Missing-braces.patch + * 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch + * libcomps-0.1.7-Add-zlib-as-an-explicit-dependency.patch + +------------------------------------------------------------------- +Thu Feb 7 15:45:43 UTC 2019 - Jan Engelhardt + +- Update RPM groups + +------------------------------------------------------------------- +Sun Feb 3 19:07:56 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.9 + + Fix memory leaks + + Remove unused code +- Backport fix for logic error + * Patch: 0001-Fix-Missing-braces.patch +- Backport fix for CVE-2019-3817 (boo#1122841) + * Patch: 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch +- Drop Python 2 subpackage +- Adjust changes entries to use full author identities + +------------------------------------------------------------------- +Sun Sep 17 19:12:56 UTC 2017 - Bernhard Wiedemann + +- Drop environment.pickle from doc to make build reproducible + +------------------------------------------------------------------- +Sun Aug 13 19:12:57 UTC 2017 - Neal Gompa + +- Upgrade to 0.1.8 + +------------------------------------------------------------------- +Mon Feb 1 06:43:39 UTC 2016 - Neal Gompa + +- Initial packaging of libcomps based on Mageia packaging + diff --git a/libcomps.spec b/libcomps.spec new file mode 100644 index 0000000..2262396 --- /dev/null +++ b/libcomps.spec @@ -0,0 +1,154 @@ +# +# spec file for package libcomps +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2021 Neal Gompa . +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define major 0 +%define minor 1 +%define patch 21 +%define libname %{name}%{major} +%define devname %{name}-devel + +Name: libcomps +Version: %{major}.%{minor}.%{patch} +Release: 0 +Summary: Comps XML file manipulation library +License: GPL-2.0-or-later +Group: Development/Libraries/C and C++ +URL: https://github.com/rpm-software-management/libcomps +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: %{url}/commit/702ec142.patch + +BuildRequires: %{python_module setuptools} +BuildRequires: check-devel +BuildRequires: cmake +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: libexpat-devel +BuildRequires: libxml2-devel +BuildRequires: python-rpm-macros +BuildRequires: zlib-devel + +# prevent provides from nonstandard paths: +%define __provides_exclude ^(%{python3_sitearch}/.*\\.so)$ + +%description +Libcomps is library for structure-like manipulation with content of +comps XML files. Supports read/write XML file, structure(s) modification. + +%package -n %{libname} +Summary: Libraries for %{name} +Group: System/Libraries + +%description -n %{libname} +Libraries for %{name} + +%package -n %{devname} +Summary: Development files for the libcomps library +Group: Development/Libraries/C and C++ +Requires: %{libname}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n %{devname} +This package provides the development files for %{name}. + +%package doc +Summary: Documentation files for libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: doxygen + +%description doc +Documentation files for libcomps library. + +%package -n python-libcomps-doc +Summary: Documentation files for python bindings libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: python3-Sphinx + +%description -n python-libcomps-doc +Documentation files for python bindings libcomps library. + +%package -n python3-libcomps +Summary: Python 3 bindings for libcomps library +Group: Development/Libraries/Python +BuildRequires: python3-devel +Requires: %{libname}%{?_isa} = %{version}-%{release} +# There is no more Python 2 subpackage +Obsoletes: python2-libcomps < 0.1.9 + +%description -n python3-libcomps +This package provides the Python 3 bindings for libcomps library. + +%prep +%autosetup -p1 + +%build +%cmake -DPYTHON_DESIRED:STRING=3 ../libcomps/ +%make_build +make docs +make pydocs + +%check +pushd ./build +make test +popd + +%install +pushd ./build +%make_install +popd + +mkdir -p %{buildroot}%{_datadir}/doc/libcomps/ +cp -a build/docs/libcomps-doc/html %{buildroot}%{_datadir}/doc/libcomps/ + +mkdir -p %{buildroot}%{_datadir}/doc/python-libcomps/ +rm build/src/python/docs/html/.doctrees/environment.pickle +cp -a build/src/python/docs/html %{buildroot}%{_datadir}/doc/python-libcomps/ + +%python_compileall +%fdupes %{buildroot}%{python3_sitearch} + +%fdupes %{buildroot}%{_datadir}/doc/libcomps +%fdupes %{buildroot}%{_datadir}/doc/python-libcomps + +%post -n %{libname} -p /sbin/ldconfig + +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%{_libdir}/libcomps.so.%{major} +%doc README.md +%license COPYING + +%files -n %{devname} +%{_libdir}/libcomps.so +%{_libdir}/pkgconfig/libcomps.pc +%{_includedir}/* + +%files doc +%doc %{_datadir}/doc/libcomps + +%files -n python-libcomps-doc +%doc %{_datadir}/doc/python-libcomps + +%files -n python3-libcomps +%{python3_sitearch}/libcomps/ +%{python3_sitearch}/libcomps-%{version}*-info + +%changelog -- 2.51.1 From 212b9522304a61eb817712829830dd258556138e1cb41e155a487211c757ef9c Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 27 Aug 2025 13:15:08 +0000 Subject: [PATCH 3/3] - Add patch sphinx-build.patch now /usr/bin/sphinx-build uses alts. OBS-URL: https://build.opensuse.org/package/show/system:packagemanager:dnf/libcomps?expand=0&rev=43 --- .gitattributes | 23 ++++++ .gitignore | 1 + 702ec142.patch | 129 ++++++++++++++++++++++++++++++++++ libcomps-0.1.20.tar.gz | 3 + libcomps-0.1.21.tar.gz | 3 + libcomps-c99.patch | 48 +++++++++++++ libcomps.changes | 155 +++++++++++++++++++++++++++++++++++++++++ libcomps.spec | 155 +++++++++++++++++++++++++++++++++++++++++ sphinx-build.patch | 13 ++++ 9 files changed, 530 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 702ec142.patch create mode 100644 libcomps-0.1.20.tar.gz create mode 100644 libcomps-0.1.21.tar.gz create mode 100644 libcomps-c99.patch create mode 100644 libcomps.changes create mode 100644 libcomps.spec create mode 100644 sphinx-build.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/702ec142.patch b/702ec142.patch new file mode 100644 index 0000000..4b7b24b --- /dev/null +++ b/702ec142.patch @@ -0,0 +1,129 @@ +From 702ec1423fb9b53244b902923fd87ef19b63a7f5 Mon Sep 17 00:00:00 2001 +From: Moritz Haase +Date: Mon, 23 Jun 2025 08:32:18 +0200 +Subject: [PATCH] libcomps: Support builds with CMake 4+ + +- Bump minimum required version to 3.10, the lowest one CMake 4+ don't complain + about. It's also possible to use 3.5, but that results in a deprecation + warning. The 'cmake_minimum_required()' invocation has been moved before the + initial 'project()' call as CMake complained about the wrong order. + +- Set policy CMP0148 [0] to OLD to unblock build without additional changes. + Eventually, the usage of the 'PythonInterp' and 'PythonLibs' find modules will + be need to be updated to use 'Python3' instead. + +- Set policy CMP0175 [1] to NEW and fix warnings. + +- Fix the 'No TARGET ... has been created in this directory' error in + 'src/python'. + +- Fix 'Utility target must not be used as the target of a + target_link_libraries call' errors (see [2]). + +- Mark the 'check' library as required when tests are enabled to prevent test + targets from linking a non-existing library in case it's not installed. + +[0]: https://cmake.org/cmake/help/latest/policy/CMP0148.html +[1]: https://cmake.org/cmake/help/latest/policy/CMP0175.html +[2]: https://cmake.org/cmake/help/latest/policy/CMP0039.html +--- + README.md | 3 +-- + libcomps/CMakeLists.txt | 7 +++++-- + libcomps/src/python/docs/CMakeLists.txt | 3 ++- + libcomps/src/python/pycopy.cmake | 7 ++++--- + libcomps/tests/CMakeLists.txt | 2 -- + 5 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/README.md b/README.md +index 7f8314d..24bf8a2 100644 +--- a/README.md ++++ b/README.md +@@ -27,7 +27,7 @@ for python bindings: + + for C library tests: + +-* check http://check.sourceforge.net/ ++* check https://github.com/libcheck/check + + for documentation build: + +@@ -128,4 +128,3 @@ Here's the most direct way to get your work merged into the project. + + 1. Push the branch to your fork + 1. Send a pull request for your branch +- +diff --git a/libcomps/CMakeLists.txt b/libcomps/CMakeLists.txt +index d8d628a..3957e63 100644 +--- a/libcomps/CMakeLists.txt ++++ b/libcomps/CMakeLists.txt +@@ -1,5 +1,8 @@ ++cmake_minimum_required (VERSION 3.10) + project(libcomps C) +-cmake_minimum_required (VERSION 2.8.10) ++ ++cmake_policy(SET CMP0148 OLD) ++cmake_policy(SET CMP0175 NEW) + + include (GNUInstallDirs) + include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +@@ -32,7 +35,7 @@ include_directories("${PROJECT_SOURCE_DIR}/src") + #include_directories("${PROJECT_SOURCE_DIR}/src/libcomps") + + if (ENABLE_TESTS) +- find_library(CHECK_LIBRARY NAMES check) ++ find_library(CHECK_LIBRARY REQUIRED NAMES check) + endif() + find_library(EXPAT_LIBRARY NAMES expat) + +diff --git a/libcomps/src/python/docs/CMakeLists.txt b/libcomps/src/python/docs/CMakeLists.txt +index c4b388c..9c92b2d 100644 +--- a/libcomps/src/python/docs/CMakeLists.txt ++++ b/libcomps/src/python/docs/CMakeLists.txt +@@ -26,7 +26,8 @@ add_dependencies(pydocs pycomps) + 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_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html ++add_custom_command(TARGET pydocs POST_BUILD ++ COMMAND ${PYTHON_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html + "${CMAKE_CURRENT_SOURCE_DIR}/doc-sources/" + "${CMAKE_CURRENT_BINARY_DIR}/html/" + COMMENT "LDLP $ENV{LD_LIBRARY_PATH}") +diff --git a/libcomps/src/python/pycopy.cmake b/libcomps/src/python/pycopy.cmake +index b22f835..0e99e38 100644 +--- a/libcomps/src/python/pycopy.cmake ++++ b/libcomps/src/python/pycopy.cmake +@@ -6,9 +6,10 @@ math (EXPR len "${len} - 1") + + #set(pycopy "py${pversion}-copy") + +-#if (NOT TARGET ${pycopy}) ++if (NOT TARGET ${pycopy}) ++ add_custom_target(${pycopy} DEPENDS pycomps) ++endif() + +-#add_custom_target(${pycopy} DEPENDS pycomps) + set (pycomps_SRCDIR "${PROJECT_SOURCE_DIR}/src/python/src/") + set (pycomps_TESTDIR "${PROJECT_SOURCE_DIR}/src/python/tests/") + set (pycomps_LIBPATH ${PYCOMPS_LIB_PATH})#"${PROJECT_BINARY_DIR}/src/python/src/python${pversion}") +@@ -16,7 +17,7 @@ set (pycomps_LIBPATH ${PYCOMPS_LIB_PATH})#"${PROJECT_BINARY_DIR}/src/python/src/ + #add_custom_command(TARGET pycopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E + # make_directory "${CP_DST}") + +-add_custom_command(TARGET ${pycopy} COMMAND ${CMAKE_COMMAND} -E ++add_custom_command(TARGET ${pycopy} POST_BUILD COMMAND ${CMAKE_COMMAND} -E + make_directory ${pycomps_LIBPATH}/libcomps/comps/) + + foreach(x RANGE 0 ${len}) +diff --git a/libcomps/tests/CMakeLists.txt b/libcomps/tests/CMakeLists.txt +index 23ced74..9d6e428 100644 +--- a/libcomps/tests/CMakeLists.txt ++++ b/libcomps/tests/CMakeLists.txt +@@ -87,7 +87,5 @@ add_custom_target(test_parse_run + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS test_parse + COMMENT "Running comps_parse test") +-target_link_libraries(test_parse_run libcomps) +-target_link_libraries(test_comps_run libcomps) + + add_dependencies(ctest test_comps_run test_parse_run) diff --git a/libcomps-0.1.20.tar.gz b/libcomps-0.1.20.tar.gz new file mode 100644 index 0000000..3e6798e --- /dev/null +++ b/libcomps-0.1.20.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e93299e34da26c14b210f48f324c0c2540515f79f9d748311139f77498317a18 +size 3710869 diff --git a/libcomps-0.1.21.tar.gz b/libcomps-0.1.21.tar.gz new file mode 100644 index 0000000..d0f26a4 --- /dev/null +++ b/libcomps-0.1.21.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d7555ed795458f3799d57cceccb096634c38461c3db7cb1739d42c038b2785 +size 3711111 diff --git a/libcomps-c99.patch b/libcomps-c99.patch new file mode 100644 index 0000000..751f2b5 --- /dev/null +++ b/libcomps-c99.patch @@ -0,0 +1,48 @@ +From a71bce7e62990550a57688e51b14eb82d6de196b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Tue, 2 Jan 2024 08:32:55 +0100 +Subject: [PATCH] Fix build: use correct variable for category and env +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Upstream: this is a backport of a commit actually pushed upstream +References: boo#1221700 + + +Fixes: +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocCategory *’ +- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocEnv *’ + +For: https://fedoraproject.org/wiki/Changes/PortingToModernC +(https://fedoraproject.org/wiki/Toolchain/PortingToModernC) +(https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/blob/main/logs/l/libcomps.log) +--- + libcomps/tests/check_parse.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libcomps/tests/check_parse.c b/libcomps/tests/check_parse.c +index 9c2874b..f279708 100644 +--- a/libcomps/tests/check_parse.c ++++ b/libcomps/tests/check_parse.c +@@ -585,8 +585,8 @@ START_TEST(test_arch) + list = comps_doc_categories(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocCategory*)it->comps_obj; +- str = (COMPS_Str*)comps_doccategory_get_id(g); ++ c = (COMPS_DocCategory*)it->comps_obj; ++ str = (COMPS_Str*)comps_doccategory_get_id(c); + ck_assert_msg(strcmp(str->val, cats[0][x]) == 0, "%s != %s", + str->val, cats[0][x]); + COMPS_OBJECT_DESTROY(str); +@@ -605,8 +605,8 @@ START_TEST(test_arch) + list = comps_doc_environments(doc2); + ck_assert(list->len == 2); + for (it = list->first, x=0; it != NULL; it = it->next, x++) { +- g = (COMPS_DocEnv*)it->comps_obj; +- str = (COMPS_Str*)comps_docenv_get_id(g); ++ e = (COMPS_DocEnv*)it->comps_obj; ++ str = (COMPS_Str*)comps_docenv_get_id(e); + ck_assert_msg(strcmp(str->val, envs[0][x]) == 0, "%s != %s", + str->val, envs[0][x]); + COMPS_OBJECT_DESTROY(str); diff --git a/libcomps.changes b/libcomps.changes new file mode 100644 index 0000000..7c75054 --- /dev/null +++ b/libcomps.changes @@ -0,0 +1,155 @@ +------------------------------------------------------------------- +Wed Aug 27 09:53:32 UTC 2025 - Ana Guerrero + +- Add patch sphinx-build.patch now /usr/bin/sphinx-build uses alts. + +------------------------------------------------------------------- +Wed Jul 16 13:28:17 UTC 2025 - Dominique Leuenberger + +- Update to version 0.1.21: + + tests: Don't print parsing errors during tests + + tests: Unify formatting of current test announcements + + build: Restore compatiblity with libxml2-2.12.0 + + Fix build: use correct variable for category and env +- Drop libcomps-c99.patch: fixed upstream. +- Add 702ec142.patch: Upstream commit, support builds with cmake + 4.x. + +------------------------------------------------------------------- +Wed Jul 10 14:05:56 UTC 2024 - Martin Jambor + +- Add libcomps-c99.patch in order to avoid C99 violations which are + errors by default with GCC 14. [boo#1221700] + +------------------------------------------------------------------- +Mon Dec 4 14:34:19 UTC 2023 - Ana Guerrero + +- Add BuildRequires on python-setuptools to create python egg and + install it properly. Previously this was pulled by python-Sphinx + in the build environment. +- Use %license instead of %doc + +------------------------------------------------------------------- +Sat Nov 4 18:18:46 UTC 2023 - Neal Gompa + +- Update to 0.1.20 + + Fixes of xml parsing + + Fix non-optimized builds by removing inline keyword + + Use Py_hash_t instead of long + +------------------------------------------------------------------- +Fri Feb 24 15:38:14 UTC 2023 - Bruno Pitrus + +- Precompile python bytecode (boo#1208151) + +------------------------------------------------------------------- +Sat Sep 24 09:03:42 UTC 2022 - Dirk Müller + +- update to 0.1.19: + * handle upload to pypi + +------------------------------------------------------------------- +Wed Nov 3 10:42:20 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.18 + + Fix several covscan warnings + +------------------------------------------------------------------- +Fri Aug 27 03:36:32 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.17 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Don't print empty requires + + Fix memory leaks and resource leaks + + Remove Python 2 support +- Drop patch included in this release + + Patch: fix-sphinx.patch + +------------------------------------------------------------------- +Wed Jun 9 08:47:28 UTC 2021 - Martin Liška + +- Add upstream patch fix-sphinx.patch which fixes build with Sphinx 4.x. + +------------------------------------------------------------------- +Tue Apr 13 12:40:10 UTC 2021 - Neal Gompa + +- Upgrade to 0.1.16 + + Fix a crash when clearing COMPS_ObjRTree (rh#1888343) + + Fixes for leaks and crashes + +------------------------------------------------------------------- +Sat Jun 6 22:27:58 UTC 2020 - Neal Gompa + +- Upgrade to 0.1.15 + + Do not skip type=mandatory in xml output and test it (rh#1771224) + + Remove unused global variable UnfoObjListIt (rh#1793424) + + Make inline function __comps_objmrtree_all also static (rh#1793424) + +------------------------------------------------------------------- +Tue Dec 3 13:02:29 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.14 + + Fix reference to versioned libcomps.so + +------------------------------------------------------------------- +Tue Dec 3 12:42:44 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.13 + + Fix massively broken libcomps pkgconfig file + + Change libcomps soversion to use only the version major + +------------------------------------------------------------------- +Sun Dec 1 15:46:52 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.12 + + Fix order of asserts() in unit test (rh#1713220) + + Fix Python method descriptors for Python 3.8 (rh#1734777) + + Refactor pkgconfig file generation and install properly + + Fix segfault when converting empty dict to string (rh#1757959) + + Add missing python metadata to python3-libcomps + + Refactor building and installing Python bindings + +------------------------------------------------------------------- +Sun Mar 31 14:53:26 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.11 + + Fix missing braces + + Fix UAF in comps_objmrtree_unite function +- Drop merged patches + * 0001-Fix-Missing-braces.patch + * 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch + * libcomps-0.1.7-Add-zlib-as-an-explicit-dependency.patch + +------------------------------------------------------------------- +Thu Feb 7 15:45:43 UTC 2019 - Jan Engelhardt + +- Update RPM groups + +------------------------------------------------------------------- +Sun Feb 3 19:07:56 UTC 2019 - Neal Gompa + +- Upgrade to 0.1.9 + + Fix memory leaks + + Remove unused code +- Backport fix for logic error + * Patch: 0001-Fix-Missing-braces.patch +- Backport fix for CVE-2019-3817 (boo#1122841) + * Patch: 0002-Fix-UAF-in-comps_objmrtree_unite-function.patch +- Drop Python 2 subpackage +- Adjust changes entries to use full author identities + +------------------------------------------------------------------- +Sun Sep 17 19:12:56 UTC 2017 - Bernhard Wiedemann + +- Drop environment.pickle from doc to make build reproducible + +------------------------------------------------------------------- +Sun Aug 13 19:12:57 UTC 2017 - Neal Gompa + +- Upgrade to 0.1.8 + +------------------------------------------------------------------- +Mon Feb 1 06:43:39 UTC 2016 - Neal Gompa + +- Initial packaging of libcomps based on Mageia packaging + diff --git a/libcomps.spec b/libcomps.spec new file mode 100644 index 0000000..df954f4 --- /dev/null +++ b/libcomps.spec @@ -0,0 +1,155 @@ +# +# spec file for package libcomps +# +# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2021 Neal Gompa . +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define major 0 +%define minor 1 +%define patch 21 +%define libname %{name}%{major} +%define devname %{name}-devel + +Name: libcomps +Version: %{major}.%{minor}.%{patch} +Release: 0 +Summary: Comps XML file manipulation library +License: GPL-2.0-or-later +Group: Development/Libraries/C and C++ +URL: https://github.com/rpm-software-management/libcomps +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: %{url}/commit/702ec142.patch +Patch1: sphinx-build.patch + +BuildRequires: %{python_module setuptools} +BuildRequires: check-devel +BuildRequires: cmake +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: libexpat-devel +BuildRequires: libxml2-devel +BuildRequires: python-rpm-macros +BuildRequires: zlib-devel + +# prevent provides from nonstandard paths: +%define __provides_exclude ^(%{python3_sitearch}/.*\\.so)$ + +%description +Libcomps is library for structure-like manipulation with content of +comps XML files. Supports read/write XML file, structure(s) modification. + +%package -n %{libname} +Summary: Libraries for %{name} +Group: System/Libraries + +%description -n %{libname} +Libraries for %{name} + +%package -n %{devname} +Summary: Development files for the libcomps library +Group: Development/Libraries/C and C++ +Requires: %{libname}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n %{devname} +This package provides the development files for %{name}. + +%package doc +Summary: Documentation files for libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: doxygen + +%description doc +Documentation files for libcomps library. + +%package -n python-libcomps-doc +Summary: Documentation files for python bindings libcomps library +Group: Documentation/HTML +BuildArch: noarch +BuildRequires: python3-Sphinx + +%description -n python-libcomps-doc +Documentation files for python bindings libcomps library. + +%package -n python3-libcomps +Summary: Python 3 bindings for libcomps library +Group: Development/Libraries/Python +BuildRequires: python3-devel +Requires: %{libname}%{?_isa} = %{version}-%{release} +# There is no more Python 2 subpackage +Obsoletes: python2-libcomps < 0.1.9 + +%description -n python3-libcomps +This package provides the Python 3 bindings for libcomps library. + +%prep +%autosetup -p1 + +%build +%cmake -DPYTHON_DESIRED:STRING=3 ../libcomps/ +%make_build +make docs +make pydocs + +%check +pushd ./build +make test +popd + +%install +pushd ./build +%make_install +popd + +mkdir -p %{buildroot}%{_datadir}/doc/libcomps/ +cp -a build/docs/libcomps-doc/html %{buildroot}%{_datadir}/doc/libcomps/ + +mkdir -p %{buildroot}%{_datadir}/doc/python-libcomps/ +rm build/src/python/docs/html/.doctrees/environment.pickle +cp -a build/src/python/docs/html %{buildroot}%{_datadir}/doc/python-libcomps/ + +%python_compileall +%fdupes %{buildroot}%{python3_sitearch} + +%fdupes %{buildroot}%{_datadir}/doc/libcomps +%fdupes %{buildroot}%{_datadir}/doc/python-libcomps + +%post -n %{libname} -p /sbin/ldconfig + +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%{_libdir}/libcomps.so.%{major} +%doc README.md +%license COPYING + +%files -n %{devname} +%{_libdir}/libcomps.so +%{_libdir}/pkgconfig/libcomps.pc +%{_includedir}/* + +%files doc +%doc %{_datadir}/doc/libcomps + +%files -n python-libcomps-doc +%doc %{_datadir}/doc/python-libcomps + +%files -n python3-libcomps +%{python3_sitearch}/libcomps/ +%{python3_sitearch}/libcomps-%{version}*-info + +%changelog diff --git a/sphinx-build.patch b/sphinx-build.patch new file mode 100644 index 0000000..db148b9 --- /dev/null +++ b/sphinx-build.patch @@ -0,0 +1,13 @@ +/usr/bin/sphinx-build points to alts now, it doesn't work if we call it +from the python interpreter +--- libcomps-0.1.21/libcomps/src/python/docs/CMakeLists.txt ++++ libcomps-0.1.21/libcomps/src/python/docs/CMakeLists.txt +@@ -27,7 +27,7 @@ + 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 POST_BUILD +- COMMAND ${PYTHON_EXECUTABLE} ${SPHINX_EXECUTABLE} -E -b html ++ COMMAND ${SPHINX_EXECUTABLE} -E -b html + "${CMAKE_CURRENT_SOURCE_DIR}/doc-sources/" + "${CMAKE_CURRENT_BINARY_DIR}/html/" + COMMENT "LDLP $ENV{LD_LIBRARY_PATH}") -- 2.51.1