File xpdf.spec of Package xpdf
#
# spec file for package xpdf
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#
Name: xpdf
Version: 4.05
Release: 0
Summary: PDF viewer
License: GPL-2.0-only AND GPL-3.0-only
Group: Productivity/Publishing/PDF
URL: https://www.xpdfreader.com
Source: https://dl.xpdfreader.com/xpdf-%{version}.tar.gz
Source1: https://dl.xpdfreader.com/xpdf-%{version}.tar.gz.sig
Source2: %{name}.keyring
BuildRequires: cmake
BuildRequires: cups-devel
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(zlib)
BuildRequires: update-desktop-files
Requires: ghostscript-fonts-std
Requires: libQt5Svg5
Recommends: %{name}-tools = %{version}
%description
Xpdf is a free PDF viewer and toolkit, including a text extractor, image
converter, HTML converter, and more.
%package tools
License: GPL-2.0-only AND GPL-3.0-only
Summary: Command line tools
Group: Productivity/Publishing/PDF
Conflicts: poppler-tools
%description tools
The open source Xpdf toolkit also includes several command line tools which
perform various functions on PDF files:
- pdftotext: converts PDF to text
- pdftops: converts PDF to PostScript
- pdftoppm: converts PDF pages to netpbm (PPM/PGM/PBM) image files
- pdftopng: converts PDF pages to PNG image files
- pdftohtml: converts PDF to HTML
- pdfinfo: extracts PDF metadata
- pdfimages: extracts raw images from PDF files
- pdffonts: lists fonts used in PDF files
- pdfdetach: extracts attached files from PDF files
%prep
%setup -q
sed -i '/install/s|\(man/man\)|share/\1|' %{name}*/CMakeLists.txt
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
mkdir -p build
pushd ./build
cmake .. \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DA4_PAPER=ON \
-DNO_TEXT_SELECT=OFF \
-DMULTITHREADED=ON \
-DUSE_EXCEPTIONS=ON \
-DUSE_FIXEDPOINT=OFF \
-DSPLASH_CMYK=ON \
-DSPLASH_DEVICEN=ON \
-DUSE_LCMS=ON \
-DHIGHLIGHTED_REGIONS=OFF \
-DSYSTEM_XPDFRC= \
-DXPDFWIDGET_PRINTING=ON \
-DEVAL_MODE=ON \
-DBUILDING_XPDFREADER=ON
%make_jobs
popd
%install
%cmake_install
install -Dm 0644 ./%{name}-qt/%{name}-icon.svg -t %{buildroot}%{_datadir}/pixmaps/
%suse_update_desktop_file -c %{name} "XpdfReader" "PDF viewer" %{name} %{name}-icon Office Viewer
%files
%doc ANNOUNCE CHANGES README doc/sample-%{name}rc
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}-icon.svg
%{_mandir}/man?/xpdf*.?%{ext_man}
%license COPYING COPYING3
%files tools
%{_bindir}/pdf*
%{_mandir}/man?/pdf*.?%{ext_man}
%changelog