N
NiceOS Build Portal
Enterprise build observability for published NiceOS package builds.

input/libcomps.spec

raw · 7.3 KiB

Name:           libcomps
Version:        0.1.24
Release:        1%{?dist}
Summary:        libcomps - a library for working with comps XML files
Summary(ru):    libcomps — библиотека для работы с comps XML файлами

License:        GPL-2.0-or-later
URL:            https://github.com/rpm-software-management/libcomps
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

Packager:       NICE SOFT GROUP LLC (ООО "НАЙС СОФТ ГРУПП") 5024245440 <niceos@ncsgp.ru>
Vendor:         NiceSOFT
Distribution:   NiceOS.Core
BugURL:         https://bugs.niceos.ru/
VCS:            https://specs.niceos.ru/rmps/%{name}

BuildRequires:  check-devel
BuildRequires:  cmake
BuildRequires:  expat-devel
BuildRequires:  gcc
BuildRequires:  libxml2-devel
BuildRequires:  zlib-devel
BuildRequires:  python3-xml

%description
libcomps is a library for handling comps metadata (groups, categories and
environments) used by RPM-based package management. It provides parsing and
manipulation of comps XML and related metadata for integration in package tools.

%description -l ru
libcomps — библиотека для работы с метаданными comps (группы, категории и
окружения), используемыми в пакетных менеджерах RPM-систем. Она предоставляет
возможности разбора и изменения comps XML и связанных метаданных для интеграции
в инструменты управления пакетами.

%package        devel
Summary:        Development files for the libcomps library
Summary(ru):    Файлы разработки для библиотеки libcomps
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description -n %{name}-devel
Header files, pkg-config metadata and development symlinks for building
applications against libcomps.

%description -l ru -n %{name}-devel
Заголовочные файлы, метаданные pkg-config и ссылки для разработки, необходимые
для сборки приложений, использующих libcomps.

%package        doc
Summary:        Documentation for the libcomps library
Summary(ru):    Документация для библиотеки libcomps
BuildArch:      noarch
BuildRequires:  doxygen
Requires:       python3-%{name} = %{version}-%{release}

%description -n %{name}-doc
Documentation for libcomps, including reference materials and guides.

%description -l ru -n %{name}-doc
Документация для libcomps, включая справочные материалы и руководства.

%package        -n python-%{name}-doc
Summary:        Documentation for the Python libcomps library
Summary(ru):    Документация для Python-библиотеки libcomps
BuildArch:      noarch
BuildRequires:  python3-sphinx
BuildRequires:  python3-xml
Requires:       python3-%{name} = %{version}-%{release}

%description -n python-%{name}-doc
Developer documentation for using libcomps from Python.

%description -l ru -n python-%{name}-doc
Документация для разработчиков по использованию libcomps из Python.

%package        -n python3-%{name}
Summary:        Python 3 bindings for the libcomps library
Summary(ru):    Python 3 привязки для библиотеки libcomps
BuildRequires:  make
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%{?python_provide:%python_provide python3-%{name}}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      platform-python-%{name} < %{version}-%{release}

%description -n python3-%{name}
Python 3 bindings for libcomps, enabling access to comps metadata APIs from
Python applications.

%description -l ru -n python3-%{name}
Python 3 привязки для libcomps, позволяющие приложениям на Python работать с
API метаданных comps.

%prep
%autosetup -p1 -n %{name}-%{version}

mkdir -p build-py3
mkdir -p build-doc

# RU: Исправление цели py3-copy: в некоторых сборочных окружениях цель отсутствует.
# EN: Fix py3-copy target: in some build environments the target is missing.
cat << 'EOF' >> libcomps/src/python/pycopy-target-fix.cmake
if(NOT TARGET py3-copy)
    add_custom_target(py3-copy)
endif()
EOF

echo "include(\${CMAKE_CURRENT_SOURCE_DIR}/../pycopy-target-fix.cmake)" | \
    cat - libcomps/src/python/pycopy.cmake > libcomps/src/python/pycopy.cmake.fixed \
    && mv libcomps/src/python/pycopy.cmake.fixed libcomps/src/python/pycopy.cmake

# RU: Отключаем линковку тестов с utility targets, чтобы избежать ошибок CMake.
# EN: Drop linking tests to utility targets to avoid CMake errors.
sed -i '/target_link_libraries *(test_parse_run/d' libcomps/tests/CMakeLists.txt
sed -i '/target_link_libraries *(test_comps_run/d' libcomps/tests/CMakeLists.txt

%build
pushd build-py3
  %cmake ../libcomps/
  %cmake_build
popd

pushd build-doc
  %cmake ../libcomps/
  %cmake_build --target docs
  %cmake_build --target pydocs
popd

%install
pushd build-py3
   %cmake_install
popd
if [ -d "%{buildroot}%{python3_sitelib}" ]; then
  find "%{buildroot}%{python3_sitelib}" -type f -name '*.pyc' -delete || :
  find "%{buildroot}%{python3_sitelib}" -type d -name '__pycache__' -prune -exec rm -rf {} + || :
fi

%check
pushd build-py3
  %cmake_build --target test
  %cmake_build --target pytest
popd

%if %{undefined ldconfig_scriptlets}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%else
%ldconfig_scriptlets
%endif

%files
%license COPYING
%doc README.md
%attr(0755,root,root) %{_libdir}/%{name}.so.*

%files devel
%{_includedir}/%{name}/
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%files doc
%doc build-doc/NiceSOFT-linux-build/docs/libcomps-doc/html

%files -n python-%{name}-doc
%doc build-doc/NiceSOFT-linux-build/src/python/docs/html

%files -n python3-%{name}
%{python3_sitearch}/%{name}/
%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info

%changelog
* Sat May 09 2026 NiceOS Team <support@niceos.ru> - 0.1.24-1
- EN: - Update libcomps from 0.1.23 to 0.1.24.
- Upstream release appears maintenance-oriented: memory-leak fix, Python binding cleanup, CMake 3.27 compatibility, test maintenance, and a data-correctness fix for COMPS_ElemInfo attributes.
- No explicit upstream ABI/API break was identified, but manual review is recommended because release notes are minimal and one fix changes a runtime data invariant.
- RU: - Обновить libcomps с версии 0.1.23 до 0.1.24.
- Upstream-релиз выглядит как maintenance-обновление: исправление утечки памяти, cleanup в Python bindings, совместимость с CMake 3.27, обновление тестов и исправление инварианта данных для COMPS_ElemInfo attributes.
- Явных ABI/API-breaking изменений не выявлено, но рекомендуется manual review, так как release notes минимальны и один из фиксов меняет runtime-инвариант данных.


* Fri Jan 09 2026 NiceOS Team <niceos@ncsgp.ru> - 0.1.23-1
- Initial build for NiceOS (Первая сборка для НАЙС.ОС)