cups.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. ##
  2. ## cups.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: cups
  27. Summary: Common Unix Printing System
  28. URL: http://www.cups.org/
  29. Vendor: Easy Software Products
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Print
  34. License: GPL/LGPL with exceptions
  35. Version: 1.1.22
  36. Release: 20041102
  37. # package options
  38. %option with_ssl no
  39. # list of sources
  40. Source0: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
  41. Source1: rc.cups
  42. Source2: cupsd.conf
  43. Patch0: cups.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  48. PreReq: OpenPKG, openpkg >= 20040130
  49. BuildPreReq: zlib, jpeg, png, tiff
  50. PreReq: zlib, jpeg, png, tiff
  51. %if "%{with_ssl}" == "yes"
  52. BuildPreReq: openssl
  53. PreReq: openssl
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. CUPS provides a portable printing layer for Unix-based operating
  59. systems. It has been developed by Easy Software Products to promote
  60. a standard printing solution for all Unix vendors and users.
  61. CUPS provides the System V and Berkeley command-line interfaces and
  62. uses the Internet Printing Protocol (IPP) as the basis for managing
  63. print jobs and queues.
  64. %track
  65. prog cups = {
  66. version = %{version}
  67. url = ftp://ftp.easysw.com/pub/cups/
  68. regex = ((\d+\.)+\d+)
  69. url = ftp://ftp.easysw.com/pub/cups/__NEWVER__/
  70. regex = cups-(__VER__)-source\.tar\.bz2
  71. }
  72. %prep
  73. %setup -q
  74. %patch -p0
  75. %{l_shtool} subst \
  76. -e 's;^.SILENT:.*$;;' \
  77. Makedefs.in
  78. %{l_shtool} subst \
  79. -e 's;$libdir/cups;$exec_prefix/libexec/cups;g' \
  80. -e 's;/spool/cups;/spool;g' \
  81. config-scripts/cups-directories.m4 \
  82. configure
  83. %{l_shtool} subst \
  84. -e 's;^\( $(LN)\) ../sbin/\(accept $(BINDIR)/.*\)$;\1 \2;' \
  85. systemv/Makefile
  86. %build
  87. CC="%{l_cc}" \
  88. CFLAGS="%{l_cflags -O} %{l_cppflags} -DPID_FILE='\"%{l_prefix}/var/cups/cupsd.pid\"'" \
  89. CPPFLAGS="%{l_cppflags} -DPID_FILE='\"%{l_prefix}/var/cups/cupsd.pid\"'" \
  90. ./configure \
  91. --prefix=%{l_prefix} \
  92. --bindir=%{l_prefix}/libexec/cups \
  93. --sbindir=%{l_prefix}/libexec/cups \
  94. --with-docdir=%{l_prefix}/share/doc/cups \
  95. --localstatedir=%{l_prefix}/var/cups \
  96. --with-logdir=%{l_prefix}/var/cups/log \
  97. --with-rcdir='' \
  98. --sysconfdir=%{l_prefix}/etc \
  99. --with-cups-user=%{l_musr} \
  100. --with-cups-group=%{l_mgrp} \
  101. --disable-slp \
  102. %if "%{with_ssl}" == "yes"
  103. --enable-ssl \
  104. --with-openssl-includes=%{l_prefix}/include/openssl \
  105. --with-openssl-libs=%{l_prefix}/lib \
  106. %else
  107. --disable-ssl \
  108. %endif
  109. --disable-pam \
  110. --disable-shared
  111. %{l_make} %{l_mflags -O}
  112. %install
  113. rm -rf $RPM_BUILD_ROOT
  114. # install CUPS
  115. DSTROOT="$RPM_BUILD_ROOT" %{l_make} %{l_mflags} install
  116. # make binaries accessable (they have been relocated since most of
  117. # them are likely to cause name space conflicts)
  118. %{l_shtool} mkdir -f -p -m 755 \
  119. $RPM_BUILD_ROOT%{l_prefix}/bin
  120. for i in cups-config lp lpadmin lpc lpinfo lpmove lpoptions lpq lpr lprm \
  121. lpstat; do
  122. ln -s ../libexec/cups/$i $RPM_BUILD_ROOT%{l_prefix}/bin/$i
  123. done
  124. # create run-command script
  125. %{l_shtool} mkdir -f -p -m 755 \
  126. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  127. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  128. %{SOURCE rc.cups} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  129. # provide default configuration
  130. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  131. %{SOURCE cupsd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/cups/
  132. # strip installation
  133. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/cat*
  134. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
  135. for lang in de fr; do
  136. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/$lang || true
  137. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc/cups/$lang || true
  138. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/cups/templates/$lang || true
  139. done
  140. # generate file list
  141. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  142. '%config %{l_prefix}/etc/cups/*'
  143. %files -f files
  144. %clean
  145. rm -rf $RPM_BUILD_ROOT
  146. %post
  147. # after upgrade, restart service
  148. [ $1 -eq 2 ] || exit 0
  149. eval `%{l_rc} cups status 2>/dev/null`
  150. [ ".$cups_active" = .yes ] && %{l_rc} cups restart
  151. exit 0
  152. %preun
  153. # before erase, stop service and remove log files
  154. [ $1 -eq 0 ] || exit 0
  155. %{l_rc} cups stop 2>/dev/null
  156. rm -f $RPM_INSTALL_PREFIX/var/cups/log/* >/dev/null 2>&1 || true
  157. exit 0