APKBUILD 3.65 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cups
Leo's avatar
Leo committed
3
pkgver=2.2.12
4
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
5
pkgdesc="The CUPS Printing System"
6
url="https://www.cups.org/"
7
arch="all"
8
license="GPL-2.0-only"
Natanael Copa's avatar
Natanael Copa committed
9
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs ipptool $pkgname-client
10
	$pkgname-lang $pkgname-openrc"
Natanael Copa's avatar
Natanael Copa committed
11
depends_dev="libgcrypt-dev gnutls-dev zlib-dev"
Natanael Copa's avatar
Natanael Copa committed
12
makedepends="$depends_dev libpaper-dev dbus-dev libjpeg-turbo-dev avahi-dev
mepholic's avatar
mepholic committed
13
	linux-headers libusb-dev"
J0WI's avatar
J0WI committed
14
depends="cups-client poppler-utils openssl dbus"
Natanael Copa's avatar
Natanael Copa committed
15
install="cups.pre-install"
Natanael Copa's avatar
Natanael Copa committed
16 17
pkggroups="lp lpadmin"
pkgusers="lp"
18
source="https://github.com/apple/cups/releases/download/v$pkgver/cups-$pkgver-source.tar.gz
Natanael Copa's avatar
Natanael Copa committed
19 20
	$pkgname.logrotate
	cupsd.initd
21
	cups-no-export-ssllibs.patch
22
	default-config-no-gssapi.patch
Natanael Copa's avatar
Natanael Copa committed
23
	"
Natanael Copa's avatar
Natanael Copa committed
24

Leonardo Arena's avatar
Leonardo Arena committed
25
# secfixes:
Leo's avatar
Leo committed
26 27 28
#   2.2.12-r0:
#     - CVE-2019-8696
#     - CVE-2019-8675
Leonardo Arena's avatar
Leonardo Arena committed
29 30 31
#   2.2.10-r0:
#     - CVE-2018-4700

Natanael Copa's avatar
Natanael Copa committed
32
build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
33 34
	cd "$builddir"

35 36 37 38
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
39
		--libdir=/usr/lib \
Natanael Copa's avatar
Natanael Copa committed
40 41
		--sysconfdir=/etc \
		--localstatedir=/var \
42 43
		--with-menudir=/usr/share/applications \
		--with-icondir=/usr/share/icons \
Natanael Copa's avatar
Natanael Copa committed
44
		--with-logdir=/var/log/cups \
Natanael Copa's avatar
Natanael Copa committed
45
		--with-docdir=/usr/share/cups \
46 47
		--with-rundir=/run/cups \
		--with-cupsd-file-perm=0755 \
Natanael Copa's avatar
Natanael Copa committed
48 49 50
		--with-cups-user=lp \
		--with-cups-group=lp \
		--with-system-groups=lpadmin \
51
		--with-domainsocket=/run/cups/cups.sock \
mepholic's avatar
mepholic committed
52
		--enable-libusb \
53
		--without-rcdir \
Natanael Copa's avatar
Natanael Copa committed
54 55 56 57 58 59 60 61
		--without-php \
		--disable-pam \
		--enable-raw-printing \
		--enable-dbus \
		--with-dbusdir=/etc/dbus-1 \
		--enable-libpaper \
		--enable-ssl=yes \
		--enable-gnutls \
62
		--disable-launchd \
Jakub Jirutka's avatar
Jakub Jirutka committed
63 64
		--with-optim="$CFLAGS"
	make
Natanael Copa's avatar
Natanael Copa committed
65 66 67
}

package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
68 69
	cd "$builddir"

Natanael Copa's avatar
Natanael Copa committed
70 71
	make BUILDROOT="$pkgdir" install

Jakub Jirutka's avatar
Jakub Jirutka committed
72
	cd "$pkgdir"
Natanael Copa's avatar
Natanael Copa committed
73

