%global apiversion 0.10

Summary: A library for import of WordPerfect documents
Summary(ja): WordPerfect ドキュメントのインポートを行うためのライブラリ
Name: libwpd
Version: 0.10.0
Release: 1%{?_dist_release}

License: LGPLv2+ or MPLv2.0
Group: System Environment/Libraries
URL: http://libwpd.sf.net/

Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: cppunit-devel
BuildRequires: doxygen
BuildRequires: help2man
BuildRequires: librevenge-devel
BuildRequires: zlib-devel

%description
libwpd is a library for import of WordPerfect documents.

%description -l ja
libwpd は WordPerfect 文書をインポートするためのライブラリです。

%package devel
Summary: Development files for libwpd
Summary(ja): libwpd の開発用ファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig

%description devel
Includes and definitions for developing with libwpd.

%package tools
Summary: Tools to transform WordPerfect documents into other formats
Summary(ja): WordPerfect 文書を他のフォーマットに変換するツール
Requires: %{name} = %{version}-%{release}
Group: Applications/Text

%description tools
Tools to transform WordPerfect Documents into other formats.
Currently supported: html, raw, text.

%package doc
Summary: Documentation of %{name} API
Summary(ja): %{name} API のドキュメント
Group: Documentation
BuildArch: noarch

%description doc
The %{name}-doc package contains API documentation for %{name}.


%prep
%setup -q

chmod -x docs/%{name}.dia

%build
%configure --disable-static --disable-werror
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags} V=1

export LD_LIBRARY_PATH=`pwd`/src/lib/.libs${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
help2man -N -n 'debug the conversion library' -o wpd2raw.1 ./src/conv/raw/.libs/wpd2raw
help2man -N -n 'convert WordPerfect document into HTML' -o wpd2html.1 ./src/conv/html/.libs/wpd2html
help2man -N -n 'convert WordPerfect document into plain text' -o wpd2text.1 ./src/conv/text/.libs/wpd2text

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la

# we install API docs directly from build
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}
install -m 0755 -d %{buildroot}/%{_mandir}/man1
install -m 0644 wpd2*.1 %{buildroot}/%{_mandir}/man1

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc COPYING.LGPL COPYING.MPL CREDITS README
%{_libdir}/%{name}-%{apiversion}.so.*

%files devel
%defattr(-,root,root,-)
%doc HACKING TODO
%{_includedir}/%{name}-%{apiversion}
%{_libdir}/%{name}-%{apiversion}.so
%{_libdir}/pkgconfig/%{name}-%{apiversion}.pc

%files tools
%defattr(-,root,root,-)
%{_bindir}/wpd2html
%{_bindir}/wpd2raw
%{_bindir}/wpd2text
%{_mandir}/man1/wpd2html.1*
%{_mandir}/man1/wpd2raw.1*
%{_mandir}/man1/wpd2text.1*

%files doc
%doc COPYING.LGPL COPYING.MPL
%doc docs/doxygen/html
%doc docs/%{name}.dia
%doc docs/%{name}.png

%changelog
* Tue Jan 13 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.10.0-1
- new upstream release
- split documents to doc subpackage

* Wed Jul 02 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.9-1
- new upstream release
- add BuildRequires: zlib-devel

* Sun Mar 27 2011 Ryoichi INAGAKI <ryo1@bc.wakwa.com> 0.9.0-1
- new upstream release

* Sun Sep 26 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.14-3
- rebuild with rpm-4.8.1 for pkg-config file

* Fri Jul  3 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.8.14-2
- spec in UTF-8

* Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwa.com> 0.8.14-1
- new upstream release

* Sat May 19 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.9-0vl1
- initial build for Vine Linux

* Tue Mar 27 2007 Caolan McNamara <caolanm@redhat.com> - 0.8.9-2
- Resolves: rhbz#233876: add unowned directory fix from Michael Schwendt 

* Fri Mar 16 2007 Caolan McNamara <caolanm@redhat.com> - 0.8.9-1
- next version

* Fri Feb 09 2007 Caolan McNamara <caolanm@redhat.com> - 0.8.8-2
- spec cleanups

* Thu Jan 11 2007 Caolan McNamara <caolanm@redhat.com> - 0.8.8-1
- next version

* Mon Oct 09 2006 Caolan McNamara <caolanm@redhat.com> - 0.8.7-1
- next version

* Mon Jul 17 2006 Caolan McNamara <caolanm@redhat.com> - 0.8.6-1
- next version

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0.8.5-3.1
- rebuild

* Sun Jun 11 2006  Caolan McNamara <caolanm@redhat.com> 0.8.5-3
- add wp5nofontlistcrash

* Fri Jun 02 2006  Caolan McNamara <caolanm@redhat.com> 0.8.5-2
- build through brew

* Thu Jun 01 2006  Caolan McNamara <caolanm@redhat.com> 0.8.5-1
- next version

* Tue Mar 21 2006  Caolan McNamara <caolanm@redhat.com> 0.8.4-2
- rebuild for libgsf

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 0.8.4-1.2.1
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 0.8.4-1.2
- rebuilt for new gcc4.1 snapshot and glibc changes

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com> 0.8.4-1.1
- rebuilt

* Fri Dec 02 2005 Caolan McNamara <caolanm@redhat.com> 0.8.4-1
- next version

* Fri Dec 02 2005 Caolan McNamara <caolanm@redhat.com> 0.8.3-2
- rebuild because of libgsf

* Tue Jun 28 2005 Caolan McNamara <caolanm@redhat.com> 0.8.3-1
- update to latest libwpd

* Tue Jun 28 2005 Caolan McNamara <caolanm@redhat.com> 0.8.2-2.fc5
- export to other formats twiddle

* Wed Jun 22 2005 Caolan McNamara <caolanm@redhat.com> 0.8.2-1
- bump to latest version

* Fri Apr 29 2005 Caolan McNamara <caolanm@redhat.com> 0.8.1-1
- bump to latest version kudos Fridrich Strba
- drop integrated patch

* Wed Apr  6 2005 Caolan McNamara <caolanm@redhat.com> 0.8.0-4
- add libwpd devel provided patch for endless loops on some wpd documents

* Wed Mar 30 2005 Caolan McNamara <caolanm@redhat.com> 0.8.0-3
- rh#152503# add some Requires for -devel package

* Wed Mar  2 2005 Caolan McNamara <caolanm@redhat.com> 0.8.0-2
- rebuild with gcc4

* Fri Feb 11 2005 Caolan McNamara <caolanm@redhat.com> 0.8.0-1
- new version

* Wed Feb 9 2005 Caolan McNamara <caolanm@redhat.com> 0.7.2-2
- rebuild

* Fri Jul 23 2004 Caolan McNamara <caolanm@redhat.com> 0.7.2-1
- bump to 0.7.2

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Thu Feb 19 2004 Jeremy Katz <katzj@redhat.com> - 0.7.1-1
- update to 0.7.1

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Dec 16 2003 Jeremy Katz <katzj@redhat.com> 0.6.6-1
- 0.6.6

* Tue Nov  4 2003 Jeremy Katz <katzj@redhat.com> 0.6.5-1
- 0.6.5

* Mon Sep 15 2003 Jeremy Katz <katzj@redhat.com> 0.6.2-1
- 0.6.2

* Sun Jul  6 2003 Jeremy Katz <katzj@redhat.com> 0.5.0-1
- initial build for Red Hat Linux, tweak accordingly

* Sat Apr 26 2003 Rui M. Seabra <rms@1407.org>
- Create rpm spec
