%bcond_with doc

Name:           poppler
Summary:        PDF rendering library.
Summary(ja):    PDF レンダリング用ライブラリ
Version:        23.10.0
Release:        1%{?_dist_release}
Group:          system

Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       kazutaka, inagaki, daisuke

License:        GPLv2
URL:            https://poppler.freedesktop.org/
Source0:        https://poppler.freedesktop.org/%{name}-%{version}.tar.xz

# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
Patch5:         poppler-0.90.0-position-independent-code.patch
Patch6:         poppler-21.01.0-glib-introspection.patch

BuildRequires:	cmake
BuildRequires:	gettext-devel
%if %{with doc}
BuildRequires:	gtk-doc
%endif
BuildRequires:	curl-devel
BuildRequires:	glib2-devel
BuildRequires:	gtk3-devel
BuildRequires:	zlib-devel
BuildRequires:  libjpeg-devel
BuildRequires:  openjpeg2-devel
BuildRequires:	cairo-devel
BuildRequires:	qt5-qtbase-devel
BuildRequires:	libXmu-devel
BuildRequires:  lcms2-devel
BuildRequires:  libtiff-devel
BuildRequires:	libboost-devel
BuildRequires:  nss-devel
BuildRequires:	freetype2-devel
BuildRequires:	gpgme-devel
BuildRequires:	poppler-data

Requires:	poppler-data

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Obsoletes:	%{name}-qt < 0.18
Obsoletes:	%{name}-qt-devel < 0.18
Obsoletes:	%{name}-qt4 < 0.81.1
Obsoletes:	%{name}-qt4-devel < 0.81.1

%description
Poppler is a PDF rendering library based on the xpdf-3.0 code base.

%description -l ja
Popplerは xpdf-3.0 のコードをベースにした PDF レンダリング用ライブラリ
です。

#-----------------------------------------------------------------------------

%package devel
Summary:	Libraries and headers for poppler
Summary(ja): 	poppler用の開発ライブラリおよびヘッダファイル
Group:		programming
Requires:	%{name} = %{version}-%{release}
Requires:	glib2-devel

%description devel
This package includes the files needed for developing and compiling
applications which use the poppler library.

You should install the poppler-devel package if you would like to
develop applications based on poppler.

%description devel -l ja
このパッケージは poppler ライブラリを使用するアプリケーションを開発
するのに必要なライブラリやヘッダファイルを含んでいます。

poppler をベースにしたアプリケーションを開発するなら、このパッケージ
をインストールしてください。

#-----------------------------------------------------------------------------
%package qt5
Summary:	Qt5 wrapper for poppler
Group:		system
Requires:	%{name} = %{version}-%{release}
Requires:	qt5-qtbase

%description qt5
Qt5 wrapper for poppler.

%package qt5-devel
Summary:	Development files for poppler Qt5 wrapper
Group:		programming
Requires:	%{name}-qt5 = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}
Requires:	qt5-qtbase-devel

%description qt5-devel
Development files for poppler Qt4 wrapper

#-----------------------------------------------------------------------------

%package utils
Summary:	Command line utilities for converting PDF files
Group:		publishing
Requires:	%{name} = %{version}-%{release}

%description utils
This utils package installs a number of command line tools for
converting PDF files to a number of other formats.

#-----------------------------------------------------------------------------

%debug_package

#-----------------------------------------------------------------------------

%prep
%autosetup -p1

chmod -x poppler/CairoFontEngine.cc


%build
%cmake \
  -DENABLE_CMS=lcms2 \
  -DENABLE_DCTDECODER=libjpeg \
%if %{with doc}
  -DENABLE_GTK_DOC=ON \
%endif
  -DENABLE_LIBOPENJPEG=openjpeg2 \
  -DENABLE_QT6=OFF \
  -DENABLE_XPDF_HEADERS=ON \
  -DENABLE_ZLIB=OFF \
  -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
  ..

