]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blobdiff - cups/cups.nm
cups: Add tmpfiles.
[people/arne_f/ipfire-3.x.git] / cups / cups.nm
index 39225947d531d30c27a1dc27cd55995967284dc5..682f3008845c321fc742a8722a3678d0592bcbaf 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = cups
-version    = 1.4.5
-release    = 7
+version    = 2.2.1
+release    = 2
 
 groups     = Applications/Printing
 url        = http://cups.org/software.php
@@ -13,12 +13,12 @@ license    = GPLv2+
 summary    = The common UNIX printing system.
 
 description
-       CUPS is the standards-based, open source printing system developed \
+       CUPS is the standards-based, open source printing system developed
        by Apple Inc. for Mac OS(R) X and other UNIX(R)-like operating systems.
 end
 
-source_dl  = http://ftp.easysw.com/pub/cups/%{version}/
-sources    = %{thisapp}-source.tar.bz2
+source_dl  = https://github.com/apple/cups/releases/download/v%{version}/
+sources    = %{thisapp}-source.tar.gz
 
 build
        requires
@@ -28,31 +28,37 @@ build
                avahi-devel
                cyrus-sasl-devel
                gcc-c++
-               ghostscript
                gnutls-devel
+               libacl-devel
                libgcrypt-devel
                libjpeg-devel
                libpng-devel
-               libselinux-devel
                libtasn1-devel
                libtiff-devel
+               libusb-devel
                openldap-devel
+               openssl-devel
                pam-devel
-               perl
-               python
+               systemd-devel
                zlib-devel
        end
 
+       CFLAGS += -DLDAP_DEPRECATED=1
+
        configure_options += \
-               --sysconfdir=/etc \
-               --localstatedir=/var \
+               --localedir=%{datadir}/locale \
+               --with-cupsd-file-perm=0755 \
                --with-log-file-perm=0600 \
+               --with-docdir=%{datadir}/%{name}/www \
+               --with-dbusdir=%{sysconfdir}/dbus-1 \
                --enable-pie \
                --enable-relro \
                --enable-avahi \
                --enable-lspp \
                --enable-threads \
-               --enable-gnutls
+               --enable-gnutls \
+               --enable-webif \
+               --with-xinetd=no
 
        prepare_cmds
                aclocal -I config-scripts
@@ -65,18 +71,129 @@ build
                # Remove sysvinit scripts
                rm -vfr %{BUILDROOT}/etc/init.d/cups %{BUILDROOT}/etc/rc*.d
 
+               # Install default config file.
                mkdir -pv %{BUILDROOT}/etc/cups
                cp -vf %{DIR_APP}/conf/cupsd.conf %{BUILDROOT}/etc/cups/
 
-               # Logrotate
-               mkdir -pv %{BUILDROOT}/etc/logrotate.d/
-               cp -vf %{DIR_SOURCE}/cups.logrotate %{BUILDROOT}/etc/logrotate.d/cups
+               # Rename systemd service files.
+               mv %{BUILDROOT}%{unitdir}/org.cups.cupsd.path \
+                       %{BUILDROOT}%{unitdir}/cups.path
+               mv %{BUILDROOT}%{unitdir}/org.cups.cupsd.service \
+                       %{BUILDROOT}%{unitdir}/cups.service
+               mv %{BUILDROOT}%{unitdir}/org.cups.cupsd.socket \
+                       %{BUILDROOT}%{unitdir}/cups.socket
+               mv %{BUILDROOT}%{unitdir}/org.cups.cups-lpd.socket \
+                       %{BUILDROOT}%{unitdir}/cups-lpd.socket
+               mv %{BUILDROOT}%{unitdir}/org.cups.cups-lpd@.service \
+                       %{BUILDROOT}%{unitdir}/cups-lpd@.service
+
+               sed -i -e "s,org.cups.cupsd,cups,g" \
+                       %{BUILDROOT}%{unitdir}/cups.service
+
+               # Fix permissions
+               chown root:lp %{BUILDROOT}%{localstatedir}/run/cups
+               chmod 0755 %{BUILDROOT}%{localstatedir}/run/cups
        end
 end
 
 packages
        package %{name}
-               requires = ghostscript
+               recomends
+                       ghostscript
+               end
+
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl --no-reload enable cups.path >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl --no-reload disable cups.path >/dev/null 2>&1 || :
+                       systemctl --no-reload disable cupsd.socket >/dev/null 2>&1 || :
+                       systemctl --no-reload disable cupsd.service >/dev/null 2>&1 || :
+                       systemctl stop cupsd.socket >/dev/null 2>&1 || :
+                       systemctl stop cupsd.service >/dev/null 2>&1 || :
+                       systemctl stop cups.path >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl try-restart cups.path >/dev/null 2>&1 || :
+                       systemctl try-restart cupsd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-client
+               summary = CUPS printing system - client programs.
+               description
+                       CUPS printing system provides a portable printing layer for
+                       UNIX operating systems. This package contains command-line client
+                       programs.
+               end
+
+               requires
+                       %{name}-libs = %{thisver}
+               end
+
+               provides += \
+                       lpr
+
+               files
+                       %{sbindir}/lpc.cups
+                       %{bindir}/cancel*
+                       %{bindir}/lp*
+                       %{mandir}/man1/lp*.1.gz
+                       %{mandir}/man1/cancel-cups.1.gz
+                       %{mandir}/man8/lpc-cups.8.gz
+               end
+       end
+
+       package %{name}-lpd
+               summary = CUPS printing system - lpd emulation.
+               description
+                       CUPS printing system provides a portable printing layer for
+                       UNIX operating systems. This is the package that provides standard
+                       lpd emulation.
+               end
+
+               requires
+                       %{name} = %{thisver}
+                       %{name}-libs = %{thisver}
+               end
+
+               provides += \
+                       lpd
+
+               files
+                       %{unitdir}/cups-lpd.socket
+                       %{unitdir}/cups-lpd@.service
+                       %{prefix}/lib/daemon/cups-lpd
+                       %{mandir}/man8/cups-lpd.8.gz
+               end
+
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl --no-reload disable cups-lpd.socket >/dev/null 2>&1 || :
+                       systemctl --no-reload disable cups-lpd@.service >/dev/null 2>&1 || :
+                       systemctl stop cups-lpd.socket >/dev/null 2>&1 || :
+                       systemctl stop cups-lpd@.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl try-restart cups-lpd@.service >/dev/null 2>&1 || :
+               end
        end
 
        package %{name}-devel
@@ -89,6 +206,27 @@ packages
                template LIBS
        end
 
+       package %{name}-ipptool
+               summary = CUPS printing system - tool for performing IPP requests.
+               description
+                       Sends IPP requests to the specified URI and tests and/or displays \
+                       the results.
+               end
+
+               requires
+                       %{name}-libs = %{thisver}
+               end
+
+               files
+                       %{bindir}/ipptool
+                       %{bindir}/ippfind
+                       %{datadir}/cups/ipptool
+                       %{datadir}/cups/ipptool/*
+                       %{mandir}/man1/ipptool.1.gz
+                       %{mandir}/man5/ipptoolfile.5.gz
+               end
+       end
+
        package %{name}-debuginfo
                template DEBUGINFO
        end