summaryrefslogtreecommitdiff
path: root/user/cups
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:19 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:56 -0500
commitb1eb50599e4db7eb4501af75cbbfa22007081ea5 (patch)
treec94a34c882cc17adedd781e8c5f34349b2a62416 /user/cups
parentb9e85bbdcf38547ef2ca4e5c2a6e6293bbcd2752 (diff)
downloadpackages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.gz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.bz2
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.xz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.zip
The New Plan
all pkgs needed to bootstrap -> system others -> user
Diffstat (limited to 'user/cups')
-rw-r--r--user/cups/APKBUILD135
-rw-r--r--user/cups/cups-no-export-ssllibs.patch12
-rw-r--r--user/cups/cups.logrotate8
-rw-r--r--user/cups/cups.pre-install8
-rw-r--r--user/cups/cupsd.initd44
-rw-r--r--user/cups/default-config-no-gssapi.patch26
6 files changed, 233 insertions, 0 deletions
diff --git a/user/cups/APKBUILD b/user/cups/APKBUILD
new file mode 100644
index 000000000..39178391c
--- /dev/null
+++ b/user/cups/APKBUILD
@@ -0,0 +1,135 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=cups
+pkgver=2.2.7
+pkgrel=0
+pkgdesc="The CUPS Printing System"
+url="http://www.cups.org/"
+arch="all"
+license="GPL LGPL2+"
+# cupsUTF8ToCharset(CUPS_EUC_JP) of utfdemo.txt: FAIL (UTF-8 to EUC-JP on line 1)
+options="!check"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs ipptool $pkgname-client
+ $pkgname-lang $pkgname-openrc"
+depends_dev="openssl-dev zlib-dev"
+makedepends="$depends_dev libpaper-dev dbus-dev libjpeg-turbo-dev linux-headers
+ gnutls-dev linux-pam-dev"
+depends="cups-client poppler-utils openssl dbus"
+install="cups.pre-install"
+pkggroups="lp lpadmin"
+pkgusers="lp"
+source="https://github.com/apple/cups/releases/download/v$pkgver/cups-$pkgver-source.tar.gz
+ $pkgname.logrotate
+ cupsd.initd
+ cups-no-export-ssllibs.patch
+ default-config-no-gssapi.patch
+ "
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-logdir=/var/log/cups \
+ --with-docdir=/usr/share/cups \
+ --with-rundir=/run/cups \
+ --with-cupsd-file-perm=0755 \
+ --with-cups-user=lp \
+ --with-cups-group=lp \
+ --with-system-groups=lpadmin \
+ --with-domainsocket=/run/cups/cups.sock \
+ --without-rcdir \
+ --without-php \
+ --enable-pam \
+ --enable-raw-printing \
+ --enable-dbus \
+ --with-dbusdir=/etc/dbus-1 \
+ --enable-libpaper \
+ --enable-ssl=yes \
+ --enable-gnutls \
+ --disable-launchd \
+ --with-optim="$CFLAGS"
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+
+ make BUILDROOT="$pkgdir" install
+
+ cd "$pkgdir"
+
+ # These no longer works since CUPS >= 1.6 (http://www.cups.org/str.php?L4120).
+ rm -rf usr/share/cups/banners/* \
+ 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
+ sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' \
+ usr/share/applications/cups.desktop
+ fi
+ find usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
+}
+
+libs() {
+ pkgdesc="CUPS libraries"
+ depends=""
+ replaces="libcups"
+
+ cd "$pkgdir"
+ _mv usr/lib/*.so*
+ install -d "$pkgdir"/etc/cups
+}
+
+ipptool() {
+ pkgdesc="Perform internet printing protocol requests"
+ depends=""
+
+ cd "$pkgdir"
+ _mv usr/bin/ipptool \
+ usr/share/cups/ipptool
+}
+
+client() {
+ pkgdesc="CUPS command-line client programs"
+ depends=""
+
+ cd "$pkgdir"
+ _mv usr/bin \
+ usr/sbin/accept \
+ usr/sbin/cupsaccept \
+ 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
+}
+
+_mv() {
+ local i; for i in "$@"; do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/${i%/*}/
+ done
+}
+
+sha512sums="780a6a484f38967ff678456ec7b532aa8445a9562663e4e4f6f7a24aac6ec9e8eae36459ee3c025dff053d59ad1d9ecfb823e8a832bae9d384db3d1a10d8860e cups-2.2.7-source.tar.gz
+cf64211da59e79285f99d437c02fdd7db462855fb2920ec9563ba47bd8a9e5cbd10555094940ceedeb41ac805c4f0ddb9147481470112a11a76220d0298aef79 cups.logrotate
+2c2683f755a220166b3a1653fdd1a6daa9718c8f0bbdff2e2d5e61d1133306260d63a83d3ff41619b5cf84c4913fae5822b79553e2822858f38fa3613f4c7082 cupsd.initd
+7a8cd9ac33b0dd4627c72df4275db8ccd7cf8e201bce3833719b42f532f526bb347b842e3ea1ef0d61855b5c6e1088b5d20b68942f2c2c0acf504d8d9728efd3 cups-no-export-ssllibs.patch
+98bb97f4af69ea286fc3d398b8e57c32440e6b2d49fb7f79b418a4fe7f13441f3a610f65d3433d10d971ade808233c0b29b4d66160623ccaae919179384be918 default-config-no-gssapi.patch"
diff --git a/user/cups/cups-no-export-ssllibs.patch b/user/cups/cups-no-export-ssllibs.patch
new file mode 100644
index 000000000..e227bd182
--- /dev/null
+++ b/user/cups/cups-no-export-ssllibs.patch
@@ -0,0 +1,12 @@
+diff -up cups-1.5b1/config-scripts/cups-ssl.m4.no-export-ssllibs cups-1.5b1/config-scripts/cups-ssl.m4
+--- cups-1.6.2/config-scripts/cups-ssl.m4.no-export-ssllibs 2011-05-11 02:52:08.000000000 +0200
++++ cups-1.6.2/config-scripts/cups-ssl.m4 2011-05-23 17:47:27.000000000 +0200
+@@ -180,7 +180,7 @@
+ AC_SUBST(SSLFLAGS)
+ AC_SUBST(SSLLIBS)
+
+-EXPORT_SSLLIBS="$SSLLIBS"
++EXPORT_SSLLIBS=""
+ AC_SUBST(EXPORT_SSLLIBS)
+
+ dnl
diff --git a/user/cups/cups.logrotate b/user/cups/cups.logrotate
new file mode 100644
index 000000000..a50b058a3
--- /dev/null
+++ b/user/cups/cups.logrotate
@@ -0,0 +1,8 @@
+/var/log/cups/*log {
+ missingok
+ notifempty
+ delaycompress
+ postrotate
+ /etc/init.d/cupsd --quiet --ifstarted reload
+ endscript
+}
diff --git a/user/cups/cups.pre-install b/user/cups/cups.pre-install
new file mode 100644
index 000000000..cdb75cac5
--- /dev/null
+++ b/user/cups/cups.pre-install
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+addgroup -S lpadmin 2>/dev/null
+addgroup -S lp 2>/dev/null
+adduser -S -G lp -g lp lp 2>/dev/null
+addgroup lp lp 2>/dev/null
+
+exit 0
diff --git a/user/cups/cupsd.initd b/user/cups/cupsd.initd
new file mode 100644
index 000000000..ff0998784
--- /dev/null
+++ b/user/cups/cupsd.initd
@@ -0,0 +1,44 @@
+#!/sbin/openrc-run
+
+name="CUPS"
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+description_checkconfig="Test the configuration file"
+description_reload="Reload"
+
+: ${cfgfile:="/etc/cups/cupsd.conf"}
+
+command="/usr/sbin/cupsd"
+command_args="-f -c $cfgfile"
+command_background="yes"
+
+pidfile="/run/cups/$RC_SVCNAME.pid"
+
+depend() {
+ use net
+ before nfs
+ need dbus
+ after logger
+}
+
+checkconfig() {
+ $command $command_args -t >/dev/null 2>&1 \
+ || $command $command_args -t
+}
+
+start_pre() {
+ checkconfig || return 1
+
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups
+ checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
+ checkpath -q -d -m 0755 -o root:lp /run/cups
+ checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
+}
+
+reload() {
+ ebegin "Reloading $name"
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
+ eend $?
+}
diff --git a/user/cups/default-config-no-gssapi.patch b/user/cups/default-config-no-gssapi.patch
new file mode 100644
index 000000000..b12c55ddf
--- /dev/null
+++ b/user/cups/default-config-no-gssapi.patch
@@ -0,0 +1,26 @@
+--- a/conf/cupsd.conf.in
++++ b/conf/cupsd.conf.in
+@@ -145,12 +145,12 @@
+
+ # Job-related operations must be done by the owner or an administrator...
+ <Limit Create-Job Print-Job Print-URI Validate-Job>
+- AuthType Negotiate
++ AuthType Default
+ Order deny,allow
+ </Limit>
+
+ <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
+- AuthType Negotiate
++ AuthType Default
+ Require user @OWNER @SYSTEM
+ Order deny,allow
+ </Limit>
+@@ -171,7 +171,7 @@
+
+ # Only the owner or an administrator can cancel or authenticate a job...
+ <Limit Cancel-Job CUPS-Authenticate-Job>
+- AuthType Negotiate
++ AuthType Default
+ Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
+ Order deny,allow
+ </Limit>