Summary: A .wmf file converter.
Name: libwmf
Version: 0.2.8.4
Release: 6%{?_dist_release}
License: GPL
Group: System Environment/Libraries
URL: http://wvware.sourceforge.net/libwmf.html
Source0: http://prdownloads.sourceforge.net/wvware/libwmf-%{version}.tar.gz

# fix CVE-2006-3376
Patch0: libwmf-0.2.8.4-CVE-2006-3376.patch
# fix CVE-2009-1364 (embedded GD graphics library)
Patch1: libwmf-0.2.8.4-realloc.patch
# adapt to standalone gdk-pixbuf
Patch8: libwmf-0.2.8.4-pixbufloaderdir.patch
# CVE-2007-0455
Patch9:  libwmf-0.2.8.4-CVE-2007-0455.patch
# CVE-2007-3472
Patch10: libwmf-0.2.8.4_CVE-2007-3472.patch
# CVE-2007-3473
Patch11: libwmf-0.2.8.4-CVE-2007-3473.patch
# CVE-2006-2906 affects GIFs, which is not implemented here
# CVE-2006-4484 affects GIFs, which is not implemented here
# CVE-2007-3474 affects GIFs, which is not implemented here
# CVE-2007-3475 affects GIFs, which is not implemented here
# CVE-2007-3476 affects GIFs, which is not implemented here
# CVE-2007-3477
Patch12: libwmf-0.2.8.4-CVE-2007-3477.patch
# CVE-2007-3478 affects shared ttf files across threads, which is not implemented here
# CVE-2007-2756
Patch13: libwmf-0.2.8.4-CVE-2007-2756.patch
# CAN-2004-0941
Patch14: libwmf-0.2.8.4-CAN-2004-0941.patch
# CVE-2009-3546
Patch15: libwmf-0.2.8.4-CVE-2009-3546.patch

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libxml2-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: gtk2-devel
BuildRequires: ghostscript-devel
BuildRequires: freetype2-devel >= 2.1.7
BuildRequires: zlib-devel
BuildRequires: libX11-devel
BuildRequires: libXt-devel
BuildRequires: xorg-x11-proto-devel
Requires: ghostscript
Requires: gtk2 >= 2.10.0
Requires: freetype2 >= 2.1.7

Vendor:         Project Vine
Distribution:   Vine Linux

%description
The libwmf library provides routines for converting Microsoft(R) .wmf
format files. Currently libwmf includes bindings for converting .wmf
files into onscreen X graphics, to .gif files and to .fig (Xfig)
files. Future libwmf project plans include completion of the .fig
conversion process and other vector-based formats conversions.

%package devel
Summary: Development tools for programs to manipulate metafile images
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: zlib-devel
Requires: libX11-devel
Requires: libxml2-devel
Requires: libpng-devel
Requires: libjpeg-devel
Requires: freetype2-devel >= 2.1.7

%description devel
The libwmf-devel package contains the header files and static
libraries necessary for developing programs using libwmf.

%prep
%setup -q 
%patch0 -p1 -b .CVE-2006-3376
%patch1 -p1 -b .CVE-2009-1364

%patch8 -p1 -b .pixbufloaderdir
%patch9  -p1 -b .CVE-2007-0455
%patch10 -p0 -b .CVE-2007-3472
%patch11 -p1 -b .CVE-2007-3473
%patch12 -p1 -b .CVE-2007-3477
%patch13 -p1 -b .CVE-2007-2756
%patch14 -p1 -b .CAN-2004-0941
%patch15 -p1 -b .CVE-2009-3546

%build
%configure --without-expat --with-x --disable-static
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
mkdir -p docs-to-install
make install DESTDIR=%{buildroot}

rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/*/loaders/*.{la,a}

cp -pr %{buildroot}%{_datadir}/doc/libwmf/* docs-to-install/
rm -rf %{buildroot}%{_datadir}/doc/libwmf/

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc ChangeLog README CREDITS COPYING TODO docs-to-install/* examples
%{_bindir}/wmf2eps
%{_bindir}/wmf2fig
%{_bindir}/wmf2svg
%{_bindir}/wmf2gd
%{_bindir}/wmf2x
%{_bindir}/libwmf-fontmap
%{_libdir}/lib*.so.*
%{_libdir}/gtk-2.0/*/loaders/*.so
%{_datadir}/libwmf

%files devel
%defattr(-,root,root)
%{_bindir}/libwmf-config
%{_includedir}/libwmf
#{_libdir}/*.la
%{_libdir}/lib*.so
#{_libdir}/gtk-2.0/*/loaders/*a

%changelog
* Tue Apr 26 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.2.8.4-6
- add patch8 - patch15 from fc14 to fix many security issues
- add vendor/distr tag

* Sat Sep 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.2.8.4-5
- add BuildRequires: zlib-devel, libX11-devel, libXt-devel, xorg-x11-proto-devel
- add Requires: zlib-devel, libX11-devel (devel package)
- add configure option (--disable-static)

* Fri Jul  3 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.2.8.4-4
- merged from VinePlus 4.x (-2,-3 are skipped)
  - * Sun May 10 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 
  - 0.2.8.4-3vl4
  - add patch1 for fox CVE-2009-1364 (embedded GD graphics library)
  - new versioning policy
- add smp_mflags into make section
- fix spec typo

* Thu May  1 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.8.4-1
- applied new versioning policy
- removed lib*.la from devel package

* Tue Apr 24 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.8.4-0vl3
- rebuild with gtk+-2.10

* Mon Aug 08 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.2.8.4-0vl2
- [SECURITY] add patch0
  - WMF file handling integer overflow vulnerability (CVE-2006-3376)
- update URL
- drop flase dependencies
  - Requires: gdk-pixbuf
  - BuildPreReq: gdk-pixbuf-devel
- add deficient dependencies
  - Requires: libjpeg
  - BuildPreReq: libjpeg-devel

* Mon Aug  1 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.8.4-0vl1
- new upstream release

* Fri Mar 19 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.8.2-0vl2
- rebuild with gtk+-2.4.0

* Sun Nov 30 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.8.2-0vl1
- updated to 0.2.8.2
- Changed Requires freetype2 >= 2.1.7 (added version dependancy)

* Mon Sep 22 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.8-0vl1
- update to 0.2.8
- rebuild with new toolchains
- add Requires to gdk-pixbuf, ghostscript and gtk2

* Thu Oct 03 2002 Shoji Matsumoto <shom@vinelinux.org> 0.2.6-0vl1
- update

* Thu Sep 06 2001 Toru Sagami <sagami@vinelinux.org>
- 0.2.1-0vl1: split devel subpackage

* Fri Nov 10 2000 Masato Bito <masato@nets.ce.hiroshima-cu.ac.jp>
- 0.1.16-1vl1
- remove Builarch:

* Tue Nov 16 1999 Tim Powers <timp@redhat.com>
- updated to 0.1.16

* Mon Aug 30 1999 Tim Powers <timp@redhat.com>
- changed group

* Mon Jul 19 1999 Tim Powers <timp@redhat.com>
- updated source
- built for 6.1

* Wed May 12 1999 Cristian Gafton <gafton@redhat.com>
- build for powertools
