# # "$Id: cups.spec.in 10428 2012-04-23 17:46:53Z mike $" # # RPM "spec" file for CUPS. # # Original version by Jason McMullan . # # Copyright 2007-2012 by Apple Inc. # Copyright 1999-2007 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the # property of Apple Inc. and are protected by Federal copyright # law. Distribution and use rights are outlined in the file "LICENSE.txt" # which should have been included with this file. If this file is # file is missing or damaged, see the license at "http://www.cups.org/". # # Conditional build options (--with name/--without name): # # dbus - Enable/disable DBUS support (default = enable) # dnssd - Enable/disable DNS-SD support (default = disable) # php - Enable/disable PHP support (default = enable) # static - Enable/disable static libraries (default = enable) %{!?_with_dbus: %{!?_without_dbus: %define _with_dbus --with-dbus}} %{?_with_dbus: %define _dbus --enable-dbus} %{!?_with_dbus: %define _dbus --disable-dbus} #%{!?_with_php: %{!?_without_php: %define _with_php --with-php}} #%{?_with_php: %define _php --with-php} #%{!?_with_php: %define _php --without-php} #%{!?_with_static: %{!?_without_static: %define _without_static --without-static}} #%{?_with_static: %define _static --enable-static} #%{!?_with_static: %define _static --disable-static} %define _unpackaged_files_terminate_build 0 Summary: CUPS Name: cups Version: 1.5.3 Release: 11 #Epoch: 1 License: GPL Group: System Environment/Daemons #Source: http://ftp.easysw.com/pub/cups/1.5.3/cups-1.5.3-source.tar.bz2 Source: %{name}-%{version}.tar.gz Url: http://www.cups.org Packager: Anonymous Vendor: Apple Inc. # Use buildroot so as not to disturb the version already installed #BuildRoot: /tmp/%{name}-root # Dependencies... Requires: %{name}-libs Requires(post): eglibc BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(poppler) = 0.20.0 BuildRequires: pkgconfig(poppler-glib) = 0.20.0 BuildRequires: pkgconfig(ijs) BuildRequires: pkgconfig(lcms2) = 2.3 BuildRequires: xpdf-tools = 3.02 BuildRequires: libjpeg-devel BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libusb) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: libgcrypt-devel BuildRequires: avahi-libs BuildRequires: avahi-devel #BuildRequires: pkgconfig(po4a) Obsoletes: lpd, lpr, LPRng Provides: lpd, lpr, LPRng Obsoletes: cups-da, cups-de, cups-es, cups-et, cups-fi, cups-fr, cups-he Obsoletes: cups-id, cups-it, cups-ja, cups-ko, cups-nl, cups-no, cups-pl Obsoletes: cups-pt, cups-ru, cups-sv, cups-zh %package devel Summary: CUPS - development environment Group: Development/Libraries Requires: %{name}-libs #Requires: %{name}-libs = %{epoch}:%{version} %package libs Summary: CUPS - shared libraries Group: System Environment/Libraries Provides: libcups1 %package -n cups-data Summary: CUPS - shared libraries Group: System Environment/Libraries #%package lpd #Summary: CUPS - LPD support #Group: System Environment/Daemons #Requires: %{name} = %{epoch}:%{version} xinetd #%if %{?_with_php:1}%{!?_with_php:0} #%package php #Summary: CUPS - PHP support #Group: Development/Languages #Requires: %{name}-libs = %{epoch}:%{version} #%endif %description CUPS is the standards-based, open source printing system developed by Apple Inc. for OS X and other UNIX®-like operating systems. %description devel This package provides the CUPS headers and development environment. %description libs This package provides the CUPS shared libraries. %description -n cups-data This package provides CUPS configuration files #%description lpd #This package provides LPD client support. #%if %{?_with_php:1}%{!?_with_php:0} #%description php #This package provides PHP support for CUPS. #%endif %prep %setup -q %build %configure %{_dbus} %{_dnssd} %{_php} %{_static} \ --without-mandir \ --without-docdir \ --localedir=/usr/share/cups/locale \ --sysconfdir=/opt/etc \ --localstatedir=/opt/var \ --disable-mallinfo \ --disable-libpaper \ --disable-libusb \ --disable-tcp-wrappers \ --disable-acl \ --disable-dbus \ --without-dbusdir \ --disable-unit-tests \ --disable-relro \ --enable-image \ --enable-jpeg \ --enable-png \ --disable-tiff \ --disable-slp \ --disable-ldap \ --enable-gssapi \ --enable-threads \ --enable-debug \ --disable-cdsassl \ --enable-gnutls \ --disable-openssl \ --enable-ssl \ --enable-avahi \ --disable-pam \ --enable-largefile \ --disable-launchd \ --enable-raw-printing \ --enable-bannertops \ --enable-texttops \ --disable-pap \ --without-java --without-php --without-python --without-perl --disable-webif \ --with-languages=en --without-smfmanifestdir \ --with-local_protocols='CUPS dnssd' --with-printcap=/opt/etc/cups/printcap \ --with-remote_protocols='CUPS dnssd' --with-log-level=debug # If we got this far, all prerequisite libraries must be here. make -Ioprs -Iopvp -I../opvp -I../.. -I. -I.. -I/usr/include/poppler -I/usr/include/ijs %install # Make sure the RPM_BUILD_ROOT directory exists. rm -rf $RPM_BUILD_ROOT make BUILDROOT=$RPM_BUILD_ROOT install %post #if [ ! -z "`getent group app`" ]; then chown -R 5000:5000 /usr/lib/cups/backend/* #fi if [ "$1" = configure ]; then # Set up lpadmin group. #if [ -z "`getent group lpadmin`" ]; then # addgroup --system lpadmin #fi db_get cupsys/backend && SELECTED=$RET # We remove the scsi backend from the output as it got removed in CUPS 1.5.0 list=`echo $SELECTED | sed -e 's/, /,/g' | sed -e 's/scsi,*//g' | sed -e 's/parallel,*//g' | sed -e 's/serial,*//g'` if dpkg --compare-versions "$2" lt-nl "1.5.3-3"; then if ! echo $list | grep -q "\bipp14\b"; then list=`echo $list | sed -e 's/\bipp\b/ipp,ipp14/g'` fi fi save_IFS=$IFS IFS=, (cd /usr/lib/cups/backend && rm -f http https ipp ipp14 ipps lpd socket usb snmp dnssd mdns) for module in $list; do ln /usr/lib/cups/backend-available/$module /usr/lib/cups/backend/$module if [ "$module" = "ipp" ]; then ln /usr/lib/cups/backend/ipp /usr/lib/cups/backend/http ln /usr/lib/cups/backend/ipp /usr/lib/cups/backend/https ln /usr/lib/cups/backend/ipp /usr/lib/cups/backend/ipps fi if [ "$module" = "dnssd" ]; then ln /usr/lib/cups/backend/dnssd /usr/lib/cups/backend/mdns fi done IFS=$save_IFS # Resync Debconf database with real state list=`( cd /usr/lib/cups/backend && for f in ipp ipp14 lpd socket usb snmp dnssd; do [ -e $f ] && echo -n "$f, "; done ) | sed -e 's/, $//'` db_set cupsys/backend $list; if dpkg --compare-versions "$2" lt "1.5.3-3"; then modprobe usblp >/dev/null 2>&1 || : fi fi mv /usr/lib/cups/backend/ipp /usr/lib/cups/backend/ipp15 mv /usr/lib/cups/backend/ipp14 /usr/lib/cups/backend/ipp %post -n cups-data mkdir -p /opt/var/run/cups mkdir -p /opt/var/spool/ mkdir -p /opt/var/spool/cups/ mkdir -p /opt/vat/spool/cups/tmp mkdir -p /opt/var/cache/cups mkdir -p /opt/var/log/cups #if [ ! -z "`getent group app`" ]; then chown -R 5000:5000 /opt/etc/cups/ chown -R 5000:5000 /opt/var/run/cups/ chown -R 5000:5000 /opt/var/spool/cups/ chown -R 5000:5000 /opt/var/cache/cups/ chown -R 5000:5000 /opt/var/log/cups/ chown -R 5000:5000 /usr/lib/cups/backend/* #fi if [ -e /opt/etc/default/cups ]; then . /opt/etc/default/cups fi if [ "$1" = configure ]; then if [ ! -e /opt/etc/cups/raw.types ]; then cat >/opt/etc/cups/raw.types </opt/etc/cups/raw.convs < /opt/etc/cups/raw.convs else sed 's/^application/#application/' \ < /opt/etc/cups/raw.convs-convert > /opt/etc/cups/raw.convs fi rm -f /opt/etc/cups/raw.convs-convert fi if [ -f /opt/etc/cups/classes.conf ]; then chown 5000:5000 /opt/etc/cups/classes.conf ; chmod 600 /opt/etc/cups/classes.conf fi if [ -f /opt/etc/cups/printers.conf ]; then chown 5000:5000 /opt/etc/cups/printers.conf ; chmod 600 /opt/etc/cups/printers.conf fi # symlink snakeoil SSL certificate if present if [ -e /opt/etc/ssl/certs/ssl-cert-snakeoil.pem -a \ -e /opt/etc/ssl/private/ssl-cert-snakeoil.key -a \ -n "`getent group ssl-cert`" -a ! -e /opt/etc/cups/ssl/server.crt \ -a ! -e /opt/etc/cups/ssl/server.key -a ! -h /opt/etc/cups/ssl/server.crt \ -a ! -h /opt/etc/cups/ssl/server.key ]; then ln -s /opt/etc/ssl/certs/ssl-cert-snakeoil.pem /opt/etc/cups/ssl/server.crt ln -s /opt/etc/ssl/private/ssl-cert-snakeoil.key /opt/etc/cups/ssl/server.key fi APP_PROFILE=/opt/etc/apparmor.d/usr.sbin.cupsd if [ -f "$APP_PROFILE" ]; then # Add the local/ include LOCAL_APP_PROFILE=/opt/etc/apparmor.d/local/usr.sbin.cupsd [ -e "$LOCAL_APP_PROFILE" ] || \ [ -e /opt/etc/apparmor.d/local -a ! -d /opt/etc/apparmor.d/local ] || { tmp=`mktemp` cat < "$tmp" # Site-specific additions and overrides for usr.sbin.cupsd. # For more details, please see /etc/apparmor.d/local/README. EOM mkdir `dirname $LOCAL_APP_PROFILE` 2>/dev/null || true mv -f "$tmp" "$LOCAL_APP_PROFILE" chmod 644 "$LOCAL_APP_PROFILE" } # Reload the profile, including any abstraction updates if aa-status --enabled 2>/dev/null; then apparmor_parser -r -T -W "$APP_PROFILE" || true fi fi # Clear cache if we upgrade to 1.4.x if dpkg --compare-versions "$2" lt-nl "1.4.1-5"; then rm /opt/var/cache/cups/* 2> /dev/null || : fi # Clear PPD cache if we upgrade to 1.5.x if dpkg --compare-versions "$2" lt-nl "1.5.0-3"; then rm /opt/var/cache/cups/ppds.dat 2> /dev/null || : fi # Manage printcap file and associated symlinks if [ -e /opt/etc/cups/cupsd.conf ]; then if [ -e /opt/etc/cups/printcap.cups ]; then rm -f /opt/etc/cups/printcap.cups fi if [ -L /opt/etc/cups/printcap -a ! -e /opt/etc/cups/printcap ]; then printcap_file=`egrep '^Printcap ' /opt/etc/cups/cupsd.conf | awk '{print $2}' | tail -n 1` if [ -z "$printcap_file" ]; then printcap_file=/opt/var/run/cups/printcap fi if [ ! -e /opt/etc/cups/printcap -a -e $printcap_file ]; then ln -s $printcap_file /opt/etc/cups/printcap fi fi fi fi if which lpstat > /dev/null 2>&1 && \ which lpinfo > /dev/null 2>&1 && \ which lpadmin > /dev/null 2>&1 && \ LC_ALL=C lpstat -h /opt/var/run/cups/cups.sock -r | grep -v not > /dev/null 2>&1; then tempfiles= trap 'rm -f $tempfiles; exit 0' 0 HUP INT QUIT ILL ABRT PIPE TERM tmpfile0=`mktemp -t updateppds.XXXXXX` tempfiles="$tempfiles $tmpfile0" lpinfo -h /opt/var/run/cups/cups.sock -m > $tmpfile0 if [ "$1" = triggered ] || [ "$1" = configure ] ; then # Update external drivers' queues. # # We log the modification dates of the file in # /usr/share/cups/ppd-updaters/* after updating the PPDs # according to them. These dates are more or less the creation # dates of the driver packages. Then we only update the PPDs of # packages, where the /usr/share/cups/ppd-updaters/* file has a # modification date different to the logged date as this means # that a fresh /usr/share/cups/ppd-updaters/* file and # therefore a fresh package got installed. This avoids updating # of PPDs when the corresponding package was not changed. logfile=/opt/var/cache/cups/ppd-updates touch $logfile for driverfile in `ls /usr/share/cups/ppd-updaters`; do driver=`echo $driverfile | perl -p -e 's/\.ppd-updater$//' | perl -p -e 's/^printer-driver-//'` modtime=`ls -l --time-style=+%s /usr/share/cups/ppd-updaters/$driverfile | perl -p -e 's/^\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s*$/$1\n/'` oldmodtime=`cat $logfile | grep " $driver$" | cut -d ' ' -f 1` if [ "$modtime" != "$oldmodtime" ]; then echo "Updating PPD files for $driver ..." . /usr/share/cups/ppd-updaters/${driverfile} ppd_updater "${DRIVER_REGEXP}" "${GENNICKNAME_REGEXP}" cat $logfile | grep -v " $driver$" > $logfile.new || touch $logfile.new echo "$modtime $driver" >> $logfile.new mv $logfile.new $logfile fi done fi fi db_stop exit 0 %post libs /sbin/ldconfig %preun #if test $1 = 0; then # /sbin/service cups stop # /sbin/chkconfig --del cups #fi %postun #if test $1 -ge 1; then # /sbin/service cups stop # /sbin/service cups start #fi %postun libs /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT %files #%docdir /usr/share/doc/cups #%manifest cups.manifest %defattr(-,root,root) #%if %{?_with_dbus:1}%{!?_with_dbus:0} # DBUS #/etc/dbus-1/system.d/* #%endif # PAM #%dir /etc/pam.d #/etc/pam.d/* # RC dirs are a pain under Linux... Uncomment the appropriate ones if you # don't use Red Hat or Mandrake... #/etc/init.d/* #/etc/rc0.d/* #/etc/rc2.d/* #/etc/rc3.d/* #/etc/rc5.d/* # OLD RedHat/Mandrake #/etc/rc.d/init.d/* #/etc/rc.d/rc0.d/* #/etc/rc.d/rc2.d/* #/etc/rc.d/rc3.d/* #/etc/rc.d/rc5.d/* #/sbin/rc.d/* #/sbin/rc.d/rc0.d/* #/sbin/rc.d/rc2.d/* #/sbin/rc.d/rc3.d/* #/sbin/rc.d/rc5.d/* /usr/bin/ppd* /usr/bin/cancel /usr/bin/cupstestdsc /usr/bin/cupstestppd /usr/bin/ipptool /usr/bin/lp /usr/bin/lpoptions /usr/bin/lppasswd /usr/bin/lpstat %attr(0755,root,root) %dir /usr/lib/cups %attr(0755,root,root) %dir /usr/lib/cups/backend /usr/lib/cups/backend/dnssd /usr/lib/cups/backend/http /usr/lib/cups/backend/https /usr/lib/cups/backend/ipp /usr/lib/cups/backend/ipp14 /usr/lib/cups/backend/ipps /usr/lib/cups/backend/lpd #/usr/lib/cups/backend/parallel #/usr/lib/cups/backend/serial /usr/lib/cups/backend/snmp /usr/lib/cups/backend/socket /usr/lib/cups/backend/usb %attr(0755,root,root) %dir /usr/lib/cups/cgi-bin /usr/lib/cups/cgi-bin/* %attr(0755,root,root) %dir /usr/lib/cups/daemon /usr/lib/cups/daemon/cups-deviced /usr/lib/cups/daemon/cups-driverd /usr/lib/cups/daemon/cups-exec /usr/lib/cups/daemon/cups-polld %dir /usr/lib/cups/driver %attr(0755,root,root) %dir /usr/lib/cups/filter %exclude /usr/lib/cups/filter/commandtoescpx %exclude /usr/lib/cups/filter/commandtopclx %exclude /usr/lib/cups/filter/imagetops %exclude /usr/lib/cups/filter/imagetoraster %exclude /usr/lib/cups/filter/pdftops %exclude /usr/lib/cups/filter/rastertoescpx %exclude /usr/lib/cups/filter/rastertopclx %exclude /usr/lib/cups/filter/texttops /usr/lib/cups/filter/* %attr(0755,root,root) %dir /usr/lib/cups/monitor /usr/lib/cups/monitor/* %attr(0755,root,root) %dir /usr/lib/cups/notifier /usr/lib/cups/notifier/* %attr(0755,root,root) %dir /usr/sbin/ %attr(0755,root,root) /usr/sbin/* %attr(-,root,root) %dir /usr/share/cups #%dir /usr/share/cups/banners #/usr/share/cups/banners/* %dir /usr/share/cups/charsets /usr/share/cups/charsets/* #%dir /usr/share/cups/data #/usr/share/cups/data/* #%dir /usr/share/cups/drv #/usr/share/cups/drv/* %dir /usr/share/cups/fonts /usr/share/cups/fonts/* #%dir /usr/share/cups/ipptool #/usr/share/cups/ipptool/* %dir /usr/share/cups/mime /usr/share/cups/mime/* %dir /usr/share/cups/model %dir /usr/share/cups/ppdc /usr/share/cups/ppdc/* #%dir /usr/share/cups/templates #/usr/share/cups/templates/* #%dir /usr/share/doc/cups #/usr/share/doc/cups/*.* #%dir /usr/share/doc/cups/de #/usr/share/doc/cups/de/* #%dir /usr/share/doc/cups/es #/usr/share/doc/cups/es/* #%dir /usr/share/doc/cups/eu #/usr/share/doc/cups/eu/* #%dir /usr/share/doc/cups/fr #/usr/share/doc/cups/fr/* #%dir /usr/share/doc/cups/hu #/usr/share/doc/cups/hu/* #%dir /usr/share/doc/cups/id #/usr/share/doc/cups/id/* #%dir /usr/share/doc/cups/it #/usr/share/doc/cups/it/* #%dir /usr/share/doc/cups/ja #/usr/share/doc/cups/ja/* #%dir /usr/share/doc/cups/pl #/usr/share/doc/cups/pl/* #%dir /usr/share/doc/cups/ru #/usr/share/doc/cups/ru/* #%dir /usr/share/doc/cups/help #/usr/share/doc/cups/help/accounting.html #/usr/share/doc/cups/help/cgi.html #/usr/share/doc/cups/help/glossary.html #/usr/share/doc/cups/help/kerberos.html #/usr/share/doc/cups/help/license.html #/usr/share/doc/cups/help/man-*.html #/usr/share/doc/cups/help/network.html #/usr/share/doc/cups/help/options.html #/usr/share/doc/cups/help/overview.html #/usr/share/doc/cups/help/policies.html #/usr/share/doc/cups/help/ref-*.html #/usr/share/doc/cups/help/security.html #/usr/share/doc/cups/help/sharing.html #/usr/share/doc/cups/help/standard.html #/usr/share/doc/cups/help/translation.html #/usr/share/doc/cups/help/whatsnew.html #%dir /usr/share/doc/cups/images #/usr/share/doc/cups/images/* #/usr/share/locale/* #%dir /usr/share/man/man1 #/usr/share/man/man1/cancel.1.gz #/usr/share/man/man1/cupstestdsc.1.gz #/usr/share/man/man1/cupstestppd.1.gz #/usr/share/man/man1/ipptool.1.gz #/usr/share/man/man1/lp.1.gz #/usr/share/man/man1/lpoptions.1.gz #/usr/share/man/man1/lppasswd.1.gz #/usr/share/man/man1/lpq.1.gz #/usr/share/man/man1/lpr.1.gz #/usr/share/man/man1/lprm.1.gz #/usr/share/man/man1/lpstat.1.gz #%dir /usr/share/man/man5 #/usr/share/man/man5/*.conf.5.gz #/usr/share/man/man5/ipptoolfile.5.gz #/usr/share/man/man5/mime.*.5.gz #%dir /usr/share/man/man8 #/usr/share/man/man8/accept.8.gz #/usr/share/man/man8/cupsaddsmb.8.gz #/usr/share/man/man8/cupsaccept.8.gz #/usr/share/man/man8/cupsctl.8.gz #/usr/share/man/man8/cupsfilter.8.gz #/usr/share/man/man8/cupsd.8.gz #/usr/share/man/man8/cupsdisable.8.gz #/usr/share/man/man8/cupsenable.8.gz #/usr/share/man/man8/cupsreject.8.gz #/usr/share/man/man8/cups-deviced.8.gz #/usr/share/man/man8/cups-driverd.8.gz #/usr/share/man/man8/cups-polld.8.gz #/usr/share/man/man8/lpadmin.8.gz #/usr/share/man/man8/lpc.8.gz #/usr/share/man/man8/lpinfo.8.gz #/usr/share/man/man8/lpmove.8.gz #/usr/share/man/man8/reject.8.gz # Desktop files #/usr/share/applications/* #/usr/share/icons/* %files devel %defattr(-,root,root) #%dir /usr/share/cups/examples #/usr/share/cups/examples/* #%dir /usr/share/man/man1 #/usr/share/man/man1/cups-config.1.gz #/usr/share/man/man1/ppd*.1.gz #%dir /usr/share/man/man5 #/usr/share/man/man5/ppdcfile.5.gz #/usr/share/man/man7/backend.7.gz #/usr/share/man/man7/filter.7.gz #/usr/share/man/man7/notifier.7.gz /usr/bin/cups-config %dir /usr/include/cups /usr/include/cups/* /usr/lib/*.so #%if %{?_with_static:1}%{!?_with_static:0} #/usr/lib*/*.a #%endif #%dir /usr/share/doc/cups/help #/usr/share/doc/cups/help/api*.html #/usr/share/doc/cups/help/postscript-driver.html #/usr/share/doc/cups/help/ppd-compiler.html #/usr/share/doc/cups/help/raster-driver.html #/usr/share/doc/cups/help/spec*.html %files libs %defattr(-,root,root) /usr/lib/*.so.* %files -n cups-data %defattr(-,root,root) %attr(0755,app,app) %dir /opt/etc/cups %config(noreplace) /opt/etc/cups/*.conf /opt/etc/cups/cupsd.conf.default %dir /opt/etc/cups/interfaces %attr(0755,app,app) %dir /opt/etc/cups/ppd %attr(0700,app,app) %dir /opt/etc/cups/ssl %attr(0755,app,app) %dir /opt/var/cache/cups %attr(0775,app,app) %dir /opt/var/cache/cups/rss %attr(0755,app,app) %dir /opt/var/log/cups %attr(0755,app,app) %dir /opt/var/run/cups %attr(0711,lp,sys) %dir /opt/var/run/cups/certs %attr(0755,app,app) %dir /opt/var/spool/cups %attr(1777,app,app) %dir /opt/var/spool/cups/tmp #%files lpd #%defattr(-,app,app) #/opt/etc/xinetd.d/cups-lpd #%dir /usr/lib/cups #%dir /usr/lib/cups/daemon #/usr/lib/cups/daemon/cups-lpd #%dir /usr/share/man/man8 #/usr/share/man/man8/cups-lpd.8.gz #%if %{?_with_php:1}%{!?_with_php:0} #%files php ## PHP #/usr/lib*/php* #%endif # # End of "$Id: cups.spec.in 10428 2012-04-23 17:46:53Z mike $". #