input/libwmf.spec
raw · 5.5 KiB
%bcond_without tests
Name: libwmf
Version: 0.2.15
Release: 1%{?dist}
Summary: Windows Metafile conversion library
Summary(ru): Библиотека конвертации Windows Metafile
# RU: libwmf: LGPL-2.1-or-later; в исходниках есть шрифты под GPL, но они не устанавливаются.
# EN: libwmf: LGPL-2.1-or-later; sources include GPL fonts, but they are not installed.
# RU: wmf2plot под GPL-2.0-or-later, но он не собирается и не устанавливается.
# EN: wmf2plot is GPL-2.0-or-later, but it is not built nor installed.
License: LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-1.0-or-later
URL: https://github.com/caolanm/libwmf
Source0: https://github.com/caolanm/libwmf/archive/v%{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}
Provides: bundled(gd) = 2.0.0
Requires: urw-base35-fonts
Requires: %{name}-lite%{?_isa} = %{version}-%{release}
# RU: Для file-triggers загрузчиков gdk-pixbuf.
# EN: For gdk-pixbuf loader file triggers.
Requires: gdk-pixbuf%{?_isa}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: make
BuildRequires: zlib-devel
BuildRequires: dos2unix
BuildRequires: freetype-devel
BuildRequires: gdk-pixbuf-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libxml2-devel
BuildRequires: libX11-devel
BuildRequires: libXt-devel
BuildRequires: libICE-devel
BuildRequires: libSM-devel
BuildRequires: xorgproto
%description
libwmf is a library for reading and converting Windows MetaFile (WMF) vector
graphics.
%description -l ru
libwmf — библиотека для чтения и конвертации векторной графики Windows MetaFile
(WMF).
%package lite
Summary: WMF parser library
Summary(ru): Библиотека парсинга WMF
%description -n %{name}-lite
A smaller WMF parser library (libwmflite).
%description -l ru -n %{name}-lite
Упрощённая библиотека парсинга WMF (libwmflite).
%package devel
Summary: Development files for libwmf
Summary(ru): Файлы для разработки libwmf
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n %{name}-devel
Headers, pkg-config file and development helpers for libwmf.
%description -l ru -n %{name}-devel
Заголовочные файлы, pkg-config и вспомогательные файлы разработки для libwmf.
%prep
%autosetup -p1
# RU: Перекодируем README в UTF-8 (в исходнике iso-8859-2).
# EN: Re-encode README to UTF-8 (source is iso-8859-2).
f=README
iconv -f iso-8859-2 -t utf-8 "$f" > "$f.utf8"
mv -f "$f.utf8" "$f"
%build
autoreconf -i -f -Ipatches
%configure \
--with-libxml2 \
--disable-static \
--disable-dependency-tracking \
--with-gsfontdir=%{_datadir}/fonts/urw-base35
%make_build
%install
%make_install
# RU: Удаляем .la.
# EN: Remove .la files.
find %{buildroot} -type f -name '*.la' -delete
# RU: Удаляем bundled gd headers.
# EN: Remove bundled gd headers.
rm -rf %{buildroot}%{_includedir}/libwmf/gd
# RU: Удаляем мусорные makefile'ы документации.
# EN: Remove doc Makefile leftovers.
find doc -name 'Makefile*' -delete
# RU: Удаляем дублирующиеся шрифты (используем системные urw-base35).
# EN: Remove duplicate fonts (use system urw-base35 instead).
rm -f %{buildroot}%{_datadir}/libwmf/fonts/*afm
rm -f %{buildroot}%{_datadir}/libwmf/fonts/*t1
sed -i %{buildroot}%{_datadir}/libwmf/fonts/fontmap -e 's#libwmf/fonts#fonts/urw-base35#g'
%{_fixperms} %{buildroot}/*
%check
%if %{with tests}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:${LD_LIBRARY_PATH}
%make_build check
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n %{name}-lite -p /sbin/ldconfig
%postun -n %{name}-lite -p /sbin/ldconfig
%files
%{_libdir}/libwmf-0.2.so.7*
#%%{_libdir}/gdk-pixbuf-2.0/*/loaders/*.so
%{_bindir}/wmf2svg
%{_bindir}/wmf2gd
%{_bindir}/wmf2eps
%{_bindir}/wmf2fig
%{_bindir}/wmf2x
%{_bindir}/libwmf-fontmap
%{_datadir}/libwmf/
%files lite
%doc AUTHORS README
%license COPYING
%{_libdir}/libwmflite-0.2.so.7*
%files devel
%doc doc/*.html
%doc doc/*.png
%doc doc/*.gif
%doc doc/html
%doc doc/caolan
%{_libdir}/libwmf*.so
%{_libdir}/pkgconfig/libwmf.pc
%{_includedir}/libwmf/
%{_bindir}/libwmf-config
%changelog
* Sun May 10 2026 NiceOS Team <support@niceos.ru> - 0.2.15-1
- EN: Update libwmf to 0.2.15. Upstream notes parser hardening for embedded DIBs, record size validation for polyline/polygon/polypolygon/text records, an RLE decoder row-stride fix, DC stack depth limiting, a basic test suite, and MSVC build fixes.
- RU: Обновить libwmf до 0.2.15. В upstream отмечены исправления парсинга embedded DIBs, проверка размера записей polyline/polygon/polypolygon/text, исправление row-stride в RLE-декодере, ограничение глубины DC stack, базовый набор тестов и правки сборки для MSVC.
* Mon Jan 12 2026 NiceOS Team <niceos@ncsgp.ru> - 0.2.13-1
- Initial build for NiceOS (Первая сборка для НАЙС.ОС)