%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8 %global with_python 0 %global with_perl 0 %else %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?python_include: %global python_include %(%{__python} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(0)")} %global with_python 1 %global with_perl 1 %endif Summary: Portable C library for dynamically generating PDF files Name: pdflib-lite # Remenber to check the URL after changing this... Version: 7.0.5 Release: 10%{?dist} License: Distributable URL: http://www.pdflib.com/ Source: http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-%{version}.tar.gz Patch0: pdflib-lite-7.0.4-gcc43.patch Patch1: pdflib-lite-7.0.5-format-security.patch BuildRequires: gcc BuildRequires: gcc-c++ %description PDFlib is a development tool for PDF-enabling your software, or generating PDF on your server. PDFlib offers a simple-to-use API for programmatically creating PDF files from within your own server- or client-side software. PDFlib doesn't make use of third-party software for generating PDF, nor does it require any other tools. %package devel Summary: Development files for pdflib Requires: %{name} = %{version}-%{release} %description devel PDFlib is a development tool for PDF-enabling your software, or generating PDF on your server. PDFlib offers a simple-to-use API for programmatically creating PDF files from within your own server- or client-side software. PDFlib doesn't make use of third-party software for generating PDF, nor does it require any other tools. This package contains the files needed for compiling programs that will use the PDFlib library. %if %{with_python} %package python Summary: Python shared library for pdflib BuildRequires: python-devel Requires: %{name} = %{version}-%{release} Provides: python-pdflib = %{version}-%{release} %description python PDFlib is a development tool for PDF-enabling your software, or generating PDF on your server. PDFlib offers a simple-to-use API for programmatically creating PDF files from within your own server- or client-side software. PDFlib doesn't make use of third-party software for generating PDF, nor does it require any other tools. This package contains the library needed for python programs that will use the PDFlib library. %endif %if %{with_perl} %package perl Summary: Perl shared library for pdflib Requires: %{name} = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Provides: perl-pdflib = %{version}-%{release} %if 0%{?fedora} >= 7 || 0%{?rhel} >= 6 BuildRequires: perl-devel %endif %description perl PDFlib is a development tool for PDF-enabling your software, or generating PDF on your server. PDFlib offers a simple-to-use API for programmatically creating PDF files from within your own server- or client-side software. PDFlib doesn't make use of third-party software for generating PDF, nor does it require any other tools. This package contains the library needed for perl programs that will use the PDFlib library. %endif %prep %setup -q -n PDFlib-Lite-%{version} %patch0 -p0 -b .gcc43 %patch1 -b .format-security sed -i -e 's,^PYTHONLIBDIR.*,PYTHONLIBDIR = %{python_sitearch},' \ -e 's,^PERLLIBDIR.*,PERLLIBDIR = %{perl_vendorarch},' \ config/mkcommon.inc.in %build # C, CPP, perl and python bindings enabled # java, ruby and tcl disabled # File a bug with RFE and patch if you need it %configure \ --with-pyincl=%{python_include} \ --with-java=no \ --with-ruby=no \ --with-tcl=no \ %if ! %{with_python} --with-py=no \ %endif %if ! %{with_perl} --with-perl=no \ %endif --enable-large_files --enable-tiffwrite # for x86_64 build sed -e s@/usr/lib@%{_libdir}@ -i libtool sed -e /redhat-hardened-ld/s@%{_libdir}@/usr/lib@ -i libtool %{__make} %{?_smp_mflags} %if %{with_python} %{__make} -C bind/pdflib/python %endif %if %{with_perl} %{__make} -C bind/pdflib/python %endif %install rm -rf examples make install DESTDIR=%{buildroot} %if %{with_python} mkdir -p %{buildroot}%{python_sitearch} make -C bind/pdflib/python install DESTDIR=%{buildroot} rm %{buildroot}%{python_sitearch}/*.{la,a} chmod +x %{buildroot}%{python_sitearch}/pdflib_py.so* %endif %if %{with_perl} mkdir -p %{buildroot}%{perl_vendorarch} make -C bind/pdflib/perl install DESTDIR=%{buildroot} rm %{buildroot}%{perl_vendorarch}/*.{la,a} chmod +x %{buildroot}%{perl_vendorarch}/pdflib_pl.so* %endif install -p -m 0644 bind/pdflib/cpp/pdflib.hpp %{buildroot}%{_includedir}/pdflib.hpp rm %{buildroot}%{_libdir}/*.{la,a} # require to extract debuginfo chmod +x %{buildroot}%{_libdir}/libpdf* # Only sources mkdir -p examples/{c,cpp,php} cp -r bind/pdflib/data examples/data cp bind/pdflib/c/*.c \ bind/pdflib/c/Makefile \ bind/pdflib/c/readme.txt \ examples/c cp bind/pdflib/cpp/*.cpp \ bind/pdflib/cpp/Makefile \ bind/pdflib/cpp/readme.txt \ examples/cpp %if %{with_perl} mkdir -p examples/perl cp bind/pdflib/perl/*.pl \ bind/pdflib/perl/Makefile \ bind/pdflib/perl/readme.txt \ examples/perl %endif %if %{with_python} mkdir -p examples/python cp bind/pdflib/python/*.py \ bind/pdflib/python/Makefile \ bind/pdflib/python/readme.txt \ examples/python %endif cp bind/pdflib/php/*.php \ bind/pdflib/php/readme.txt \ examples/php # overwrite the default php4 one cp bind/pdflib/php/examples.php5/*.php \ examples/php %if 0%{?fedora} < 28 && 0%{?rhel} < 8 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %endif %files %doc readme.txt doc/pdflib/PDFlib-Lite-license.pdf %{_bindir}/pdfimage %{_bindir}/text2pdf %{_libdir}/*.so.* %files devel %doc doc/pdflib/PDFlib-Lite-license.pdf %doc doc/pdflib/changes.txt doc/pdflib/compatibility.txt examples %doc doc/pdflib/PDFlib-API-reference.pdf doc/pdflib/PDFlib-tutorial.pdf doc/pdflib/readme-source-unix.txt %{_bindir}/pdflib-config %{_includedir}/* %{_libdir}/*.so %if %{with_python} %files python %doc doc/pdflib/PDFlib-Lite-license.pdf %{python_sitearch}/pdflib_py.so* %endif %if %{with_perl} %files perl %doc doc/pdflib/PDFlib-Lite-license.pdf %{perl_vendorarch}/pdflib_pl.* %endif %changelog * Wed Aug 12 2020 Remi Collet - 7.0.5-10 - F33 build * Mon Aug 12 2019 Remi Collet - 7.0.5-9 - also drop perl and python bindings on Fedora >= 31 * Wed Dec 12 2018 Remi Collet - 7.0.5-8 - cleanup for EL-8, drop perl and python subpackage which have to be build as part of the modules * Wed Aug 22 2018 Remi Collet - 7.0.5-7 - Add patch to work around false positive in format-security check (From rpmfusion, by Paul Howarth ) * Mon Feb 26 2018 Remi Collet - 7.0.5-6 - F28 cleanup * Fri Aug 28 2015 Remi Collet 7.0.5-5 - rebuild * Thu Dec 19 2013 Remi Collet 7.0.5-4 - rebuild * Sun Oct 21 2012 Remi Collet 7.0.5-3 - rebuild * Wed Oct 10 2012 Nicolas Chauvet - 7.0.5-3 - Rebuilt for perl * Thu Feb 09 2012 Nicolas Chauvet - 7.0.5-2.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Sat Jul 23 2011 Remi Collet 7.0.5-1.1 - BR perl-devel on EL-6 * Thu May 06 2010 Remi Collet 7.0.5-1 - update to 7.0.5 * Sat Jun 13 2009 Remi Collet 7.0.4p4-1 - update to 7.0.4p4 * Thu Mar 19 2009 Remi Collet 7.0.4p1-1 - update to 7.0.4p1 * Thu Mar 19 2009 Remi Collet 7.0.4-1 - update to 7.0.4 * Sat Dec 20 2008 Thorsten Leemhuis - 7.0.3-3 - rebuild for python 2.6 * Sun Sep 28 2008 Thorsten Leemhuis 7.0.3-1 - update to 7.0.3 - fix CVE-2007-6561: PDFlib stack-based buffer overflows * Sat Mar 15 2008 Thorsten Leemhuis 7.0.2p8-2 - rebuild for new perl * Fri Feb 29 2008 Remi Collet 7.0.2p8-1 - update to 7.0.2p8 - del destdir.patch ("make install DESTDIR" is now ok) - add gcc43.patch for Fedora 9 * Thu Aug 16 2007 Remi Collet 7.0.2-1 - Add BR perl-devel for fedora >= 7 * Thu Aug 16 2007 Remi Collet 7.0.2-1 - update to 7.0.2 * Thu Mar 15 2007 Remi Collet 7.0.1-1 - update to 7.0.1 * Mon Dec 18 2006 Remi Collet 7.0.0p3-3 - review for Livna - Requires/BuildRequires cleanup - Change License = Distributable, include PDFlib-Lite-license.pdf in sub-packages - add --with-pyinc, python2.5 not defined in configure - add some comments * Sun Dec 10 2006 Remi Collet 7.0.0p3-2 - add python subpackage - add perl subpackage * Sat Dec 09 2006 Remi Collet 7.0.0p3-1 - initial release for Extras