You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

178 lines
5.9 KiB

##
## cups.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: cups
Summary: Common Unix Printing System
URL: http://www.cups.org/
Vendor: Easy Software Products
Packager: The OpenPKG Project
Distribution: OpenPKG
Class: EVAL
Group: Print
License: GPL/LGPL with exceptions
Version: 1.1.22
Release: 20041102
# package options
%option with_ssl no
# list of sources
Source0: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
Source1: rc.cups
Source2: cupsd.conf
Patch0: cups.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
PreReq: OpenPKG, openpkg >= 20040130
BuildPreReq: zlib, jpeg, png, tiff
PreReq: zlib, jpeg, png, tiff
%if "%{with_ssl}" == "yes"
BuildPreReq: openssl
PreReq: openssl
%endif
AutoReq: no
AutoReqProv: no
%description
CUPS provides a portable printing layer for Unix-based operating
systems. It has been developed by Easy Software Products to promote
a standard printing solution for all Unix vendors and users.
CUPS provides the System V and Berkeley command-line interfaces and
uses the Internet Printing Protocol (IPP) as the basis for managing
print jobs and queues.
%track
prog cups = {
version = %{version}
url = ftp://ftp.easysw.com/pub/cups/
regex = ((\d+\.)+\d+)
url = ftp://ftp.easysw.com/pub/cups/__NEWVER__/
regex = cups-(__VER__)-source\.tar\.bz2
}
%prep
%setup -q
%patch -p0
%{l_shtool} subst \
-e 's;^.SILENT:.*$;;' \
Makedefs.in
%{l_shtool} subst \
-e 's;$libdir/cups;$exec_prefix/libexec/cups;g' \
-e 's;/spool/cups;/spool;g' \
config-scripts/cups-directories.m4 \
configure
%{l_shtool} subst \
-e 's;^\( $(LN)\) ../sbin/\(accept $(BINDIR)/.*\)$;\1 \2;' \
systemv/Makefile
%build
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O} %{l_cppflags} -DPID_FILE='\"%{l_prefix}/var/cups/cupsd.pid\"'" \
CPPFLAGS="%{l_cppflags} -DPID_FILE='\"%{l_prefix}/var/cups/cupsd.pid\"'" \
./configure \
--prefix=%{l_prefix} \
--bindir=%{l_prefix}/libexec/cups \
--sbindir=%{l_prefix}/libexec/cups \
--with-docdir=%{l_prefix}/share/doc/cups \
--localstatedir=%{l_prefix}/var/cups \
--with-logdir=%{l_prefix}/var/cups/log \
--with-rcdir='' \
--sysconfdir=%{l_prefix}/etc \
--with-cups-user=%{l_musr} \
--with-cups-group=%{l_mgrp} \
--disable-slp \
%if "%{with_ssl}" == "yes"
--enable-ssl \
--with-openssl-includes=%{l_prefix}/include/openssl \
--with-openssl-libs=%{l_prefix}/lib \
%else
--disable-ssl \
%endif
--disable-pam \
--disable-shared
%{l_make} %{l_mflags -O}
%install
rm -rf $RPM_BUILD_ROOT
# install CUPS
DSTROOT="$RPM_BUILD_ROOT" %{l_make} %{l_mflags} install
# make binaries accessable (they have been relocated since most of
# them are likely to cause name space conflicts)
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin
for i in cups-config lp lpadmin lpc lpinfo lpmove lpoptions lpq lpr lprm \
lpstat; do
ln -s ../libexec/cups/$i $RPM_BUILD_ROOT%{l_prefix}/bin/$i
done
# create run-command script
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.cups} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# provide default configuration
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE cupsd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/cups/
# strip installation
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/cat*
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
for lang in de fr; do
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/$lang || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc/cups/$lang || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/cups/templates/$lang || true
done
# generate file list
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
'%config %{l_prefix}/etc/cups/*'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%post
# after upgrade, restart service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} cups status 2>/dev/null`
[ ".$cups_active" = .yes ] && %{l_rc} cups restart
exit 0
%preun
# before erase, stop service and remove log files
[ $1 -eq 0 ] || exit 0
%{l_rc} cups stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/cups/log/* >/dev/null 2>&1 || true
exit 0