cups.spec 5.5 KB

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