File mingw32-poppler.spec of Package mingw32-poppler

#
# spec file for package mingw32-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:           mingw32-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:  mingw32-cross-cmake
BuildRequires:  mingw32-cairo-devel
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-fontconfig-devel
BuildRequires:  mingw32-freetype-devel
BuildRequires:  mingw32-gdk-pixbuf-devel
BuildRequires:  mingw32-glib2-devel
BuildRequires:  mingw32-gtk3-devel
BuildRequires:  mingw32-libjpeg-devel
BuildRequires:  mingw32-liblcms2-devel
BuildRequires:  mingw32-libopenjpeg-devel
BuildRequires:  mingw32-libpng-devel
%if %with_qt4
BuildRequires:  mingw32-libqt4-devel
%endif
BuildRequires:  mingw32-libqt5-qtbase-devel
BuildRequires:  mingw32-libtiff-devel
BuildRequires:  mingw32-libxml2-devel
BuildRequires:  mingw32-win_iconv-devel
BuildRequires:  mingw32-zlib-devel
%if 0%{?leap_version} == 420300
BuildRequires:  python
%else
BuildRequires:  python3
%endif
BuildRequires:  xz
%_mingw32_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 mingw32-libpoppler%{poppler_soname}
Summary:        PDF rendering library
Group:          System/Libraries
Provides:       mingw32-libpoppler = %{version}
Obsoletes:      mingw32-libpoppler < %{version}

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

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

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

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

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

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

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

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

%description -n mingw32-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 mingw32-libpoppler-qt4-%{poppler_qt4_soname}
Summary:        PDF rendering library (qt4 bindings)
Group:          System/Libraries
Requires:       mingw32-libpoppler%{poppler_soname} = %{version}
Provides:       mingw32-libpoppler-qt4 = %{version}
Obsoletes:      mingw32-libpoppler-qt4 < %{version}

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

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

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

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

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

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

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

%_mingw32_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 mingw32-filesystem 
configure_args+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_mingw32_prefix}/include"

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

# Configure
%_mingw32_cmake ${configure_args}

# Build
%_mingw32_cmake_build

%install
%_mingw32_cmake_install

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

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

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

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

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

%files -n mingw32-libpoppler-glib-devel
%defattr(-,root,root)
%{_mingw32_includedir}/poppler/glib
%{_mingw32_libdir}/libpoppler-glib.dll.a
%{_mingw32_libdir}/pkgconfig/poppler-glib.pc

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

%files -n mingw32-libpoppler-qt4-devel
%defattr(-,root,root)
%{_mingw32_includedir}/poppler/qt4
%{_mingw32_libdir}/libpoppler-qt4.dll.a
%{_mingw32_libdir}/pkgconfig/poppler-qt4.pc
%endif

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

%files -n mingw32-libpoppler-qt5-devel
%defattr(-,root,root)
%{_mingw32_includedir}/poppler/qt5
%{_mingw32_libdir}/libpoppler-qt5.dll.a
%{_mingw32_libdir}/pkgconfig/poppler-qt5.pc

%changelog
openSUSE Build Service is sponsored by