cups-pdf-vl.spec 7.0 KB

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