diff --git a/debian/changelog b/debian/changelog index f82966e..9697a88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +rastertosag-gdi (0.1-0ubuntu2) oneiric; urgency=low + + * debian/rastertosag-gdi.ppd-updater, debian/rules: Put regexp file to + trigger automatic update of the PPDs of existing queues after the package + installation by the cups package. + * debian/rastertosag-gdi.postinst: Removed, the updating of the PPDs of the + already existing CUPS print queues is now done by CUPS. + * debian/control: Removed dependency on cups and cups-client and recommend one + of cups and foomatic-filters. This way the package will be installable and + usable also in non-CUPS printing environments. + + -- Till Kamppeter Tue, 16 Aug 2011 16:59:00 +0200 + rastertosag-gdi (0.1-0ubuntu1) oneiric; urgency=low * Initial release (LP: #700141). diff --git a/debian/control b/debian/control index effca92..40dd276 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,8 @@ Package: rastertosag-gdi Architecture: all -Depends: ${misc:Depends}, ${shlibs:Depends}, python, cups, cups-client, ghostscript +Depends: ${misc:Depends}, ${shlibs:Depends}, python, ghostscript +Recommends: cups | foomatic-filters Description: Driver for Ricoh Aficio SP1100s/SP1100s The rastertosag-gdi driver is an open source Linux driver for the Ricoh Aficio SP1100s/SP1100s printers. These are some of the few Ricoh printers which do not diff --git a/debian/rastertosag-gdi.postinst b/debian/rastertosag-gdi.postinst deleted file mode 100644 index 054d6ac..0000000 --- a/debian/rastertosag-gdi.postinst +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -# postinst script for rastertosag-gdi -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# -# quoting from the policy: -# Any necessary prompting should almost always be confined to the -# post-installation script, and should be protected with a conditional -# so that unnecessary prompting doesn't happen if a package's -# installation fails and the `postinst' is called with `abort-upgrade', -# `abort-remove' or `abort-deconfigure'. - -if [ "$1" = "configure" ]; then - # Do the following only if CUPS is running and the needed CUPS tools - # are available - if which lpstat > /dev/null 2>&1 && \ - which lpinfo > /dev/null 2>&1 && \ - which lpadmin > /dev/null 2>&1 && \ - LC_ALL=C lpstat -h /var/run/cups/cups.sock -r | grep -v not > /dev/null 2>&1; then - # Update the PPD files of all already installed print queues - driverregexp='lsb/usr/rastertosag-gdi/' - gennicknameregexp='' - [ ! -z "$gennicknameregexp" ] && \ - gennicknameregexp="; $gennicknameregexp" - gennicknameregexp='s/\s*\(recommended\)//'"$gennicknameregexp" - tempfiles= - trap 'rm -f $tempfiles; exit 0' 0 HUP INT QUIT ILL ABRT PIPE TERM - tmpfile1=`mktemp -t updateppds.XXXXXX` - tempfiles="$tempfiles $tmpfile1" - lpinfo -h /var/run/cups/cups.sock -m | grep -E $driverregexp > $tmpfile1 - cd /etc/cups/ppd - for ppd in *.ppd; do - [ -r "$ppd" ] || continue - queue=${ppd%.ppd} - lpstat -h /var/run/cups/cups.sock -p "$queue" >/dev/null 2>&1 || continue - nickname=`grep '\*NickName:' "$ppd" | cut -d '"' -f 2 | perl -p -e 's/\n$//' | perl -p -e "$gennicknameregexp" | perl -p -e 's/(\W)/\\\\$1/g'` - lang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'` - ppdfound="0" - englishppduri="" - tmpfile2=`mktemp -t updateppds.XXXXXX` - tempfiles="$tempfiles $tmpfile2" - cat $tmpfile1 | perl -p -e "$gennicknameregexp" | grep -E '^\S+\s+.*'"$nickname"'$' | cut -d ' ' -f 1 > $tmpfile2 - while read newppduri; do - [ "$ppdfound" = "0" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $newppduri 2>/dev/null || continue - newlang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'` - [ "$newlang" = "$lang" ] && ppdfound="1" - [ "$newlang" = "english" ] && englishppduri="$newppduri" - done < $tmpfile2 - [ "$ppdfound" = "0" ] && [ ! -z "$englishppduri" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $englishppduri 2>/dev/null && ppdfound="1" - [ "$ppdfound" = "1" ] && echo PPD for printer $queue updated >&2 - done - fi -elif [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] || [ "$1" = "abort-deconfigure" ]; then - : -else - echo "postinst called with unknown argument \`$1'" >&2 - exit 0 -fi - - -#DEBHELPER# -exit 0 diff --git a/debian/rastertosag-gdi.ppd-updater b/debian/rastertosag-gdi.ppd-updater new file mode 100644 index 0000000..16e59c1 --- /dev/null +++ b/debian/rastertosag-gdi.ppd-updater @@ -0,0 +1,2 @@ +DRIVER_REGEXP=lsb/usr/rastertosag-gdi/ +GENNICKNAME_REGEXP= diff --git a/debian/rules b/debian/rules index b00e671..7b91c79 100755 --- a/debian/rules +++ b/debian/rules @@ -12,6 +12,7 @@ override_dh_install: dh_install + install -D -m 644 debian/rastertosag-gdi.ppd-updater $(CURDIR)/debian/rastertosag-gdi/usr/share/cups/ppd-updaters/rastertosag-gdi ifeq ($(derives_from_ubuntu),yes) # Install the apport hook on Ubuntu and derivatives install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/rastertosag-gdi/usr/share/apport/package-hooks/source_rastertosag-gdi.py