input/libconfuse.spec
raw · 3.8 KiB
Name: libconfuse
Version: 3.3
Release: 2%{?dist}
Summary: Configuration file parser library
Summary(ru): Библиотека парсинга конфигурационных файлов
License: ISC
URL: https://github.com/martinh/libconfuse
Source0: https://github.com/martinh/libconfuse/releases/download/v%{version}/confuse-%{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}
# CVE-2022-40320: heap-based buffer over-read in cfg_tilde_expand()
Patch0: d73777c2c3566fb2647727bb56d9a2295b81669b.patch
BuildRequires: check-devel
BuildRequires: gcc
BuildRequires: make
BuildRequires: perl
BuildRequires: pkgconfig
%description
libConfuse is a configuration file parser library written in C and licensed
under the ISC license. It supports sections and (lists of) values (strings,
integers, floats, booleans or other sections), and features such as quoted
strings, environment variable expansion, functions and nested include
statements. It provides a simple API for adding configuration file support
to programs.
%description -l ru
libConfuse — библиотека парсинга конфигурационных файлов на C под лицензией ISC.
Она поддерживает секции и (списки) значений (строки, целые, числа с плавающей
точкой, логические значения и вложенные секции), а также возможности вроде
кавычек, подстановки переменных окружения, функций и вложенных include.
Библиотека предоставляет простой API для добавления поддержки конфигурационных
файлов в программы.
%package devel
Summary: Development files for %{name}
Summary(ru): Файлы разработки для %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description -n %{name}-devel
Development headers and pkg-config files for %{name}.
%description -l ru -n %{name}-devel
Заголовочные файлы и pkg-config для разработки с использованием %{name}.
%prep
%setup -q -n confuse-%{version}
perl -pi.orig -e 's|confuse.h|../src/confuse.h|g' tests/check_confuse.c
%patch 0
%build
%configure \
--enable-shared \
--disable-static
%make_build AM_CFLAGS="-Wall -Wextra"
%check
%make_build check
%install
%make_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name '*.la' -delete
# RU: Установка man-страниц.
# EN: Install man pages.
mkdir -p %{buildroot}%{_mandir}/man3
cp -p doc/man/man3/*.3 %{buildroot}%{_mandir}/man3/
# RU: Извлечение примеров исходников.
# EN: Extract source examples.
mkdir -p ex2/examples
cp -p examples/{ftpconf.c,ftp.conf,simple.c,simple.conf,reread.c,reread.conf} ex2/examples/
# RU: Удаление лишней документации.
# EN: Remove redundant documentation.
rm -rf %{buildroot}%{_datadir}/doc/confuse
%find_lang confuse
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f confuse.lang
%license LICENSE
%doc AUTHORS README.md
%doc doc/html
%{_libdir}/libconfuse.so.2*
%{_mandir}/man?/*.*
%files devel
%doc ex2/examples
%{_includedir}/confuse.h
%{_libdir}/libconfuse.so
%{_libdir}/pkgconfig/libconfuse.pc
%changelog
* Sun May 24 2026 Stanislav Belikov <niceos@ncsgp.ru> - 3.3-2
- Fix CVE-2022-40320
* Wed Jan 28 2026 NiceOS Team <niceos@ncsgp.ru> - 3.3-1
- Initial build for NiceOS (Первая сборка для НАЙС.ОС)