74 75
	# These no longer works since CUPS >= 1.6 (http://www.cups.org/str.php?L4120).
	rm -rf usr/share/cups/banners/* \
Jakub Jirutka's avatar
Jakub Jirutka committed
76 77 78 79 80 81
		usr/share/cups/data/testprint

	install -D -m 644 "$srcdir"/cups.logrotate etc/logrotate.d/cups
	install -D -m 755 "$srcdir"/cupsd.initd etc/init.d/cupsd

	if [ -e usr/share/applications/cups.desktop ] ; then
Breno Leitao's avatar
Breno Leitao committed
82
		sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' \
Jakub Jirutka's avatar
Jakub Jirutka committed
83
			usr/share/applications/cups.desktop
Breno Leitao's avatar
Breno Leitao committed
84
	fi
Jakub Jirutka's avatar
Jakub Jirutka committed
85
	find usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
Natanael Copa's avatar
Natanael Copa committed
86 87
}

Natanael Copa's avatar
Natanael Copa committed
88
libs() {
Natanael Copa's avatar
Natanael Copa committed
89
	pkgdesc="CUPS libraries"
Jakub Jirutka's avatar
Jakub Jirutka committed
90
	depends=""
Natanael Copa's avatar
Natanael Copa committed
91
	replaces="libcups"
Jakub Jirutka's avatar
Jakub Jirutka committed
92

Natanael Copa's avatar
Natanael Copa committed
93
	cd "$pkgdir"
Natanael Copa's avatar
Natanael Copa committed
94 95 96 97
	_mv usr/lib/*.so*
	install -d "$pkgdir"/etc/cups
}

Natanael Copa's avatar
Natanael Copa committed
98
ipptool() {
99
	pkgdesc="Perform internet printing protocol requests"
Jakub Jirutka's avatar
Jakub Jirutka committed
100 101
	depends=""

Natanael Copa's avatar
Natanael Copa committed
102 103 104 105 106
	cd "$pkgdir"
	_mv usr/bin/ipptool \
		usr/share/cups/ipptool
}

Natanael Copa's avatar
Natanael Copa committed
107
client() {
108
	pkgdesc="CUPS command-line client programs"
Jakub Jirutka's avatar
Jakub Jirutka committed
109 110
	depends=""

Natanael Copa's avatar
Natanael Copa committed
111
	cd "$pkgdir"
Natanael Copa's avatar
Natanael Copa committed
112 113
	_mv usr/bin \
		usr/sbin/accept \
114
		usr/sbin/cupsaccept \
Natanael Copa's avatar
Natanael Copa committed
115 116 117 118 119 120 121 122 123 124 125
		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
}

Jakub Jirutka's avatar
Jakub Jirutka committed
126 127 128 129 130 131 132
_mv() {
	local i; for i in "$@"; do
		mkdir -p "$subpkgdir"/${i%/*}
		mv "$pkgdir"/$i "$subpkgdir"/${i%/*}/
	done
}

Leo's avatar
Leo committed
133
sha512sums="b8e7be512938ad388d469d093ad0c882ab42ea1408c27a91340f8424aa0e79e588df3d59795624973b89074a2af650fa9b5b6ed5224138b17e4c6dbbcbf0a2e6  cups-2.2.12-source.tar.gz
Jakub Jirutka's avatar
Jakub Jirutka committed
134 135
cf64211da59e79285f99d437c02fdd7db462855fb2920ec9563ba47bd8a9e5cbd10555094940ceedeb41ac805c4f0ddb9147481470112a11a76220d0298aef79  cups.logrotate
2c2683f755a220166b3a1653fdd1a6daa9718c8f0bbdff2e2d5e61d1133306260d63a83d3ff41619b5cf84c4913fae5822b79553e2822858f38fa3613f4c7082  cupsd.initd
136 137
7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3  cups-no-export-ssllibs.patch
98bb97f4af69ea286fc3d398b8e57c32440e6b2d49fb7f79b418a4fe7f13441f3a610f65d3433d10d971ade808233c0b29b4d66160623ccaae919179384be918  default-config-no-gssapi.patch"