1 diff -Naur a/local/Brother/cupswrapper/cupswrapperHL2150N-2.0.2 b/local/Brother/cupswrapper/cupswrapperHL2150N-2.0.2
2 --- a/local/Brother/cupswrapper/cupswrapperHL2150N-2.0.2 2008-01-25 03:29:45.000000000 +0100
3 +++ b/local/Brother/cupswrapper/cupswrapperHL2150N-2.0.2 2009-08-12 16:56:46.849337866 +0200
5 # Place, Suite 330, Boston, MA 02111-1307 USA
8 +if [ -z "$DRIVER_PREFIX" ]; then
9 + DRIVER_PREFIX=/usr/local/Brother
13 +ppd_file_name=$DESTDIR/usr/share/cups/model/$MODEL.ppd
14 +brotherlpdwrapper=$DESTDIR/usr/lib/cups/filter/brlpdwrapper$MODEL
15 +brotherlpdwrapper64=$DESTDIR/usr/lib64/cups/filter/brlpdwrapper$MODEL
17 if [ "$1" = '-e' ]; then
19 - rm -f /usr/share/cups/model/HL2150N.ppd
20 - rm -f /usr/lib/cups/filter/brlpdwrapperHL2150N
21 - rm -f /usr/lib64/cups/filter/brlpdwrapperHL2150N
22 - rm -f /usr/local/Brother/cupswrapper/brcupsconfig3
23 - if [ -f /usr/share/ppd/HL2150N.ppd ];then
24 - rm -f /usr/share/ppd/HL2150N.ppd
26 + rm -f /usr/share/cups/model/${MODEL}.ppd
27 + rm -f /usr/lib/cups/filter/brlpdwrapper${MODEL}
28 + rm -f /usr/lib64/cups/filter/brlpdwrapper${MODEL}
29 + rm -f ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3
30 + if [ -f /usr/share/ppd/${MODEL}.ppd ];then
31 + rm -f /usr/share/ppd/${MODEL}.ppd
33 if [ -e /etc/init.d/cups ]; then
34 /etc/init.d/cups restart
38 if [ "$1" = "-r" ]; then
41 if [ -e /etc/init.d/cups ]; then
42 /etc/init.d/cups restart
46 echo ' -e : uninstall'
47 echo ' -r : remove printer'
48 + echo ' -s : simple install (Do not touch services)'
51 -mkdir -p /usr/lib/cups/filter
52 +mkdir -p $DESTDIR/usr/lib/cups/filter
53 +mkdir -p $DESTDIR/usr/share/cups/model
55 -if [ -e "/usr/local/Brother/lpd/filterHL2150N" ]; then
56 +if [ -e "${DESTDIR}/${DRIVER_PREFIX}/lpd/filter${MODEL}" ]; then
59 echo "ERROR : Brother LPD filter is not installed."
61 -rm -f /usr/share/cups/model/HL2150N.ppd
62 -ppd_file_name=/usr/share/cups/model/HL2150N.ppd
64 cat <<ENDOFPPDFILE >$ppd_file_name
66 *%================================================
67 *% Copyright(C) 2006 Brother Industries, Ltd.
68 -*% "Brother HL2150N for CUPS"
69 +*% "Brother ${MODEL} for CUPS"
70 *%================================================
72 *%==== General Information Keywords ========================
74 *LanguageVersion: English
75 *Manufacturer: "Brother"
76 *PCFileName: "HL2150.PPD"
77 -*Product: "(Brother HL2150N series)"
78 +*Product: "(Brother ${MODEL} series)"
80 *cupsManualCopies: True
82 -*cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapperHL2150N"
83 +*cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapper${MODEL}"
84 *PSVersion: "(3010.106) 3"
85 -*ModelName: "HL2150N"
86 -*NickName: "Brother HL2150N for CUPS"
87 -*ShortNickName: "Brother HL2150N for CUPS"
88 +*ModelName: "${MODEL}"
89 +*NickName: "Brother ${MODEL} for CUPS"
90 +*ShortNickName: "Brother ${MODEL} for CUPS"
92 *%==== Basic Device Capabilities =============
97 chmod 755 $ppd_file_name
98 -if [ -e '/usr/share/ppd' ];then
99 - cp $ppd_file_name /usr/share/ppd
100 +if [ -e "$DESTDIR/usr/share/ppd" ];then
101 + cp $ppd_file_name $DESTDIR/usr/share/ppd
104 -brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL2150N
105 -brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL2150N
106 -rm -f $brotherlpdwrapper
107 +rm -f $brotherlpdwrapper
110 cat <<!ENDOFWFILTER! >$brotherlpdwrapper
111 @@ -387,11 +394,11 @@
112 LOGFILE=/tmp/br_cupsfilter_debug_log
119 if [ "\$PPD" = "" ]; then
120 - PPD="/usr/share/cups/model/HL2150N.ppd"
121 + PPD="/usr/share/cups/model/${MODEL}.ppd"
125 @@ -473,25 +480,25 @@
129 -if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then
130 +if [ -e "${DRIVER_PREFIX}/lpd/filter\$PRINTER" ]; then
133 - echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
134 + echo "ERROR: ${DRIVER_PREFIX}/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
139 -if [ -e "/usr/local/Brother/cupswrapper/brcupsconfig3" ]; then
140 +if [ -e "${DRIVER_PREFIX}/cupswrapper/brcupsconfig3" ]; then
141 if [ \$DEBUG = 0 ]; then
142 - /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
143 + ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
145 - /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
146 + ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
151 if [ \$DEBUG -le 2 ]; then
152 - cat \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER
153 + cat \$INPUT_TEMP_PS | ${DRIVER_PREFIX}/lpd/filter\$PRINTER
156 if [ \$DEBUG -ge 2 ]; then
157 @@ -509,32 +516,34 @@
160 chmod 755 $brotherlpdwrapper
161 -if [ -e /usr/lib64/cups/filter ]; then
162 +if [ -e "$DESTDIR/usr/lib64/cups/filter" ]; then
163 cp $brotherlpdwrapper $brotherlpdwrapper64
166 -chmod a+w /usr/local/Brother/inf/brHL2150Nrc
167 -chmod a+w /usr/local/Brother/inf
168 -if [ -e /etc/init.d/lpd ]; then
169 - /etc/init.d/lpd stop
171 -if [ -e /etc/init.d/lprng ]; then
172 - /etc/init.d/lprng stop
174 - if [ -e /etc/init.d/cups ]; then
175 - /etc/init.d/cups restart
177 - if [ -e /etc/init.d/cupsys ]; then
178 - /etc/init.d/cupsys restart
181 -port2=`lpinfo -v | grep -i 'usb://Brother/HL-2150N' | head -1`
182 -if [ "$port2" = '' ];then
183 - port2=`lpinfo -v | grep 'usb://' | head -1`
185 -port=`echo $port2| sed s/direct//g`
186 -if [ "$port" = '' ];then
187 - port=usb:/dev/usb/lp0
188 +chmod a+w $DESTDIR/${DRIVER_PREFIX}/inf/br${MODEL}rc
189 +chmod a+w $DESTDIR/${DRIVER_PREFIX}/inf
190 +if [ "$1" != "-s" ]; then
191 + if [ -e /etc/init.d/lpd ]; then
192 + /etc/init.d/lpd stop
194 + if [ -e /etc/init.d/lprng ]; then
195 + /etc/init.d/lprng stop
197 + if [ -e /etc/init.d/cups ]; then
198 + /etc/init.d/cups restart
200 + if [ -e /etc/init.d/cupsys ]; then
201 + /etc/init.d/cupsys restart
204 + port2=`lpinfo -v | grep -i 'usb://Brother/HL-2140' | head -1`
205 + if [ "$port2" = '' ];then
206 + port2=`lpinfo -v | grep 'usb://' | head -1`
208 + port=`echo $port2| sed s/direct//g`
209 + if [ "$port" = '' ];then
210 + port=usb:/dev/usb/lp0
212 + lpadmin -p ${MODEL} -E -v $port -P $ppd_file_name
214 -lpadmin -p HL2150N -E -v $port -P /usr/share/cups/model/HL2150N.ppd