Compare commits

...

2 Commits
master ... f28

Author SHA1 Message Date
Zdenek Dohnal 15c6c2c839 1572450 - cupsd: Filter "brftopagedbrf" not found. 2018-04-27 11:44:35 +02:00
Zdenek Dohnal af099f65f7 dependency on poppler-utils is now only recommended 2018-04-05 13:11:04 +02:00
2 changed files with 184 additions and 2 deletions

View File

@ -0,0 +1,172 @@
diff -up cups-filters-1.20.0/configure.ac.brftopagedbrf-install cups-filters-1.20.0/configure.ac
--- cups-filters-1.20.0/configure.ac.brftopagedbrf-install 2018-01-29 19:14:59.000000000 +0100
+++ cups-filters-1.20.0/configure.ac 2018-04-27 11:19:33.987213243 +0200
@@ -856,6 +856,7 @@ AC_CONFIG_FILES([
filter/braille/filters/cups-braille.sh
filter/braille/filters/imagetobrf
filter/braille/filters/texttobrf
+ filter/braille/filters/brftopagedbrf
filter/braille/filters/vectortopdf
filter/braille/filters/vectortobrf
filter/braille/filters/musicxmltobrf
diff -up cups-filters-1.20.0/filter/braille/filters/brftopagedbrf.in.brftopagedbrf-install cups-filters-1.20.0/filter/braille/filters/brftopagedbrf.in
--- cups-filters-1.20.0/filter/braille/filters/brftopagedbrf.in.brftopagedbrf-install 2018-04-27 11:19:41.038152279 +0200
+++ cups-filters-1.20.0/filter/braille/filters/brftopagedbrf.in 2018-04-27 11:21:47.344068714 +0200
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2015-2017 Samuel Thibault <samuel.thibault@ens-lyon.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Make sure we have enough options
+if [ $# != 5 -a $# != 6 ]; then
+ echo "ERROR: $0 jobid user name nb options [filename]" >&2
+ exit 1
+fi
+
+NB=$4
+OPTIONS=$5
+FILE=$6
+
+. @CUPS_DATADIR@/braille/cups-braille.sh
+
+shopt -s extglob
+
+# Construct list of pages from PAGERANGES
+
+PAGES=" " # Explicit list of pages
+AFTER= # All pages including and after this
+BEFORE= # All pages before and including this
+
+[ -n "$PAGERANGES" ] || PAGERANGES="1-"
+
+while [ -n "${PAGERANGES}" ]
+do
+ PAGERANGE=${PAGERANGES/,*}
+ PAGERANGE=${PAGERANGE%%*( )}
+ PAGERANGE=${PAGERANGE##*( )}
+ if [ -n "${PAGERANGES/*,*}" ]
+ then
+ # last range
+ PAGERANGES=""
+ else
+ # Remove leading range
+ PAGERANGES="${PAGERANGES#*,}"
+ fi
+
+ if [ -n "${PAGERANGE/*-*}" ]
+ then
+ # single-page
+ PAGES="$PAGES$PAGERANGE "
+
+ elif [ -z "${PAGERANGE%%*-}" ]
+ then
+ # To the end
+ FIRST=${PAGERANGE%%-*}
+ if [ -z "$AFTER" ] || [ "$FIRST" -lt "$AFTER" ]
+ then
+ AFTER="$FIRST"
+ fi
+
+ elif [ -z "${PAGERANGE##-*}" ]
+ then
+ # From the beginning
+ LAST=${PAGERANGE##*-}
+ if [ -z "$BEFORE" ] || [ "$LAST" -gt "$BEFORE" ]
+ then
+ BEFORE="$LAST"
+ fi
+
+ else
+ # page range
+ FIRST=${PAGERANGE/-*}
+ LAST=${PAGERANGE/*-}
+ PAGES="$PAGES$(seq "$FIRST" "$LAST" | tr $'\012' ' ')"
+
+ fi
+done
+
+# Determine whether to print this page
+doprint() {
+ PAGE="$1"
+ if [ -n "$BEFORE" ] && [ "$PAGE" -le "$BEFORE" ]
+ then
+ echo 1
+ return
+ elif [ -n "$AFTER" ] && [ "$PAGE" -ge "$AFTER" ]
+ then
+ echo 1
+ return
+ fi
+ case "$PAGES" in
+ *\ $PAGE\ *)
+ echo 1
+ return
+ ;;
+ esac
+ echo 0
+}
+
+if [ -z "$FILE" ]
+then
+ cat
+else
+ cat "$FILE"
+fi | (
+ P=1
+ DOPRINT=$(doprint $P)
+ while IFS=$'\n' read -r LINE
+ do
+ while [ -z "${LINE/*$'\014'*}" ]
+ do
+ # Possibly print before FF
+ HEAD=${LINE%%$'\014'*}
+ [ $DOPRINT == 0 ] || printf %s "$HEAD"$'\014'
+
+ # Next page
+ P=$(($P + 1))
+ DOPRINT=$(doprint $P)
+
+ # Drop head of line
+ LINE=${LINE#*$'\014'}
+ done
+
+ # Remainder of line
+ [ $DOPRINT == 0 ] || printf "%s\n" "$LINE"
+ done
+)
+
+echo "INFO: Ready" >&2
+exit 0
diff -up cups-filters-1.20.0/Makefile.am.brftopagedbrf-install cups-filters-1.20.0/Makefile.am
--- cups-filters-1.20.0/Makefile.am.brftopagedbrf-install 2017-12-15 02:15:32.000000000 +0100
+++ cups-filters-1.20.0/Makefile.am 2018-04-27 11:19:33.987213243 +0200
@@ -591,6 +591,7 @@ nodist_pkgfilter_SCRIPTS = \
filter/braille/filters/vectortopdf \
filter/braille/filters/vectortobrf \
filter/braille/filters/texttobrf \
+ filter/braille/filters/brftopagedbrf \
filter/braille/filters/musicxmltobrf
endif

View File

@ -4,7 +4,7 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.20.0
Release: 6%{?dist}
Release: 8%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
@ -21,6 +21,7 @@ Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz
Patch01: cups-filters-createall.patch
Patch02: cups-filters-brftopagedbrf-install.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -72,7 +73,8 @@ BuildRequires: automake
BuildRequires: libtool
Requires: cups-filesystem
Requires: poppler-utils
# poppler filters (if enabled) and banners printing
Recommends: poppler-utils
# texttopdf
Requires: liberation-mono-fonts
@ -113,6 +115,8 @@ This is the development package for OpenPrinting CUPS filters and backends.
%setup -q
%patch01 -p1 -b .createall
# 1572450 - cupsd: Filter "brftopagedbrf" not found.
%patch02 -p1 -b .brftopagedbrf-install
%build
@ -286,6 +290,12 @@ fi
%{_libdir}/libfontembed.so
%changelog
* Fri Apr 27 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-8
- 1572450 - cupsd: Filter "brftopagedbrf" not found.
* Thu Apr 05 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-7
- dependency on poppler-utils is now only recommended
* Mon Feb 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-6
- gcc and gcc-c++ is no longer in buildroot by default