Name:          libwmf
Version:       0.2.13
Release:       1
Summary:       MetaFile Library for Windows
License:       LGPLv2+ and GPLv2+ and GPL+
URL:           https://github.com/caolanm/libwmf
Source:        https://github.com/caolanm/libwmf/archive/v%{version}.tar.gz
Requires:      urw-fonts libwmf-lite = %{version}-%{release}
Requires:      gdk-pixbuf2 >= 2.31.5-2.fc24
BuildRequires: libtool libxml2-devel libpng-devel gtk2-devel libXt-devel
BuildRequires: libjpeg-devel libX11-devel dos2unix libxml2-devel
Provides:      libwmf-lite = %{version}-%{release}
Obsoletes:     libwmf-lite < %{version}-%{release}

%description
The package is  library for parsing/reading/converting Windows MetaFile vector graphics.


%package       devel
Summary:       Develop files for libwmf
Requires:      libwmf = %{version}-%{release}
Requires:      gtk2-devel, libxml2-devel, libjpeg-devel

%description   devel
The package contains libraries and headers files for libwmf.

%prep
%autosetup

%build
autoreconf -i -f -Ipatches
%configure --with-libxml2 --disable-static --disable-dependency-tracking \
           --with-gsfontdir=/usr/share/fonts/urw-base35
%make_build

%install
%make_install
%delete_la
sed -i 's#libwmf/fonts#fonts/urw-base35#g' $RPM_BUILD_ROOT%{_datadir}/libwmf/fonts/fontmap
find doc -name "Makefile*" -exec rm {} \;

%post
/sbin/ldconfig
%postun
/sbin/ldconfig

%files
%doc AUTHORS README COPYING
%{_libdir}/libwmf-0.2.so.7*
%{_libdir}/gdk-pixbuf-2.0/*/loaders/*.so
%{_bindir}/*
%{_datadir}/libwmf/
%{_libdir}/libwmflite-0.2.so.7*
%exclude %{_bindir}/libwmf-config
%exclude %{_datadir}/libwmf/fonts/*afm
%exclude %{_datadir}/libwmf/fonts/*t1

%files devel
%doc doc/*
%{_libdir}/libwmf*.so
%{_libdir}/pkgconfig/libwmf.pc
%{_includedir}/libwmf/
%{_bindir}/libwmf-config
%exclude %{_includedir}/libwmf/gd

%changelog
* Mon Oct 16 2023 yaoxin <yao_xin001@hoperun.com> - 0.2.13-1
- Upgrade to 0.2.13

* Thu Dec 12 2019 zhujunhao <zhujunhao5@huawei.com> 0.2.12-2
- Package init