%cmake_build


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%cmake_install


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%license COPYING*
%doc AUTHORS INSTALL NEWS README*
%{_libdir}/lib*.so.*
%{_libdir}/girepository-1.0/*.typelib
%exclude %{_libdir}/libpoppler-qt5.so.*

%files devel
%defattr(-, root, root)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/poppler
%{_datadir}/gir-1.0/*.gir
%if %{with doc}
%{_datadir}/gtk-doc/html/poppler
%endif
%exclude %{_libdir}/libpoppler-qt5.so
%exclude %{_libdir}/pkgconfig/poppler-qt5.pc
%exclude %{_includedir}/poppler/qt5

%files qt5
%defattr(-, root, root)
%{_libdir}/libpoppler-qt5.so.*

%files qt5-devel
%defattr(-, root, root)
%{_libdir}/libpoppler-qt5.so
%{_libdir}/pkgconfig/poppler-qt5.pc
%{_includedir}/poppler/qt5

%files utils
%defattr(-, root, root)
%{_bindir}/pdf*
%{_mandir}/man1/pdf*


%changelog
* Thu Oct 19 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 23.10.0-1
- new upstream release.

* Sun Sep 11 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 22.09.0-1
- new upstream release.
- dropped Patch4.
- dropped ldconfig scriptlets.

* Wed Mar 03 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 21.03.0-1
- new upstream release.
- dropped Qt4 support.
- updated Patch4.
- imported Patch5-6 from rawhide.

* Mon Oct 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.81.0-2
- added "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" to cmake options.

* Mon Oct 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.81.0-1
- new upstream release.
- renumbered Patch0 to 4 and updated.
- dropped Patch1.
- imported Patch1 from rawhide and updated to resurrect qt4 support.
- added Patch2: synchronized poppler-qt4 with poppler-0.81.0.
- imported Patch3 from rawhide and updated.

* Sun Dec 31 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.61.1-1
- new upstream release.
- imported Patch0 and 1 from rawhide.

* Thu Mar  9 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.43.0-4
- new upstream release.
- fixed qt5 stuff.

* Mon Nov 21 2016 Toshiaki Ara <ara_t@384.jp> 0.43.0-3
- add packages: poppler-qt5 / poppler-qt5-devel

* Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.43.0-2
- rebuilt with new toolchain.

* Mon May 09 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.43.0-1
- new upstream release

* Sun Nov 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.37.0-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.26.5-1
- new upstream release

* Tue Jul 08 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.26.2-1
- new upstream release

* Wed Apr 30 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.24.5-1
- new upstream release with security fixes 

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.24.2-2
- rebuild with VineSeed environment

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.24.2-1
- new upstream release

* Sat Sep 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.20.4-1
- new upstream release
- change BuildRequires: lcms2-devel instead of lcms-devel
- add BuildRequires: libtiff-devel

* Wed Apr 11 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.18.4-1
- new upstream release
- remove Patch10
- remove qt, qt-devel sub packages

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.6-2
- add Requires: gtk2-devel (-devel package)

* Tue May 31 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.16.6-1
- new upstream release

* Tue Apr 19 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.16.4-2
- rebuild again on ppc with openjpeg-1.4

* Thu Apr 14 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.16.4-1
- new upstream release
- built with openjpeg-1.4

* Sat Mar 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.16.3-1
- new upstream release
- added utils subpackage

* Sun Oct 03 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.2-1
- new upstream release
- add BuildRequires: libXmu-devel

* Sun Mar 21 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.12.4-1
- new upstream release (including security fix CVE-2009-3607)
- built with new toolchain
- changed --enable-gtk-doc to --disable-gtk-doc

* Mon Nov  2 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.12.1-1
- new upstream release (including security fix based xpdf 3.02pl4)
- added BR: openjpeg-devel

* Sun Aug 16 2009 NAKAMURA Kenta <kenta@vinelinux.org> 0.10.7-3
- added qt4 wrapper subpackage
- added BuildRequires: qt4-devel

* Mon Jul 20 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.7-2
- add Patch10 to support otf font with TrueType format. (<BTS:0727>)
  (thanks to tomop)

* Mon May 18 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.7-1
- new upstream release

* Sun May 10 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.10.6-3
- added qt3 wrapper subpackage

* Fri May 01 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.6-2
- add configure option --enable-shared and --disable-static
- drop *.a from devel sub package 

* Fri Apr 24 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.6-1
- new upstream release
- add Packager: kazutaka

* Sun Mar 15 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.5-1
- new upstream release

* Mon Feb 23 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.4-1
- new upstream release

* Sun Feb 01 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.3-1
- new upstream release

* Sat Dec 13 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.10.2-1
- new upstream release

* Fri Oct 10 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.8.7-1
- new upstream release
- built with cairo-1.8.0

* Sat Aug 30 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.6-1
- new upstream release

* Tue Jul 29 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.8.5-1
- new upstream release

* Tue Jul 01 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.4-1
- new upstream release

* Thu Jun  5 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.8.3-1
- new upstream release
- spec in UTF-8

* Tue Apr  1 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.8.2-1
- new upstream release.
- rebuilt with cairo-1.6.4

* Mon Mar 31 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8.0-1
- new upstream release.
- apply new versioning policy.

* Sun Mar 02 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.4-0vl1
- new upstream release.

* Sun Dec 30 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.3-0vl1
- new upstream release.

* Tue Dec 11 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.2-0vl1
- new upstream release.

* Sat Oct 27 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.1-0vl1
- new upstream release.

* Sun Sep 09 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6-0vl1
- new upstream release.
- add Requires to poppler-data.

* Mon Jun 18 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.9-0vl1
- new upstream release.
- drop Patch100. (Fixed in upstream)

* Fri May 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.4-0vl3
- rebuild with new environment/toolchain

* Mon Feb 05 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.5.4-0vl2
- rebuilt for VineSeed

* Sat Jan 20 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.5.4-0vl1.1
- add patch100 for fix CVE-2007-0104 (Catalog Dictionary Handling Dos)
- add Vendor/Distribution Tag

* Tue Sep 26 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.4-0vl1
- source update.
- remove unnecessary .la files in %%install section.

* Thu Jun 22 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.3-0vl2
- add Requires: xpdf-common >= 3.01
- fix Url

* Sat Jun 17 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.3-0vl1
- source update.
- add BuildRequires gtk-doc.

* Sun May 28 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.2-0vl1
- source update.

* Sat Mar 11 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.1-0vl2
- add --enable-xpdf-headers configure option.

* Wed Mar 01 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.1-0vl1
- source update.
- add %%{_datadir}/gtk-doc/html/poppler in %%files section.
- add --disable-utils and --enable-zlib configure option.
  (--disable-utis needed to aboid conflict with xpdf)
- delete --enable-a4-paper configure option.(no longer supported)

* Wed Jan 25 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.4-0vl1
- source update.

* Wed Sep 21 2005 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.2-0vl1
- source update.
- add configure option --disable-poppler-{qt.qt4}, --enable-a4-paper.
- del BuildReq: libpixman-devel.(Obsolete by cairo)

* Thu Aug 18 2005 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.0-0vl1
- source update.

* Sat Jun 25 2005 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.3-0vl1
- source update.

* Thu May 19 2005 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.2-0vl1
- source update.

* Thu May 05 2005 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.1-0vl1
- initial build for VineSeed Plus.
