File podofo.spec of Package podofo.23799
#
# spec file for package podofo
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#
%define libver 0_9_2
Name: podofo
Version: 0.9.2
Release: 0
Summary: Tools to work with PDF files
License: GPL-2.0-or-later
Group: Productivity/Publishing/PDF
URL: http://podofo.sourceforge.net/
Source0: http://downloads.sourceforge.net/podofo/%{name}-%{version}.tar.gz
Source1: COPYING
Source2: COPYING.LIB
# PATCH-FIX-UPSTREAM podofo-0.9.2-soname.patch http://sourceforge.net/apps/mantisbt/podofo/view.php?id=54 asterios.dramis@gmail.com -- Update the soname of the library
Patch0: podofo-0.9.2-soname.patch
# PATCH-FIX-UPSTREAM remove-internal-findfreetype-references.patch -- fixes build with freetype2 2.5.1 as internal
# copy is broken. It is also better practice to use cmake's FindPackage modules
Patch1: remove-internal-findfreetype-references.patch
Patch2: r1576-Do-not-get-stuck-in-infite-loop-with-broken-page-tables.patch
Patch3: r1588-Fix-various-issues-when-Kids-array-is-missing.patch
Patch4: r1594-Fixed-compilation-on-Apple-platforms.patch
Patch5: r1600-Get-PoDoFo-build-under-Visual-Studio-2008.patch
Patch6: r1640-Use-PdfPagesTree-GetChildCount-whenever-possible.patch
Patch7: r1648-Be-forgiving-when-reading-XRef-stream-content.patch
Patch8: r1683-Unreachable-code-and-robustness-fixes-in-PdfPagesTree-GetPageNode.patch
Patch9: r1696-Use-cmake-commands-properly.patch
Patch10: r1701-Compatibility-fix-for-CMake-2.8.patch
Patch11: r1709-CMake-compatibility-and-TestFilter-build-fixes.patch
Patch12: r1777-Strict-mode-could-never-be-enabled.patch
Patch13: r1826-Do-not-force-c++98-standard-for-GNUCXX-compiler.patch
Patch14: r1791-Fix-build-failure-with-OpenSSL-1.1.patch
Patch15: r1793-Address-some-of-the-issues-reported-by-CoverityScan.patch
Patch16: r1833-Fix-a-crash-when-passing-a-PDF-file-.patch
Patch17: r1834-Fix-stack-overflow-crash-when-XRef-record-references-itself.patch
Patch18: r1835-Fix-for-CVE-2017-5852.patch
Patch19: r1836-Fix-for-CVE-2017-5854.patch
Patch20: r1837-Fix-for-CVE-2017-5886.patch
Patch21: r1838-Extend-fix-for-CVE-2017-5852.patch
Patch22: r1840-Fix-CVE-2017-5853-and-CVE-2017-6844.patch
Patch23: r1842-Fix-CVE-2017-7379-encoding-array-too-short.patch
Patch24: r1843-Fix-CVE-2017-5855-NULL-pointer-dereference.patch
Patch25: r1844-Fix-CVE-2017-6840-Out-of-bounds-read.patch
Patch26: r1845-Correct-fix-for-CVE-2017-6840.patch
Patch27: r1846-Fix-CVE-2017-6847-NULL-pointer-dereference.patch
Patch28: r1847-Fix-CVE-2017-7378-Out-of-bounds-read.patch
Patch29: r1848-Fix-CVE-2017-7380-NULL-dereference.patch
Patch30: r1849-Fix-CVE-2017-7994-NULL-dereference.patch
Patch31: r1850-Fix-a-memory-leak-on-document-load-exception-in-podofotxtextract.patch
Patch32: r1851-Fix-for-CVE-2017-8787-Read-out-of-buffer-size.patch
Patch33: r1859-Fix-regression-from-r1840.patch
Patch34: r1870-Fix-parameter-tested-for-NULL-in-PdfMemoryOutputStream-Write.patch
Patch35: r1872-Fix-CVE-2017-8054-Detect-cycles-in-PdfPagesTree.patch
Patch36: r1873-Fix-CVE-2017-6845-and-add-test-case-to-reproduce.patch
Patch37: r1876-Related-to-CVE-2018-5308-Add-in-parameter-validity-check.patch
Patch38: r1881-Revert-part-of-r1872-_Fix-for-CVE-2017-8054_.patch
Patch39: r1882-Correction-for-reverted-part-of-CVE-2017-8054-fix.patch
Patch40: r1883-Fix-comment-in-r1882-referring-to-incorrent-CVE-ID.patch
Patch41: r1889-Fix-for-CVE-2018-5295-Integer-overflow-at-PdfXRefStreamParserObject-ParseStream.patch
Patch42: r1892-Do-not-disable-PODOFO_RAISE_LOGIC_IF-for-Release-builds-_also-fixes-CVE-2017-6845_.patch
Patch43: r1907-Fix-CVE-2018-5309-integer-overflow-in-PdfObjectStreamParserObject-ReadObjectsFromStream.patch
Patch44: r1909-Fix-for-CVE-2018-8001-heap-based-buffer-over-read-in-UnescapeName.patch
Patch45: r1921-m_offsets-resize-can-throw-std-length_error-as-well-as-std-bad_alloc.patch
Patch46: r1925-Fix-uncontrolled-memory-allocation-in-the-PdfParser-ReadXRefSubsection-CVE-2018-5296.patch
Patch47: r1933-Really-fix-CVE-2017-7381.patch
Patch48: r1936-Really-fix-CVE-2017-7382.patch
Patch49: r1937-Really-fix-CVE-2017-7383.patch
Patch50: r1938-Fix-CVE-2018-11256-PdfError-info-gives-not-found-page-0-based.patch
Patch51: r1941-Fix-CVE-2017-8054-and-other-issues-keeping-binary-compat.patch
Patch52: r1948-Fix-CVE-2018-12982-implementing-inline-PdfDictionary-MustGetKey.patch
Patch53: r1949-Fix-CVE-2018-5783-by-introducing-singleton-limit-for-indirect-objects-keeping-binary-compat.patch
Patch54: r1950-Fix-null-pointer-dereference-in-PdfTranslator-setTarget.patch
Patch55: r1952-Fix-CVE-2018-11255-Null-pointer-dereference-in-PdfPage-GetPageNumber.patch
Patch56: r1954-Fix-CVE-2018-20751-null-pointer-dereference-in-crop_page-of-tools-podofocrop.patch
Patch57: r1961-EncryptTest-Fix-buffer-overflow-in-decrypted-out-buffer-in-TestEncrypt.patch
Patch58: r1963-Fix-heap-based-buffer-overflow-vulnerability-in-PoDoFo-PdfVariant-DelayedLoad.patch
Patch59: podofo-CVE-2019-20093.patch
BuildRequires: cmake >= 2.5
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: fontconfig-devel
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: libcppunit-devel
BuildRequires: libidn-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
%if 0%{?suse_version} > 1210
BuildRequires: lua51-devel
%else
BuildRequires: lua-devel
%endif
BuildRequires: openssl-devel
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Command line tools for working with PDF files.
%package -n libpodofo%{libver}
Summary: PDF parsing and creation library
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n libpodofo%{libver}
A cross platform PDF parsing and creation library.
%package -n libpodofo-devel
Summary: Development files for podofo
License: LGPL-2.1-or-later
Group: Development/Libraries/Other
Requires: libpodofo%{libver} = %{version}
%description -n libpodofo-devel
This package contains development files for podofo library.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p0
%patch3 -p0
%patch4 -p3
%patch5 -p0
%patch6 -p0
%patch7 -p0
%patch8 -p0
%patch9 -p0
%patch10 -p0
%patch11 -p0
%patch12 -p0
%patch13 -p0
%patch14 -p0
%patch15 -p0
%patch16 -p0
%patch17 -p0
%patch18 -p0
%patch19 -p0
%patch20 -p0
%patch21 -p0
%patch22 -p0
%patch23 -p0
%patch24 -p0
%patch25 -p0
%patch26 -p0
%patch27 -p0
%patch28 -p0
%patch29 -p0
%patch30 -p0
%patch31 -p0
%patch32 -p0
%patch33 -p0
%patch34 -p0
%patch35 -p0
%patch36 -p0
%patch37 -p0
%patch38 -p0
%patch39 -p0
%patch40 -p0
%patch41 -p0
%patch42 -p0
%patch43 -p0
%patch44 -p0
%patch45 -p0
%patch46 -p0
%patch47 -p0
%patch48 -p0
%patch49 -p0
%patch50 -p0
%patch51 -p0
%patch52 -p0
%patch53 -p0
%patch54 -p0
%patch55 -p0
%patch56 -p0
%patch57 -p0
%patch58 -p0
%patch59 -p0
mv cmake/modules/FindZLIB.cmake cmake/modules/FindCustomZLIB.cmake
cp %{S:1} .
cp %{S:2} .
# Remove build time references so build-compare can do its work
echo "HTML_TIMESTAMP = NO" >> Doxyfile
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS -std=c++11"
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPODOFO_BUILD_STATIC=FALSE -DPODOFO_USE_VISIBILITY=1 \
%if "%{_lib}" == "lib64"
-DWANT_LIB64=1 \
%endif
../
make %{?_smp_mflags} VERBOSE=1
cd ..
# Build devel docs
doxygen
%install
pushd build
%makeinstall
popd
# Install devel docs (do it manually to fix also rpmlint warning "files-duplicate" with %%fdupes)
mkdir -p %{buildroot}%{_docdir}/libpodofo-devel
install -pm 0644 AUTHORS COPYING.LIB ChangeLog FAQ.html README.html TODO %{buildroot}%{_docdir}/libpodofo-devel/
cp -a doc/html/ %{buildroot}%{_docdir}/libpodofo-devel/
%fdupes -s %{buildroot}
%post -n libpodofo%{libver} -p /sbin/ldconfig
%postun -n libpodofo%{libver} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS README.html
%license COPYING
%{_bindir}/*
%doc %{_mandir}/man1/podofo*.1%{ext_man}
%files -n libpodofo%{libver}
%defattr(-,root,root,-)
%{_libdir}/libpodofo.so.%{version}
%files -n libpodofo-devel
%defattr(-,root,root,-)
%doc %{_docdir}/libpodofo-devel/
%{_includedir}/podofo/
%{_libdir}/libpodofo.so
%changelog