Subject: [alpine-aports] [PATCH] main/cups-filters: update to 1.6.0

From: Isaac Dunham <[email-masked]>
Date: Thu, 14 Jan 2016 20:30:59 -0800

While here, drop bash dependency in favor of ash.
---
 ...1-Make-textonly-conform-with-POSIX-better.patch | 73 ++++++++++++++++++++++
 main/cups-filters/APKBUILD                         | 26 +++++---
 2 files changed, 91 insertions(+), 8 deletions(-)
 create mode 100644 main/cups-filters/0001-Make-textonly-conform-with-POSIX-better.patch

diff --git a/main/cups-filters/0001-Make-textonly-conform-with-POSIX-better.patch b/main/cups-filters/0001-Make-textonly-conform-with-POSIX-better.patch
new file mode 100644
index 0000000..1653623
--- /dev/null
+++ b/main/cups-filters/0001-Make-textonly-conform-with-POSIX-better.patch
@@ -0,0 +1,73 @@
+From 1301945446a0972a0849e4b2f29e5e3b59209527 Mon Sep 17 00:00:00 2001
+From: Isaac Dunham <[email-masked]>
+Date: Thu, 14 Jan 2016 06:51:07 -0800
+Subject: [PATCH] Make textonly conform with POSIX better.
+
+echo -ne was the only thing that could be expected to not work on every shell.
+---
+ filter/textonly | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/filter/textonly b/filter/textonly
+index dd55a9d..630cb8f 100644
+--- a/filter/textonly
++++ b/filter/textonly
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ ## Copyright (C) 2003-2006 Red Hat, Inc.
+ ## Copyright (C) 2003-2006 Tim Waugh <[email-masked]>
+ ## Changed on 2007/05/17, Opher Shachar, LADPC Ltd.
+@@ -64,7 +64,7 @@ if [[ "$PR" ]]; then
+     (( pl > pu )) && continue
+     
+     # Loop reading pages until at or over lower page of subrange.
+-    while read -d `echo -ne '\f'` -r; do
++    while read -d `printf '\f'` -r; do
+       (( pagenum++ ))
+       (( pagenum == pl )) && break
+     done
+@@ -78,15 +78,15 @@ if [[ "$PR" ]]; then
+     if (( pagenum == pl )); then
+       echo -n "${REPLY}" >>"$TMPFILE2"
+       # If EOF then page has no final FF
+-      [[ ! "$EOF" ]] && echo -ne '\f' >>"$TMPFILE2"
++      [[ ! "$EOF" ]] && printf '\f' >>"$TMPFILE2"
+       echo "PAGE: $pagenum $COPIES" >&2
+     fi
+     [[ "$EOF" ]] && break
+     # Is the current subrange a single page?
+     (( pagenum == pu )) && continue
+-    while read -d `echo -ne '\f'` -r; do
++    while read -d `printf '\f'` -r; do
+       (( pagenum++ ))
+-      echo -ne "${REPLY}\f" >>"$TMPFILE2"
++      printf "${REPLY}\f" >>"$TMPFILE2"
+       echo "PAGE: $pagenum $COPIES" >&2
+       (( pagenum == pu )) && break
+     done
+@@ -103,18 +103,18 @@ if [[ "$PR" ]]; then
+   } <"$TMPFILE"
+ else
+   TMPFILE2="$TMPFILE"
+-  pc=$(grep -co `echo -ne '\f'` "$TMPFILE2")
++  pc=$(grep -co `printf '\f'` "$TMPFILE2")
+   pc=$(( pc * $COPIES ))
+   echo "PAGE: $pc" >&2
+ fi
+ 
+ while [ "$COPIES" -gt 0 ]; do
+   # Just translate LF->CRLF at the moment, until the PPD has options added.
+-  sed -e 's/$/'`echo -ne '\r'`'/g' "$TMPFILE2"
++  sed -e 's/$/'`printf '\r'`'/g' "$TMPFILE2"
+ 
+   if [ "$SENDFF" == "True" ]
+     then
+-    echo -ne \\014
++    printf \\014
+   fi
+ 
+   COPIES=$(($COPIES - 1))
+-- 
+2.7.0
+
diff --git a/main/cups-filters/APKBUILD b/main/cups-filters/APKBUILD
index d586d17..a31d64c 100644
--- a/main/cups-filters/APKBUILD
+++ b/main/cups-filters/APKBUILD
@@ -1,22 +1,28 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=cups-filters
-pkgver=1.2.0
-pkgrel=1
+pkgver=1.6.0
+pkgrel=0
 pkgdesc="OpenPrinting CUPS filters and backends"
 url="http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdf_as_standard_print_job_format"
 arch="all"
 license="GPLv2 and GPLv2+ and GPLv3 and MIT"
