# Maintainer: Natanael Copa pkgname=cups pkgver=1.7.3 pkgrel=1 pkgdesc="The CUPS Printing System" url="http://www.cups.org/" arch="all" license="GPL LGPL2+" 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 libjpeg-turbo-dev avahi-dev" 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/cups-$pkgver-source.tar.bz2 $pkgname.logrotate cupsd.initd cups-no-export-ssllibs.patch cups-check-sockaddr-size.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 "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --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" \ || return 1 make || return 1 } package() { cd "$_builddir" make BUILDROOT="$pkgdir" install rm -rf "$pkgdir"/etc/init.d \ "$pkgdir"/etc/rc* \ "$pkgdir"/usr/share/cups/banners \ "$pkgdir"/usr/share/cups/data/testprint || return 1 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="d498c3020acda0904ab0c13b6389a1ec cups-1.7.3-source.tar.bz2 f861b18f4446c43918c8643dcbbd7f6d cups.logrotate 1154ed66fdcfa0523f929a369079f43c cupsd.initd 3ba9e3410df1dc3015463d615ef91b3b cups-no-export-ssllibs.patch 81391375d22df6808a1042a0fae85845 cups-check-sockaddr-size.patch" sha256sums="fa989f856d1499169dc442fb2311053ea42fe455ca2721693ba5a9fe4b333e31 cups-1.7.3-source.tar.bz2 b3308353504bc1cc0d5203ad3609bc98639ad9655b52e8ec8257286877532796 cups.logrotate 3ea71f13cf925736847ca44aa0f1a9ed944fb3d303c34af923140b20fd587e2b cupsd.initd ff3eb0782af0405f5dafe89e04b1b4ea7a49afc5496860d724343bd04f375832 cups-no-export-ssllibs.patch 32a06c70093f8ad52e35520048b68d544f13f5c8094f85bab53ff54c809012ef cups-check-sockaddr-size.patch" sha512sums="78e5275682322a52c5e10d87c106059900595c4fd167924bece30d32b646c304ecc0f5051c53cb983b75d5a5ab76fd5b81931fb6f191b9e936f2528ca869798e cups-1.7.3-source.tar.bz2 162fe69ee46962f7ce07a9a2a75154682088895c4749c9bcfc54bb2aa861f48d7d1a8e3223f78a197319a3a405626ffe996615f6eb23168afcefabab343d5be0 cups.logrotate 3c5f4017cb1faf3e63551db53da4cb8305601adf65358bc53e982c5a0dfdd2b455a8ce735760ae3cc5ef81cdfa2a3cfe4be4107d1858d7ab9d91b4b97d3bc73b cupsd.initd 7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3 cups-no-export-ssllibs.patch ef0d1d80bf78de8bc29821f675891409605515a89358615d56b76d534ee0935ac9cffa625ba8622f5351d0efc030dead11d885b1f125df2beb42e3afd377ff9a cups-check-sockaddr-size.patch"