1 --- usr/local/Brother/cupswrapper/cupswrapperMFC7440N-2.0.2.orig 2010-08-13 20:13:16.009849388 -0700
2 +++ usr/local/Brother/cupswrapper/cupswrapperMFC7440N-2.0.2 2008-01-24 18:29:49.000000000 -0800
4 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
5 # Place, Suite 330, Boston, MA 02111-1307 USA
7 +if [ -z "$DRIVER_PREFIX" ]; then
8 + DRIVER_PREFIX=/usr/local/Brother
12 +ppd_file_name=$DESTDIR/usr/share/cups/model/$MODEL.ppd
13 +brotherlpdwrapper=$DESTDIR/usr/lib/cups/filter/brlpdwrapper$MODEL
14 +brotherlpdwrapper64=$DESTDIR/usr/lib64/cups/filter/brlpdwrapper$MODEL
16 if [ "$1" = '-e' ]; then
18 - rm -f /usr/share/cups/model/MFC7440N.ppd
19 - rm -f /usr/lib/cups/filter/brlpdwrapperMFC7440N
20 - rm -f /usr/lib64/cups/filter/brlpdwrapperMFC7440N
21 - rm -f /usr/local/Brother/cupswrapper/brcupsconfig3
22 - if [ -f /usr/share/ppd/MFC7440N.ppd ];then
23 - rm -f /usr/share/ppd/MFC7440N.ppd
25 + rm -f /usr/share/cups/model/$MODEL.ppd
26 + rm -f /usr/lib/cups/filter/brlpdwrapper$MODEL
27 + rm -f /usr/lib64/cups/filter/brlpdwrapper$MODEL
28 + rm -f ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3
29 + if [ -f /usr/share/ppd/$MODEL.ppd ];then
30 + rm -f /usr/share/ppd/$MODEL.ppd
32 if [ -e /etc/init.d/cups ]; then
33 /etc/init.d/cups restart
37 if [ "$1" = "-r" ]; then
40 if [ -e /etc/init.d/cups ]; then
41 /etc/init.d/cups restart
45 echo ' -e : uninstall'
46 echo ' -r : remove printer'
47 + echo ' -s : simple install (Do not touch services)'
50 -mkdir -p /usr/lib/cups/filter
52 -if [ -e "/usr/local/Brother/lpd/filterMFC7440N" ]; then
53 +mkdir -p $DESTDIR/usr/lib/cups/filter
54 +mkdir -p $DESTDIR/usr/share/cups/model
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/MFC7440N.ppd
62 -ppd_file_name=/usr/share/cups/model/MFC7440N.ppd
64 cat <<ENDOFPPDFILE >$ppd_file_name
66 *%================================================
67 *% Copyright(C) 2006 Brother Industries, Ltd.
68 -*% "Brother MFC7440N for CUPS"
69 +*% "Brother $MODEL for CUPS"
70 *%================================================
72 *%==== General Information Keywords ========================
74 *LanguageEncoding: ISOLatin1
75 *LanguageVersion: English
76 *Manufacturer: "Brother"
77 -*PCFileName: "MFC7440.PPD"
78 -*Product: "(Brother MFC7440N series)"
79 +*PCFileName: "$MODEL.PPD"
80 +*Product: "(Brother $MODEL series)"
82 *cupsManualCopies: True
84 -*cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapperMFC7440N"
85 +*cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapper$MODEL"
86 *PSVersion: "(3010.106) 3"
87 -*ModelName: "MFC7440N"
88 -*NickName: "Brother MFC7440N for CUPS"
89 -*ShortNickName: "Brother MFC7440N for CUPS"
91 +*NickName: "Brother $MODEL for CUPS"
92 +*ShortNickName: "Brother $MODEL for CUPS"
94 *%==== Basic Device Capabilities =============
99 chmod 755 $ppd_file_name
100 -if [ -e '/usr/share/ppd' ];then
101 +if [ -e "$DESTDIR/usr/share/ppd" ];then
102 cp $ppd_file_name /usr/share/ppd
105 -brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperMFC7440N
106 -brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperMFC7440N
107 -rm -f $brotherlpdwrapper
109 +rm -f $brotherlpdwrapper
111 cat <<!ENDOFWFILTER! >$brotherlpdwrapper
113 @@ -387,11 +393,11 @@
114 LOGFILE=/tmp/br_cupsfilter_debug_log
121 if [ "\$PPD" = "" ]; then
122 - PPD="/usr/share/cups/model/MFC7440N.ppd"
123 + PPD="/usr/share/cups/model/$MODEL.ppd"
127 @@ -473,25 +479,25 @@
131 -if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then
132 +if [ -e "${DRIVER_PREFIX}/lpd/filter\$PRINTER" ]; then
135 - echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
136 + echo "ERROR: ${DRIVER_PREFIX}/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
141 -if [ -e "/usr/local/Brother/cupswrapper/brcupsconfig3" ]; then
142 +if [ -e "${DRIVER_PREFIX}/cupswrapper/brcupsconfig3" ]; then
143 if [ \$DEBUG = 0 ]; then
144 - /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
145 + ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
147 - /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
148 + ${DRIVER_PREFIX}/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
153 if [ \$DEBUG -le 2 ]; then
154 - cat \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER
155 + cat \$INPUT_TEMP_PS | ${DRIVER_PREFIX}/lpd/filter\$PRINTER
158 if [ \$DEBUG -ge 2 ]; then
159 @@ -509,32 +515,34 @@
162 chmod 755 $brotherlpdwrapper
163 -if [ -e /usr/lib64/cups/filter ]; then
164 +if [ -e "$DESTDIR/usr/lib64/cups/filter" ]; then
165 cp $brotherlpdwrapper $brotherlpdwrapper64
168 -chmod a+w /usr/local/Brother/inf/brMFC7440Nrc
169 -chmod a+w /usr/local/Brother/inf
170 -if [ -e /etc/init.d/lpd ]; then
171 - /etc/init.d/lpd stop
173 -if [ -e /etc/init.d/lprng ]; then
174 - /etc/init.d/lprng stop
175 +chmod a+w $DESTDIR/${DRIVER_PREFIX}/inf/br${MODEL}rc
176 +chmod a+w $DESTDIR/${DRIVER_PREFIX}/inf
177 +if [ "$1" != "-s" ]; then
178 + if [ -e /etc/init.d/lpd ]; then
179 + /etc/init.d/lpd stop
181 + if [ -e /etc/init.d/lprng ]; then
182 + /etc/init.d/lprng stop
184 + if [ -e /etc/init.d/cups ]; then
185 + /etc/init.d/cups restart
187 + if [ -e /etc/init.d/cupsys ]; then
188 + /etc/init.d/cupsys restart
191 + port2=`lpinfo -v | grep -i 'usb://Brother/MFC-7440N' | head -1`
192 + if [ "$port2" = '' ];then
193 + port2=`lpinfo -v | grep 'usb://' | head -1`
195 + port=`echo $port2| sed s/direct//g`
196 + if [ "$port" = '' ];then
197 + port=usb:/dev/usb/lp0
199 + lpadmin -p $MODEL -E -v $port -P $ppd_file_name
201 - if [ -e /etc/init.d/cups ]; then
202 - /etc/init.d/cups restart
204 - if [ -e /etc/init.d/cupsys ]; then
205 - /etc/init.d/cupsys restart
208 -port2=`lpinfo -v | grep -i 'usb://Brother/MFC-7440N' | head -1`
209 -if [ "$port2" = '' ];then
210 - port2=`lpinfo -v | grep 'usb://' | head -1`
212 -port=`echo $port2| sed s/direct//g`
213 -if [ "$port" = '' ];then
214 - port=usb:/dev/usb/lp0
216 -lpadmin -p MFC7440N -E -v $port -P /usr/share/cups/model/MFC7440N.ppd