cups-pdf-vl.spec 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. Name: cups-pdf
  2. Summary: Extension for creating pdf-Files with CUPS
  3. Summary(ja): CUPS を用いた仮想 PDF プリンター
  4. Version: 3.0.1
  5. Release: 2%{?_dist_release}
  6. Group: publishing
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. License: GPLv2+
  10. URL: https://www.cups-pdf.de/
  11. Source0: https://www.cups-pdf.de/src/%{name}_%{version}.tar.gz
  12. Source1: INSTALL.cups-pdf
  13. Patch0: cups-pdf-conf-vine.patch
  14. # Handle ${DESKTOP} from config
  15. Patch2: cups-pdf-desktop.patch
  16. # Handle new lines in title
  17. Patch3: cups-pdf-title.patch
  18. # Fix build warning
  19. Patch4: cups-pdf-build.patch
  20. # Report error/success in log
  21. Patch5: cups-pdf-result.patch
  22. # Replace removed gs .setpdfwrite option
  23. Patch6: cups-pdf-setpdfwrite.patch
  24. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  25. BuildRequires: cups-devel
  26. Requires: ghostscript, cups
  27. Requires(post): cups
  28. Requires(postun): cups
  29. # These are the defaults paths defined in config.h
  30. # CUPS-PDF spool directory
  31. %global CPSPOOL %{_localstatedir}/spool/cups-pdf/SPOOL
  32. # CUPS-PDF output directory
  33. %global CPOUT %{_localstatedir}/spool/cups-pdf
  34. # CUPS-PDF log directory
  35. %global CPLOG %{_localstatedir}/log/cups
  36. # CUPS-PDF cups-pdf.conf config file
  37. %global ETCCUPS %(cups-config --serverroot 2>/dev/null || echo %{_sysconfdir}/cups)
  38. # Additional path to backend directory
  39. %global CPBACKEND %(cups-config --serverbin 2>/dev/null || echo %{_libdir}/cups)/backend
  40. %description
  41. "cups-pdf" is a backend script for use with CUPS - the "Common UNIX Printing
  42. System" (see more for CUPS under http://www.cups.org/).
  43. "cups-pdf" uses the ghostscript pdfwrite device to produce PDF Files.
  44. This version has been modified to store the PDF files on the Desktop of the
  45. user. This behavior can be changed by editing the configuration file.
  46. %description -l ja
  47. cups-pdf は CUPS (Common UNIX Printing System, http://www.cups.org/) を用いたいわゆる仮想 PDF プリンタのためのバックエンドスクリプトです。
  48. cups-pdf は PDF ファイルを生成するために Ghostscript の pdfwrite デバイスを使います。
  49. CUPS が動作しているときに %{name} をインストールすると、自動的に "CUPS-PDF Printer" として CUPS の設定を行います。
  50. %debug_package
  51. %prep
  52. %setup -n %{name}-%{version}
  53. %patch0 -p1 -b .vine
  54. %patch2 -p0 -b .desktop
  55. %patch3 -p0 -b .title
  56. %patch4 -p0 -b .build
  57. %patch5 -p0 -b .result
  58. %patch6 -p0 -b .setpdfwrite
  59. cp -p %{SOURCE1} INSTALL.RPM
  60. %build
  61. pushd src
  62. %{__cc} $RPM_OPT_FLAGS -lcups -o cups-pdf cups-pdf.c
  63. popd
  64. %install
  65. %__rm -rf ${RPM_BUILD_ROOT}
  66. %__mkdir_p $RPM_BUILD_ROOT%{CPBACKEND}
  67. %__mkdir_p $RPM_BUILD_ROOT%{CPSPOOL}
  68. %__mkdir_p $RPM_BUILD_ROOT%{CPOUT}
  69. %__mkdir_p $RPM_BUILD_ROOT%{CPLOG}
  70. %__mkdir_p $RPM_BUILD_ROOT%{CPBACKEND}
  71. %__mkdir_p $RPM_BUILD_ROOT%{ETCCUPS}
  72. %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/cups/model/
  73. %__install -m644 extra/{CUPS-PDF_noopt,CUPS-PDF_opt}.ppd %{buildroot}%{_datadir}/cups/model/
  74. %__install -m644 extra/cups-pdf.conf $RPM_BUILD_ROOT%{ETCCUPS}/
  75. %__install -m755 src/cups-pdf $RPM_BUILD_ROOT%{CPBACKEND}
  76. %clean
  77. [ "%{buildroot}" != "/" ] && %__rm -rf %{buildroot}
  78. %post
  79. # First install : create the printer if cupsd is running
  80. if [ "$1" -eq "1" -a -f "%{_var}/run/cupsd.pid" ]
  81. then
  82. /sbin/service cups condrestart
  83. if [ -d /proc/$(cat %{_var}/run/cupsd.pid) ]
  84. then
  85. echo "Install CUPS-PDF Printer ... "
  86. /usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF.ppd -E || :
  87. fi
  88. fi
  89. %postun
  90. if [ "$1" -eq "0" ]; then
  91. # Delete the printer
  92. echo "Remove CUPS-PDF Printer ... "
  93. /usr/sbin/lpadmin -x Cups-PDF || :
  94. fi
  95. %files
  96. %defattr(-,root,root)
  97. %license COPYING
  98. %doc ChangeLog README INSTALL.RPM
  99. %dir %{CPSPOOL}
  100. %dir %{CPOUT}
  101. %attr(700, root, root) %{CPBACKEND}/cups-pdf
  102. %config(noreplace) %{ETCCUPS}/cups-pdf.conf
  103. %{_datadir}/cups/model/CUPS-PDF*.ppd
  104. %changelog
  105. * Sun Jul 11 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.1-2
  106. - imported Patch6 from rawhide for newer ghostscript.
  107. * Tue May 28 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.1-1
  108. - new upstream release.
  109. - updated Patch2-5.
  110. * Sun Mar 15 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.6.1-1
  111. - new upstream release
  112. - updated Patch0
  113. - added Patch3, 4 and 5 from Fedora
  114. * Mon Sep 23 2013 Remi Collet <remi@fedoraproject.org> 2.6.1-7
  115. - report success/error in log file #1010434
  116. * Tue Mar 19 2013 Remi Collet <remi@fedoraproject.org> 2.6.1-4
  117. - fix title detection
  118. - fix build warning
  119. * Fri Feb 25 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2.5.1-1
  120. - new upstream release
  121. - fixed %%description -l ja
  122. * Sun Jul 26 2009 Munehiro Yamamoto <munepi@vinelinux.org> 2.5.0-4
  123. - rename Patch0 to cups-pdf-conf-vine.patch
  124. - updated cups-pdf-conf-vine.patch
  125. - set Truncate 256
  126. - change cups-pdf.conf to %%config(noreplace) in %%files section
  127. * Wed Jul 08 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.5.0-3
  128. - updated cups-pdf.conf.vl.patch: set DecodeHexStrings 1 (Experimental)
  129. * Tue Jul 07 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.5.0-2
  130. - added cups-pdf_2.5.0-4.diff.gz from Ubuntu
  131. - applied 60_cups-pdf_remove-contrib-SELinux-HOWTO-bashisms.patch
  132. - applied 70_cups-pdf_support-pdf-workflow.patch
  133. - added some comments in %%description -l ja
  134. - added echo "install/remove CUPS-PDF Printer" in %%post and %%postun
  135. - removed INSTALL and added README in %%doc
  136. * Sat Feb 14 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.5.0-1
  137. - new upstream release
  138. - updated the URL tag
  139. - correct the License tag
  140. * Tue Dec 30 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.4.8-2
  141. - fixed typo in spec
  142. * Wed Oct 29 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.8-1
  143. - new upstream release
  144. * Sun Sep 21 2008 Shu KONNO <owa@bg.wakwak.com> 2.4.6-1vl5
  145. - applied new versioning policy, spec in utf-8
  146. * Thu Jun 28 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 2.4.6-0vl2
  147. - rebuld for VineSeed
  148. * Thu Jun 28 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 2.4.6-0vl1
  149. - source update
  150. - delete -dNOKANJI option of Ghostscript
  151. * Sun Mar 25 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 2.4.5-0vl1
  152. - initial build for Vine Linux 4.1
  153. * Mon Sep 26 2005 Christian Ellsworth C. <k.ellsworth@gmail.com>
  154. - adapted to fit the new runtime config file of version 2.0
  155. * Sat Mar 05 2005 Christian Ellsworth C. <k.ellsworth@gmail.com>
  156. - adapted to cups-pdf 1.7.0
  157. - added auto configure a cups-pdf printer
  158. * Tue Feb 22 2005 Christian Ellsworth C. <k.ellsworth@gmail.com>
  159. - adapted to cups-pdf 1.6.6
  160. * Thu Aug 12 2004 Volker Behr <vrbehr@cip.physik.uni-wuerzburg.de>
  161. - adapted to cups-pdf 1.5.2
  162. * Sat Jan 31 2004 Volker Behr <vrbehr@cip.physik.uni-wuerzburg.de>
  163. - adapetd to cups-pdf 1.4.0 and new building environment
  164. * Wed Jan 14 2004 Mark Lane <harddata.com>
  165. - fixed the specfile so that x86_64 version installs the filter
  166. - in /usr/lib64 instead of /usr/lib
  167. * Sun Nov 02 2003 Volker Behr <vrbehr@cip.physik.uni-wuerzburg.de>
  168. - third release of cups-pdf, RPM-Edition for cups-pdf 1.3
  169. * Tue Sep 09 2003 Dirk Schwier <rpms@raumhochdrei.de>
  170. - second Release of cups-pdf, RPM-Edition for cups-pdf 1.1
  171. * Tue May 27 2003 Dirk Schwier <rpms@raumhochdrei.de>
  172. - we're proud to present the first version of cups-pdf, RPM-Edition
  173. # end of file