Codebase list rastertosag-gdi / 36a7ed3
Imported Ubuntu patch 0.1-0ubuntu2 Till Kamppeter authored 12 years ago Didier Raboud committed 12 years ago
5 changed file(s) with 18 addition(s) and 76 deletion(s). Raw diff Collapse all Expand all
0 rastertosag-gdi (0.1-0ubuntu2) oneiric; urgency=low
1
2 * debian/rastertosag-gdi.ppd-updater, debian/rules: Put regexp file to
3 trigger automatic update of the PPDs of existing queues after the package
4 installation by the cups package.
5 * debian/rastertosag-gdi.postinst: Removed, the updating of the PPDs of the
6 already existing CUPS print queues is now done by CUPS.
7 * debian/control: Removed dependency on cups and cups-client and recommend one
8 of cups and foomatic-filters. This way the package will be installable and
9 usable also in non-CUPS printing environments.
10
11 -- Till Kamppeter <till.kamppeter@gmail.com> Tue, 16 Aug 2011 16:59:00 +0200
12
013 rastertosag-gdi (0.1-0ubuntu1) oneiric; urgency=low
114
215 * Initial release (LP: #700141).
77
88 Package: rastertosag-gdi
99 Architecture: all
10 Depends: ${misc:Depends}, ${shlibs:Depends}, python, cups, cups-client, ghostscript
10 Depends: ${misc:Depends}, ${shlibs:Depends}, python, ghostscript
11 Recommends: cups | foomatic-filters
1112 Description: Driver for Ricoh Aficio SP1100s/SP1100s
1213 The rastertosag-gdi driver is an open source Linux driver for the Ricoh Aficio
1314 SP1100s/SP1100s printers. These are some of the few Ricoh printers which do not
+0
-75
debian/rastertosag-gdi.postinst less more
0 #!/bin/sh
1 # postinst script for rastertosag-gdi
2 #
3 # see: dh_installdeb(1)
4
5 set -e
6
7 # summary of how this script can be called:
8 # * <postinst> `configure' <most-recently-configured-version>
9 # * <old-postinst> `abort-upgrade' <new version>
10 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
11 # <new-version>
12 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
13 # <failed-install-package> <version> `removing'
14 # <conflicting-package> <version>
15 # for details, see http://www.debian.org/doc/debian-policy/ or
16 # the debian-policy package
17 #
18 # quoting from the policy:
19 # Any necessary prompting should almost always be confined to the
20 # post-installation script, and should be protected with a conditional
21 # so that unnecessary prompting doesn't happen if a package's
22 # installation fails and the `postinst' is called with `abort-upgrade',
23 # `abort-remove' or `abort-deconfigure'.
24
25 if [ "$1" = "configure" ]; then
26 # Do the following only if CUPS is running and the needed CUPS tools
27 # are available
28 if which lpstat > /dev/null 2>&1 && \
29 which lpinfo > /dev/null 2>&1 && \
30 which lpadmin > /dev/null 2>&1 && \
31 LC_ALL=C lpstat -h /var/run/cups/cups.sock -r | grep -v not > /dev/null 2>&1; then
32 # Update the PPD files of all already installed print queues
33 driverregexp='lsb/usr/rastertosag-gdi/'
34 gennicknameregexp=''
35 [ ! -z "$gennicknameregexp" ] && \
36 gennicknameregexp="; $gennicknameregexp"
37 gennicknameregexp='s/\s*\(recommended\)//'"$gennicknameregexp"
38 tempfiles=
39 trap 'rm -f $tempfiles; exit 0' 0 HUP INT QUIT ILL ABRT PIPE TERM
40 tmpfile1=`mktemp -t updateppds.XXXXXX`
41 tempfiles="$tempfiles $tmpfile1"
42 lpinfo -h /var/run/cups/cups.sock -m | grep -E $driverregexp > $tmpfile1
43 cd /etc/cups/ppd
44 for ppd in *.ppd; do
45 [ -r "$ppd" ] || continue
46 queue=${ppd%.ppd}
47 lpstat -h /var/run/cups/cups.sock -p "$queue" >/dev/null 2>&1 || continue
48 nickname=`grep '\*NickName:' "$ppd" | cut -d '"' -f 2 | perl -p -e 's/\n$//' | perl -p -e "$gennicknameregexp" | perl -p -e 's/(\W)/\\\\$1/g'`
49 lang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'`
50 ppdfound="0"
51 englishppduri=""
52 tmpfile2=`mktemp -t updateppds.XXXXXX`
53 tempfiles="$tempfiles $tmpfile2"
54 cat $tmpfile1 | perl -p -e "$gennicknameregexp" | grep -E '^\S+\s+.*'"$nickname"'$' | cut -d ' ' -f 1 > $tmpfile2
55 while read newppduri; do
56 [ "$ppdfound" = "0" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $newppduri 2>/dev/null || continue
57 newlang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'`
58 [ "$newlang" = "$lang" ] && ppdfound="1"
59 [ "$newlang" = "english" ] && englishppduri="$newppduri"
60 done < $tmpfile2
61 [ "$ppdfound" = "0" ] && [ ! -z "$englishppduri" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $englishppduri 2>/dev/null && ppdfound="1"
62 [ "$ppdfound" = "1" ] && echo PPD for printer $queue updated >&2
63 done
64 fi
65 elif [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] || [ "$1" = "abort-deconfigure" ]; then
66 :
67 else
68 echo "postinst called with unknown argument \`$1'" >&2
69 exit 0
70 fi
71
72
73 #DEBHELPER#
74 exit 0
0 DRIVER_REGEXP=lsb/usr/rastertosag-gdi/
1 GENNICKNAME_REGEXP=
1111
1212 override_dh_install:
1313 dh_install
14 install -D -m 644 debian/rastertosag-gdi.ppd-updater $(CURDIR)/debian/rastertosag-gdi/usr/share/cups/ppd-updaters/rastertosag-gdi
1415 ifeq ($(derives_from_ubuntu),yes)
1516 # Install the apport hook on Ubuntu and derivatives
1617 install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/rastertosag-gdi/usr/share/apport/package-hooks/source_rastertosag-gdi.py