-# textonly is a bash script
+# while textonly is originally a bash script, it only needs a few changes
+# to work with any shell (dash being the problematic one)
+# foomatic-rip needs "a modern shell" in case the PPD requires some
+# newer constructs; bash, ksh, and zsh are documented as working,
+# and busybox ash supports most of what bash does
 # texttops/textopdf need FreeMono from ttf-freefont
 # for text printing to work
-depends="poppler-utils bc bash ttf-freefont"
+depends="poppler-utils bc ttf-freefont"
 depends_dev=""
 makedepends="$depends_dev cups-dev libjpeg-turbo-dev poppler-dev zlib-dev
 	libpng-dev tiff-dev lcms-dev freetype-dev ghostscript-dev fontconfig-dev
 	qpdf-dev avahi-dev dbus-dev linux-headers"
 install=""
 subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
-source="http://www.openprinting.org/download/cups-filters/cups-filters-$pkgver.tar.xz"
+source="http://www.openprinting.org/download/cups-filters/cups-filters-$pkgver.tar.xz
+	0001-Make-textonly-conform-with-POSIX-better.patch
+	"
 
 _builddir="$srcdir"/cups-filters-$pkgver
 prepare() {
@@ -41,6 +47,7 @@ build() {
 		--localstatedir=/var \
 		--disable-static \
 		--with-pdftops=pdftops \
+		--with-shell=/bin/sh \
 		--without-rcdir \
 		--without-rclevels \
 		|| return 1
@@ -69,6 +76,9 @@ libs() {
 	mv "$pkgdir"/usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
 }
 
-md5sums="9c2c8e358a72455ca63f28f91c8b1af0  cups-filters-1.2.0.tar.xz"
-sha256sums="31dcb71dc79129056a5b0f6d30880bdb6511ee7acd06a3f5bd4e9d2684801d62  cups-filters-1.2.0.tar.xz"
-sha512sums="1389d45607bee8376f23efc9b723df276002bf47292670e6cc872a8896ffe06d9eb0aa6f2be0c8c0ad86c8831bcc8f3779baa78d52224fb17dc2bf4ce9a97ca2  cups-filters-1.2.0.tar.xz"
+md5sums="51b7f8f068502b6afca9bc8462b53933  cups-filters-1.6.0.tar.xz
+b65f5b5191fee1834623b6aedf7f5c50  0001-Make-textonly-conform-with-POSIX-better.patch"
+sha256sums="39e53db81df7aa951507c72ced52b9b0e9e4294c3f83e8b717fb42c03a557c97  cups-filters-1.6.0.tar.xz
+33f5589e8c8fc98d9715c3a1b93c459c5902ff7115804852f79bbcc1638d6cb3  0001-Make-textonly-conform-with-POSIX-better.patch"
+sha512sums="dd7671dbb13588829337e4ae4d533dc6c1e17f75ca240a6d43bb0a30a2453fffa9a1541d7b041024a6d4cbb939790802a8c3947cd319590fa37c7ce237232b9d  cups-filters-1.6.0.tar.xz
+522f431e0a531b797a2f8626c22b711adce59c68564c3146db4c684ea81c51a265e8915b3e6148e1771a0bbd42d3bc6dd741793562cc145c52945658e43335b5  0001-Make-textonly-conform-with-POSIX-better.patch"
-- 
2.7.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---