# $Id$ PNAME="cups" PVER="1.7.5" PBUILD="r2" SPLIT_PACKAGES="libcups cups" PCAT="net-print" HOMEPAGE="http://www.cups.org/" LIB_DEPEND=">= virtual/glibc >= app-crypt/gnutls-3.2 >= app-crypt/libgcrypt-1.6 >= media-libs/libpng-1.5 >= media-libs/libtiff-4 >= media-libs/libjpeg-8 >= net-dns/avahi-0.6.31 >= sys-libs/zlib-1.2.5 >= sys-libs/libstdc++-4.8 >= sys-apps/systemd-216" CUPS_DEPEND=">= sys-libs/pam-1.1 >= sys-apps/acl-2.2 >= sys-apps/dbus-1.8 >= dev-libs/libusb-compat-0.1.3 >= dev-libs/dbus-glib-0.102 >= app-text/libpaper-1.1.24 >= app-text/poppler-0.26" SDEPEND="${LIB_DEPEND} ${CUPS_DEPEND} >= sys-dev/automake-4 >= sys-dev/autoconf-5" SRCFILE="${PNAME}-${PVER}-source.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mbuild mtools multilib systemd msetfeature "!check" SRC_URI=( http://cups.org/software/${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/cups.conf.tmpd mirror://${PNAME}/cups.logrotate mirror://${PNAME}/cups.pam-systemauth mirror://${PNAME}/${PNAME}-1.2.11-multilib.patch mirror://${PNAME}/${PNAME}-1.7.3-systemd-socket.patch mirror://${PNAME}/${PNAME}-1.5.0-build-fix.patch mirror://${PNAME}/${PNAME}-1.6.1-dnssd-deviceid.patch ) #UP2DATE="updatecmd ${HOMEPAGE} | grep 'Download Stable' | grep v[0-9] | sed 's/.*v\([0-9].*\)\ (.*/\1/'" UP2DATE="updatecmd ${HOMEPAGE} | sed 's:-source::g' | firsttarball" split_info_libcups() { DESCRIPTION="cups: common unix printing system - client libraries and headers" DEPEND="${LIB_DEPEND}" } split_info_cups() { DESCRIPTION="cups: common unix printing system - service daemons." DEPEND="== net-print/libcups-${PVER} ${CUPS_DEPEND}" } pkg_setup() { preinstall_cups } src_prepare() { munpack ${SRCFILE} || die # fix hardcoded /usr/lib in cups-directories.m4 to respect 64bit arches mpatch ${PNAME}-1.2.11-multilib.patch || die # adds systemd socket activation support mpatch ${PNAME}-1.7.3-systemd-socket.patch || die # fix build, adds missing -lrt mpatch ${PNAME}-1.5.0-build-fix.patch || die # mark DNSSD device-ids that have been guessed at with "FZY:1;" mpatch ${PNAME}-1.6.1-dnssd-deviceid.patch || die # non standard configure all-abis aclocal -I config-scripts --force || die all-abis autoconf --force || die } src_compile() { mconfigure \ --localstatedir=/var \ --with-docdir=/usr/share/cups/html \ --with-systemdsystemunitdir=$(mget-systemd-unit-dir) \ --with-cups-user=lp \ --with-cups-group=lp \ --with-system-groups=lpadmin \ --enable-threads \ --enable-pam \ --enable-nls \ --enable-dbus \ --enable-png \ --enable-jpeg \ --enable-tiff \ --enable-libpaper \ --enable-avahi \ --enable-ssl=yes \ --enable-gnutls \ --disable-slp \ --disable-php \ --disable-ldap \ || die mmake || die } src_install_libcups() { mmake BUILDROOT=${BINDIR} install-headers || die mmake BUILDROOT=${BINDIR} install-libs || die # install config utiliy so other packages can find the libs # because there a no pkgconfig files minstallexec cups-config || die } src_install_cups() { mmake BUILDROOT=${BINDIR} install-data || die mmake BUILDROOT=${BINDIR} install-exec || die # provided by libcups rm ${BINDIR}/usr/bin/cups-config || die # gzip *all* ppd's not just few find ${BINDIR}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f || die # remove 32bit serverbins and co on 64bit multilib systems if [[ ${ARCH} = x86_64 ]] then [[ -d ${BINDIR}/usr/lib/cups ]] && ( rm -rf ${BINDIR}/usr/lib/cups || die; ) fi # remove possible installed backup configs find ${BINDIR}/etc -name "*.O" | xargs rm -f || die find ${BINDIR}/etc -name "*.N" | xargs rm -f || die # removing cups created init-scripts rm -rf ${BINDIR}/etc/rc*.d || die # remove /etc/init.d too rm -rf ${BINDIR}/etc/init.d || die # tempfile creation minstalltmp cups.conf.tmpd cups.conf || die # install logrotate config minstalllog cups.logrotate cups || die # install pam config minstallpam cups.pam-systemauth cups || die # ship some config files to keep many apps happy (javapps nxnode etc) memptyfile /etc/cups/printers.conf || die memptyfile /etc/cups/classes.conf || die memptyfile /etc/cups/client.conf || die memptyfile /etc/cups/subscriptions.conf || die # prevents uninstall from prior versions mkeepdir /usr/share/cups/profiles || die mkeepdir /usr/$(mlibdir)/cups/driver || die mkeepdir /var/log/cups || die mkeepdir /var/run/cups/certs || die mkeepdir /var/spool/cups || die mkeepdir /var/spool/cups/tmp || die # create a rss feed directory mkeepdir /var/cache/cups/rss || die mchown lp.lp /var/cache/cups/rss || die mchmod 0740 /var/cache/cups/rss || die # create a ssl directory to store cacerts and to fix some samba issues mkeepdir /etc/cups/ssl || die mchown root:lp /etc/cups/ssl || die mchmod 0700 /etc/cups/ssl || die # fix cupsd permisions mchmod 0755 /usr/sbin/cupsd || die # install missing docs minstalldocs CHANGES* CREDITS* LICENSE* README* || die } preinstall_cups() { mgroupadd -o "-g 106" lpadmin mgroupadd -o "-g 9" lp museradd -o "-u 9 -g lp -d /var/spool/lpd -s /bin/false" lp } postinstall_cups() { mstartunit cups.service cupsd mstartunit cups.socket cupsd } postremove_cups() { mstopunit cups.service cupsd mstopunit cups.socket cupsd }