# # spec file for package cups-pdf # # Copyright (c) 2021 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/ # Name: cups-pdf Version: 3.0.1 Release: 3.4 Summary: Virtual PDF printer for CUPS License: GPL-2.0-or-later Group: Productivity/Publishing/PDF URL: https://www.cups-pdf.de/ Source0: http://www.cups-pdf.de/src/cups-pdf_%{version}.tar.gz #PATCH-FIX-OPENSUSE cups-pdf_gs-options.patch needed for ghostscript > 9.50 Patch0: cups-pdf_gs-options.patch BuildRequires: cups-devel Requires: cups-client %description CUPS-PDF is a PDF writer backend for CUPS. It provides a virtual CUPS-PDF printer which produces PDF files so that application programs which have no built-in support to "Save as PDF" could print to CUPS-PDF to get a PDF file. For details see %{_docdir}/cups-pdf/README and http://en.opensuse.org/SDB:Printing_to_PDF %prep %autosetup -p0 %build cd src gcc %{optflags} -o cups-pdf cups-pdf.c -lcups %install install -Dm644 extra/CUPS-PDF_noopt.ppd %{buildroot}%{_datadir}/cups/model/CUPS-PDF_noopt.ppd install -Dm644 extra/CUPS-PDF_opt.ppd %{buildroot}%{_datadir}/cups/model/CUPS-PDF_opt.ppd install -Dm644 extra/cups-pdf.conf %{buildroot}%{_sysconfdir}/cups/cups-pdf.conf install -Dm700 src/cups-pdf %{buildroot}%{_prefix}/lib/cups/backend/cups-pdf install -dm755 %{buildroot}%{_localstatedir}/spool/cups-pdf pushd %{buildroot}%{_datadir}/cups/model ln -s CUPS-PDF_opt.ppd CUPS-PDF.ppd popd %post # Add a symbolic link if /usr/lib64/cups/backend/ exists: if test -d %{_libdir}/cups/backend then ln -s %{_prefix}/lib/cups/backend/cups-pdf %{_libdir}/cups/backend/cups-pdf || : fi # Add a "CUPS-PDF" queue if the package is installed (but not when the package is updated): if test "$1" -eq "1" then %{_sbindir}/lpadmin -h localhost -p CUPS-PDF -v cups-pdf:/ -m CUPS-PDF.ppd -E || : fi # Exit successfully in any case: exit 0 %postun # Only if the package is erased (but not when it is replaced with an update package): if test "$1" -eq "0" then # Remove the "CUPS-PDF" queue (be silent if it does not exist): %{_sbindir}/lpadmin -h localhost -x CUPS-PDF 2>/dev/null || : # Remove the symbolic link (ignore if it does not exist): rm -f %{_libdir}/cups/backend/cups-pdf || : fi # Exit successfully in any case: exit 0 %files %license COPYING %doc ChangeLog README %config(noreplace) %{_sysconfdir}/cups/cups-pdf.conf %dir %{_prefix}/lib/cups %dir %{_prefix}/lib/cups/backend %attr(700, root, root) %{_prefix}/lib/cups/backend/cups-pdf %dir %{_datadir}/cups %dir %{_datadir}/cups/model %{_datadir}/cups/model/CUPS-PDF.ppd %{_datadir}/cups/model/CUPS-PDF_noopt.ppd %{_datadir}/cups/model/CUPS-PDF_opt.ppd %dir %{_localstatedir}/spool/cups-pdf %changelog * Mon Feb 26 2024 Dominique Leuenberger - Use %%autosetup macro. Allows to eliminate the usage of deprecated PatchN. * Tue Jun 8 2021 Tejas Guruswamy - Add cups-pdf_gs-options.patch to remove .setpdfwrite ghostscript option (not present any more from gs 9.54). Fixes boo#1187353. * Thu Mar 16 2017 joerg.lorenzen@ki.tng.de - Version update to 3.0.1 which includes: - Corrected a bug with multiple instance naming. - Some code and logging improvements. - Removed obsolete code. - Updated the README file. * Sat Jan 14 2017 joerg.lorenzen@ki.tng.de - Version update to 3.0.0 which includes: - Disabled support for multiple PS-files in one file. - Improved PS-structure handling. - Reordered compiler call to avoid errors. * Wed Nov 9 2016 aloisio@gmx.com - Fixes (boo#984600) * Wed Apr 27 2016 aloisio@gmx.com - Spec cleanup * Thu Nov 6 2014 aloisio@gmx.com - Version update to 3.0beta2 which includes: code simplifications and optimizations improved file name handling removed contrib/ directory from tarball (now on WWW) new contact data * Fri Jan 3 2014 kieltux@gmail.com - Version upgrade to 3.0beta1 which includes: support for multiple configurations with one backend support for option setting via lpoptions or PPD new option for selecting output file extension improved logging system with better error handling various code optimizations additional PPD for option setting new script in contrib/ for creating user defaults updated documentation * Tue May 15 2012 jsmeix@suse.de - Version upgrade to 2.6.1 which includes: Fixed a non-freed pointer, Fixed an invalid line in the config due to a typo. Added detailed copyright information to contrib/. - Version upgrade to 2.6.0 which includes: New experimental option for various line delimiters. Supplementary groups are set in addition to primary. * Thu Apr 14 2011 jsmeix@suse.de - Version upgrade to 2.5.1 which fixes a crash due to an uninitialized pointer. - Added a symbolic link if /usr/lib64/cups/backend/ exists to be backward compatible (e.g. for SLE11 systems). - Use directories like "/etc/" and "/var/" which are fixed values in cups-pdf.h also literally in the RPM spec file. - Install its license in COPYING to be on the safe side. - Moved the RPM changelog entries to cups-pdf.changes * Tue Jun 29 2010 jsmeix@suse.de - Work with upstream compliant CUPS 1.4 on all platforms which means to have a fixed "/usr/lib/cups/" directory on all platforms (see Novell/Suse Bugzilla bnc#575544). - Make sure lpadmin talks only to the cupsd on localhost via the '-h localhost' command line option. - Removed the test if /var/run/cups/cups.sock is a socket because the local cupsd may run just as well without it (only "Listen localhost:631" in cupsd.conf is mandatory). * Mon Feb 2 2009 suse@irc.freenode.org - Updated to 2.5.0 * Wed Jan 7 2009 suse@irc.freenode.org - Initial RPM