# Maintainer: Natanael Copa pkgname=cups pkgver=1.6.2 pkgrel=1 pkgdesc="The CUPS Printing System" url="http://www.cups.org/" arch="all" license="GPL" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs ipptool $pkgname-client $pkgname-lang" depends_dev="openssl-dev zlib-dev" makedepends="$depends_dev libpaper-dev dbus-dev jpeg-dev>=8" depends="cups-client poppler-utils openssl dbus" install="cups.pre-install" pkggroups="lp lpadmin" pkgusers="lp" replaces="cups-doc" source="http://www.cups.org/software/$pkgver/$pkgname-$pkgver-source.tar.bz2 $pkgname.logrotate cupsd.initd CVE-2014-2856.patch CVE-2014-3537.patch CVE-2014-5029_5030_5031.patch " _builddir="$srcdir"/$pkgname-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$srcdir"/$pkgname-$pkgver ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-logdir=/var/log/cups \ --with-docdir=/usr/share/cups \ --with-cups-user=lp \ --with-cups-group=lp \ --with-system-groups=lpadmin \ --without-php \ --disable-pam \ --disable-ldap \ --libdir=/usr/lib \ --enable-raw-printing \ --enable-dbus \ --with-dbusdir=/etc/dbus-1 \ --enable-libpaper \ --enable-ssl=yes \ --enable-gnutls \ --with-pdftops=pdftops \ --with-optim="$CFLAGS" make || return 1 } package() { cd "$srcdir"/$pkgname-$pkgver make BUILDROOT="$pkgdir" install rm -rf "$pkgdir"/etc/init.d "$pkgdir"/etc/rc* install -D -m644 ../cups.logrotate "$pkgdir"/etc/logrotate.d/cups install -D -m755 ../cupsd.initd "$pkgdir"/etc/init.d/cupsd sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' "$pkgdir"/usr/share/applications/cups.desktop find "$pkgdir"/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f } _mv() { for i in "$@"; do mkdir -p "$subpkgdir"/${i%/*} mv "$pkgdir"/$i "$subpkgdir"/${i%/*}/ || return 1 done } libs() { pkgdesc="CUPS libraries" depends= replaces="libcups" cd "$pkgdir" _mv usr/lib/*.so* install -d "$pkgdir"/etc/cups } ipptool() { pkgdesc="" depends= cd "$pkgdir" _mv usr/bin/ipptool \ usr/share/cups/ipptool } client() { pkgdesc="CUPS client" depends= cd "$pkgdir" _mv usr/bin \ usr/sbin/accept \ usr/sbin/cupsaddsmb \ usr/sbin/cupsctl \ usr/sbin/cupsdisable \ usr/sbin/cupsenable \ usr/sbin/lpadmin \ usr/sbin/lpc \ usr/sbin/lpinfo \ usr/sbin/lpmove \ usr/sbin/reject } md5sums="13c8b2b2336d42001abe4899766b62dc cups-1.6.2-source.tar.bz2 f861b18f4446c43918c8643dcbbd7f6d cups.logrotate 1154ed66fdcfa0523f929a369079f43c cupsd.initd 09c0def850cf68d5f0bd4adcb39192ba CVE-2014-2856.patch e7b557c8515d17bda174caf39dc774ad CVE-2014-3537.patch 749673017347dacc336a60555e6c7a58 CVE-2014-5029_5030_5031.patch"