Package list splix / debian/2.0.0-2
Imported Debian patch 2.0.0-2 Pablo Mazzini authored 12 years ago Luca Niccoli committed 8 years ago
3 changed file(s) with 90 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 splix (2.0.0-2) unstable; urgency=low
1
2 * debian/splix.postinst, debian/control: Added post-install script to
3 automatically update the PPD files of all existing print queues which
4 use this driver to the current version. (Closes: #525822)
5 * debian/control: Added "cups" to Depends: as a running CUPS daemon is needed
6 for the automatic update of existing print queues.
7 * debian/control: Added ghostscript-cups dependency.
8
9 -- Pablo Mazzini <pmazzini@gmail.com> Sat, 20 Jun 2009 11:04:16 -0300
10
011 splix (2.0.0-1) unstable; urgency=low
112
213 * New upstream release
88
99 Package: splix
1010 Architecture: any
11 Depends: ${shlibs:Depends}, ${misc:Depends}
11 Depends: ${shlibs:Depends}, ${misc:Depends}, cups, cups-client, ghostscript-cups
1212 Description: Driver for Samsung's SPL2 (bw) and SPLc (color) laser printers
1313 Support for printing to SPL2- and SPLc-based printers. These are most
1414 of the cheaper Samsung laser printers which do not understand standard
0 #!/bin/bash
1 # postinst script for splix
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 # * <postinst> `abort-remove'
13 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
14 # <failed-install-package> <version> `removing'
15 # <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
18
19
20 case "$1" in
21 configure)
22 # Do the following only if CUPS is running and the needed CUPS tools
23 # are available
24 if which lpstat > /dev/null 2>&1 && \
25 which lpinfo > /dev/null 2>&1 && \
26 which lpadmin > /dev/null 2>&1 && \
27 lpstat -r > /dev/null 2>&1; then
28 # Update the PPD files of all already installed print queues
29 driverregexp='lsb/usr/splix/'
30 gennicknameregexp='s/,(\s*SpliX|)(\s*V\.?|)\s*[\d\.]*$//i'
31 [ ! -z "$gennicknameregexp" ] && \
32 gennicknameregexp="; $gennicknameregexp"
33 gennicknameregexp='s/\s*\(recommended\)//'"$gennicknameregexp"
34 tempfiles=
35 trap 'rm -f $tempfiles; exit 0' 0 1 2 13 15
36 tmpfile1=`mktemp -t updateppds.XXXXXX`
37 tempfiles="$tempfiles $tmpfile1"
38 lpinfo -m | grep -E $driverregexp > $tmpfile1
39 cd /etc/cups/ppd
40 for ppd in *.ppd; do
41 [ -r "$ppd" ] || continue
42 queue=${ppd%.ppd}
43 lpstat -p "$queue" >/dev/null 2>&1 || continue
44 nickname=`grep '\*NickName:' "$ppd" | cut -d '"' -f 2 | perl -p -e 's/\n$//' | perl -p -e "$gennicknameregexp" | perl -p -e 's/(\W)/\\\\$1/g'`
45 lang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'`
46 ppdfound="0"
47 englishppduri=""
48 tmpfile2=`mktemp -t updateppds.XXXXXX`
49 tempfiles="$tempfiles $tmpfile2"
50 cat $tmpfile1 | perl -p -e "$gennicknameregexp" | grep -E '^\S+\s+.*'"$nickname"'$' | cut -d ' ' -f 1 > $tmpfile2
51 while read newppduri; do
52 [ "$ppdfound" = "0" ] && lpadmin -p "$queue" -m $newppduri 2>/dev/null || continue
53 newlang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'`
54 [ "$newlang" = "$lang" ] && ppdfound="1"
55 [ "$newlang" = "english" ] && englishppduri="$newppduri"
56 done < $tmpfile2
57 [ "$ppdfound" = "0" ] && [ ! -z "$englishppduri" ] && lpadmin -p "$queue" -m $englishppduri 2>/dev/null && ppdfound="1"
58 [ "$ppdfound" = "1" ] && echo PPD for printer $queue updated >&2
59 done
60 fi
61 ;;
62
63 abort-upgrade|abort-remove|abort-deconfigure)
64 ;;
65
66 *)
67 echo "postinst called with unknown argument \`$1'" >&2
68 exit 1
69 ;;
70 esac
71
72 # dh_installdeb will replace this with shell code automatically
73 # generated by other debhelper scripts.
74
75 #DEBHELPER#
76
77 exit 0