pkgname=(cups libcups) pkgbase=cups pkgver=2.4.11 pkgrel=1 arch=('x86_64') url="https://openprinting.github.io/cups" license=('Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause') makedepends=('acl' 'linux-pam' 'gnutls' 'colord' 'libusb' 'avahi' 'systemd' 'libpaper' 'xdg-utils') source=(https://github.com/OpenPrinting/cups/releases/download/v${pkgver}/${pkgbase}-${pkgver}-source.tar.gz) sha256sums=(9a88fe1da3a29a917c3fc67ce6eb3178399d68e1a548c6d86c70d9b13651fd71) build() { cd ${pkgbase}-${pkgver} export DSOFLAGS=${LDFLAGS} local configure_args=( --sysconfdir=/etc --localstatedir=/var --enable-pam=yes --enable-libpape --enable-dbus=yes --with-rundir=/run/cups --with-system-groups=lpadmin --with-docdir=/usr/share/cups/${pkgbase}-${pkgver} --with-pkgconfpath=/usr/lib64/pkgconfig ${configure_options} ) ./configure ${configure_args[@]} make } package_cups() { pkgdesc="OpenPrinting CUPS - daemon package" depends=( 'acl' 'linux-pam' "libcups>=${pkgver}" 'dbus' 'systemd' 'systemd' 'libpaper' 'glibc' 'gcc-libs' 'avahi' 'gnutls') backup=(etc/cups/cupsd.conf etc/cups/snmp.conf etc/cups/printers.conf etc/cups/classes.conf etc/cups/cups-files.conf etc/cups/subscriptions.conf etc/pam.d/cups) install=${pkgbase}.install cd ${pkgbase}-${pkgver} make BUILDROOT=${pkgdir} install install -vdm755 ${pkgdir}/usr/share/doc ln -svnf ../cups/${pkgbase}-${pkgver} ${pkgdir}/usr/share/doc/${pkgbase}-${pkgver} echo "ServerName /run/cups/cups.sock" > ${pkgdir}/etc/cups/client.conf cat > ${pkgdir}/etc/pam.d/cups << "EOF" # Begin /etc/pam.d/cups auth include system-auth account include system-account session include system-session # End /etc/pam.d/cups EOF sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' ${pkgdir}/usr/share/applications/cups.desktop rm -rf ${pkgdir}/run _pick libcups ${pkgdir}/usr/bin/cups-config _pick libcups ${pkgdir}/usr/include _pick libcups ${pkgdir}/usr/lib64 } package_libcups() { pkgdesc="OpenPrinting CUPS - client libraries and headers" depends=('gnutls' 'avahi' 'glibc' 'zlib' 'bash') mv ${pkgname}/* ${pkgdir} }