File mingw64-poppler.spec of Package mingw64-poppler

#
# spec file for package mingw64-poppler
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define with_qt4 1
%define with_doc 0

Name:           mingw64-poppler
Version:        0.61.0
Release:        0
%define poppler_soname 72
%define poppler_cpp_soname 0
%define poppler_glib_soname 8
%define poppler_qt4_soname 4
%define poppler_qt5_soname 1
Summary:        PDF rendering library
License:        GPL-2.0-only
Group:          Productivity/Publishing/PDF
Url:            http://poppler.freedesktop.org/
Source:         http://poppler.freedesktop.org/poppler-%{version}.tar.xz
Patch0:         poppler-0.61.0-fix-glib-2.7-build.patch
#!BuildIgnore: post-build-checks
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-cairo-devel
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-fontconfig-devel
BuildRequires:  mingw64-freetype-devel
BuildRequires:  mingw64-gdk-pixbuf-devel
BuildRequires:  mingw64-glib2-devel
BuildRequires:  mingw64-gtk3-devel
BuildRequires:  mingw64-libjpeg-devel
BuildRequires:  mingw64-liblcms2-devel
BuildRequires:  mingw64-libopenjpeg-devel
BuildRequires:  mingw64-libpng-devel
%if %with_qt4
BuildRequires:  mingw64-libqt4-devel
%endif
BuildRequires:  mingw64-libqt5-qtbase-devel
BuildRequires:  mingw64-libtiff-devel
BuildRequires:  mingw64-libxml2-devel
BuildRequires:  mingw64-win_iconv-devel
BuildRequires:  mingw64-zlib-devel
%if 0%{?leap_version} == 420300
BuildRequires:  python
%else
BuildRequires:  python3
%endif
BuildRequires:  xz
%_mingw64_package_header_debug
BuildArch:      noarch

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

%package tools
Summary:        PDF rendering library
Group:          Productivity/Publishing/PDF

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

%package -n mingw64-libpoppler%{poppler_soname}
Summary:        PDF rendering library
Group:          System/Libraries
Provides:       mingw64-libpoppler = %{version}
Obsoletes:      mingw64-libpoppler < %{version}

%description -n mingw64-libpoppler%{poppler_soname}
Poppler is a PDF rendering library based on the xpdf-3.0 code base.

%package -n mingw64-libpoppler-cpp%{poppler_cpp_soname}
Summary:        PDF rendering library
Group:          System/Libraries
Requires:       mingw64-libpoppler%{poppler_soname} = %{version}

%description -n mingw64-libpoppler-cpp%{poppler_cpp_soname}
Poppler is a PDF rendering library based on the xpdf-3.0 code base.

%package -n mingw64-libpoppler-devel
Summary:        PDF rendering library (development files)
Group:          Development/Libraries/C and C++

%description -n mingw64-libpoppler-devel
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (development files)

%package -n mingw64-libpoppler-glib8
Summary:        PDF rendering library
Group:          System/Libraries
Requires:       mingw64-libpoppler%{poppler_soname} = %{version}
Provides:       mingw64-libpoppler-glib = %{version}
Obsoletes:      mingw64-libpoppler-glib < %{version}

%description -n mingw64-libpoppler-glib8
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (glib bindings)

%package -n mingw64-libpoppler-glib-devel
Summary:        PDF rendering library (glib bindings development files)
Group:          Development/Libraries/C and C++

%description -n mingw64-libpoppler-glib-devel
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (glib bindings development files)

%if %with_qt4
%package -n mingw64-libpoppler-qt4-%{poppler_qt4_soname}
Summary:        PDF rendering library (qt4 bindings)
Group:          System/Libraries
Requires:       mingw64-libpoppler%{poppler_soname} = %{version}
Provides:       mingw64-libpoppler-qt4 = %{version}
Obsoletes:      mingw64-libpoppler-qt4 < %{version}

%description -n mingw64-libpoppler-qt4-%{poppler_qt4_soname}
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (qt4 bindings)

%package -n mingw64-libpoppler-qt4-devel
Summary:        PDF rendering library (qt4 bindings development files)
Group:          Development/Libraries/C and C++

%description -n mingw64-libpoppler-qt4-devel
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (qt4 bindings development files)
%endif

%package -n mingw64-libpoppler-qt5-%{poppler_qt5_soname}
Summary:        PDF rendering library (qt5 bindings)
Group:          System/Libraries
Requires:       mingw64-libpoppler%{poppler_soname} = %{version}

%description -n mingw64-libpoppler-qt5-%{poppler_qt5_soname}
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (qt5 bindings)

%package -n mingw64-libpoppler-qt5-devel
Summary:        PDF rendering library (qt5 bindings development files)
Group:          Development/Libraries/C and C++

%description -n mingw64-libpoppler-qt5-devel
Poppler is a PDF rendering library based on the xpdf-3.0 code base. (qt5 bindings development files)

%_mingw64_debug_package

%prep
%autosetup -p1 -n poppler-%{version}

%build
# Install xpdf headers. Although poppler claims these headers
# are for internal use only, other projects use them anyway.
configure_args+=" -DENABLE_XPDF_HEADERS=1"
# fix include path in generated pc file
# TODO move to mingw64-filesystem 
configure_args+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_mingw64_prefix}/include"

%if %with_qt4
configure_args+="
    -DQT_QMAKE_EXECUTABLE=/usr/bin/%_mingw64_target-qmake \
    -DQT_MOC_EXECUTABLE=/usr/bin/%_mingw64_target-moc \
    -DQT_RCC_EXECUTABLE=/usr/bin/%_mingw64_target-rcc \
    -DQT_UIC_EXECUTABLE=/usr/bin/%_mingw64_target-rcc"
%endif

# Configure
%_mingw64_cmake ${configure_args}

# Build
%_mingw64_cmake_build

%install
%_mingw64_cmake_install

%files tools
%defattr(-,root,root)
%{_mingw64_bindir}/pdfdetach.exe
%{_mingw64_bindir}/pdffonts.exe
%{_mingw64_bindir}/pdfimages.exe
%{_mingw64_bindir}/pdfinfo.exe
%{_mingw64_bindir}/pdftocairo.exe
%{_mingw64_bindir}/pdftohtml.exe
%{_mingw64_bindir}/pdftoppm.exe
%{_mingw64_bindir}/pdftops.exe
%{_mingw64_bindir}/pdftotext.exe
%{_mingw64_bindir}/pdfseparate.exe
%{_mingw64_bindir}/pdfunite.exe
%{_mingw64_mandir}/man1/pdfdetach.1*
%{_mingw64_mandir}/man1/pdffonts.1*
%{_mingw64_mandir}/man1/pdfimages.1*
%{_mingw64_mandir}/man1/pdfinfo.1*
%{_mingw64_mandir}/man1/pdftocairo.1*
%{_mingw64_mandir}/man1/pdftohtml.1*
%{_mingw64_mandir}/man1/pdftoppm.1*
%{_mingw64_mandir}/man1/pdftops.1*
%{_mingw64_mandir}/man1/pdftotext.1*
%{_mingw64_mandir}/man1/pdfseparate.1*
%{_mingw64_mandir}/man1/pdfunite.1*

%files -n mingw64-libpoppler%{poppler_soname}
%defattr(-,root,root)
%{_mingw64_bindir}/libpoppler-%{poppler_soname}.dll

%files -n mingw64-libpoppler-cpp%{poppler_cpp_soname}
%defattr(-,root,root)
%{_mingw64_bindir}/libpoppler-cpp-%{poppler_cpp_soname}.dll

%files -n mingw64-libpoppler-devel
%defattr(-,root,root)
%{_mingw64_includedir}/poppler
%if %with_qt4
%exclude %{_mingw64_includedir}/poppler/glib
%exclude %{_mingw64_includedir}/poppler/qt4
%endif
%{_mingw64_libdir}/libpoppler.dll.a
%{_mingw64_libdir}/libpoppler-cpp.dll.a
%{_mingw64_libdir}/pkgconfig/poppler-cairo.pc
%{_mingw64_libdir}/pkgconfig/poppler-splash.pc
%{_mingw64_libdir}/pkgconfig/poppler.pc
%{_mingw64_libdir}/pkgconfig/poppler-cpp.pc
%if %with_doc
%{_mingw64_datadir}/gtk-doc/html/poppler
%endif

%files -n mingw64-libpoppler-glib8
%defattr(-,root,root)
%{_mingw64_bindir}/libpoppler-glib-8.dll

%files -n mingw64-libpoppler-glib-devel
%defattr(-,root,root)
%{_mingw64_includedir}/poppler/glib
%{_mingw64_libdir}/libpoppler-glib.dll.a
%{_mingw64_libdir}/pkgconfig/poppler-glib.pc

%if %with_qt4
%files -n mingw64-libpoppler-qt4-%{poppler_qt4_soname}
%defattr(-,root,root)
%{_mingw64_bindir}/libpoppler-qt4-%{poppler_qt4_soname}.dll

%files -n mingw64-libpoppler-qt4-devel
%defattr(-,root,root)
%{_mingw64_includedir}/poppler/qt4
%{_mingw64_libdir}/libpoppler-qt4.dll.a
%{_mingw64_libdir}/pkgconfig/poppler-qt4.pc
%endif

%files -n mingw64-libpoppler-qt5-%{poppler_qt5_soname}
%defattr(-,root,root)
%{_mingw64_bindir}/libpoppler-qt5-%{poppler_qt5_soname}.dll

%files -n mingw64-libpoppler-qt5-devel
%defattr(-,root,root)
%{_mingw64_includedir}/poppler/qt5
%{_mingw64_libdir}/libpoppler-qt5.dll.a
%{_mingw64_libdir}/pkgconfig/poppler-qt5.pc

%changelog
openSUSE Build Service is sponsored by