summarylogtreecommitdiffstats
path: root/brother-mfc-7860dw.patch
blob: 4eaf8920f91702f4f037efd4cd35e62ee764bb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
diff -Naur old/usr/local/Brother/Printer/MFC7860DW/cupswrapper/cupswrapperMFC7860DW-2.0.4 new/usr/local/Brother/Printer/MFC7860DW/cupswrapper/cupswrapperMFC7860DW-2.0.4
--- old/usr/local/Brother/Printer/MFC7860DW/cupswrapper/cupswrapperMFC7860DW-2.0.4	2010-06-11 00:55:18.000000000 -0700
+++ new/usr/local/Brother/Printer/MFC7860DW/cupswrapper/cupswrapperMFC7860DW-2.0.4	2017-08-21 11:45:55.081640259 -0700
@@ -18,54 +18,7 @@
 # Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
-if [ "$1" = '-e' ]; then
-  lpadmin -x MFC7860DW
-  rm -f /usr/share/cups/model/MFC7860DW.ppd
-  rm -f /usr/lib/cups/filter/brlpdwrapperMFC7860DW
-  rm -f /usr/lib64/cups/filter/brlpdwrapperMFC7860DW
-  rm -f /usr/local/Brother/Printer/MFC7860DW/cupswrapper/brcupsconfig4
-  if [ -f /usr/share/ppd/MFC7860DW.ppd ];then
-  rm -f /usr/share/ppd/MFC7860DW.ppd
-  fi
-  if [ -e /etc/init.d/cups ]; then
-    /etc/init.d/cups restart
-  fi
-  if [ -e /etc/init.d/cupsys ]; then
-    /etc/init.d/cupsys restart
-  fi
-  exit 0 
-fi
-if [ "$1" = "-r" ]; then
-  lpadmin -x MFC7860DW
-  if [ -e /etc/init.d/cups ]; then
-    /etc/init.d/cups restart
-  fi
-  if [ -e /etc/init.d/cupsys ]; then
-    /etc/init.d/cupsys restart
-  fi
-  exit 0 
-fi
-if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
-  echo   'option -h : help'
-  echo   '       -i : install'
-  echo   '       -e : uninstall'
-  echo   '       -r : remove printer'
-  exit 0
-fi
-mkdir -p /usr/lib/cups/filter
-
-if [ -e "/usr/local/Brother/Printer/MFC7860DW/lpd/filterMFC7860DW" ]; then
-  :
-else
-  echo "ERROR : Brother LPD filter is not installed."
-fi
-rm -f /usr/share/cups/model/MFC7860DW.ppd
-ppd_file_name=/usr/share/cups/model/MFC7860DW.ppd
-if [ ! -e /usr/share/cups/model ]; then
-   ppd_file_name=/usr/share/ppd/MFC7860DW.ppd
-fi
-
-cat <<ENDOFPPDFILE >$ppd_file_name
+cat <<ENDOFPPDFILE > ppd_file
 *PPD-Adobe: "4.3"
 *%================================================
 *%	Copyright Brother Industries,Ltd 2006-2008
@@ -347,24 +300,8 @@
 
 ENDOFPPDFILE
 
-chmod 755  $ppd_file_name
-if [ -e '/usr/share/ppd' ];then
-  if [ -e '/usr/share/cups/model' ];then
-    cp  $ppd_file_name  /usr/share/ppd
-  fi
-fi
-
-brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperMFC7860DW
-brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperMFC7860DW
-rm -f  $brotherlpdwrapper
-if [ ! -e /usr/lib/cups/filter ];then
-  if [ -e /usr/lib64/cups/filter ];then
-    brotherlpdwrapper=/usr/lib64/cups/filter/brlpdwrapperMFC7860DW
-  fi
-fi
 
-
-cat <<!ENDOFWFILTER! >$brotherlpdwrapper
+cat <<!ENDOFWFILTER! > wrapper
 #! /bin/sh
 #
 # Brother Print filter  >>  $brotherlpdwrapper
@@ -493,25 +430,25 @@
 fi
 
 
-if [ -e "/usr/local/Brother/Printer/\$PRINTER/lpd/filter\$PRINTER" ]; then
+if [ -e "/usr/share/brother/printer/\$PRINTER/lpd/filter\$PRINTER" ]; then
        :
 else
-    echo "ERROR: /usr/local/Brother/Printer/\$PRINTER/lpd/filter\$PRINTER does not exist"   >>\$LOGFILE
+    echo "ERROR: /usr/share/brother/printer/\$PRINTER/lpd/filter\$PRINTER does not exist"   >>\$LOGFILE
     errorcode=30
     exit $errorcode
 fi
 
-if [ -e "/usr/local/Brother/Printer/MFC7860DW/cupswrapper/brcupsconfig4" ]; then
+if [ -e "/usr/share/brother/printer/MFC7860DW/cupswrapper/brcupsconfig4" ]; then
   if [ \$DEBUG = 0 ]; then
-     /usr/local/Brother/Printer/MFC7860DW/cupswrapper/brcupsconfig4  \$PRINTER  \$PPD 0 "\$options" >> /dev/null
+     /usr/share/brother/printer/MFC7860DW/cupswrapper/brcupsconfig4  \$PRINTER  \$PPD 0 "\$options" >> /dev/null
   else
-     /usr/local/Brother/Printer/MFC7860DW/cupswrapper/brcupsconfig4  \$PRINTER  \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
+     /usr/share/brother/printer/MFC7860DW/cupswrapper/brcupsconfig4  \$PRINTER  \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
   fi
 fi
 
 
 if [ \$DEBUG -le 2 ]; then
-    cat    \$INPUT_TEMP_PS | /usr/local/Brother/Printer/\$PRINTER/lpd/filter\$PRINTER
+    cat    \$INPUT_TEMP_PS | /usr/share/brother/printer/\$PRINTER/lpd/filter\$PRINTER
 fi
 
 if [ \$DEBUG -ge 2 ];  then
@@ -526,40 +463,3 @@
 exit \$errorcode
 
 !ENDOFWFILTER!
-
-
-chmod 755 $brotherlpdwrapper
-if [ -e /usr/lib/cups/filter ]; then
- if [ -e /usr/lib64/cups/filter ]; then
-   cp $brotherlpdwrapper  $brotherlpdwrapper64
- fi
-fi
-
-chmod a+w /usr/local/Brother/Printer/MFC7860DW/inf/brMFC7860DWrc
-chmod a+w /usr/local/Brother/Printer/MFC7860DW/inf
-if [ -e /etc/init.d/lpd ]; then
-   /etc/init.d/lpd stop
-fi
-if [  -e /etc/init.d/lprng ]; then
-   /etc/init.d/lprng stop
-fi
-  if [ -e /etc/init.d/cups ]; then
-    /etc/init.d/cups restart
-  fi
-  if [ -e /etc/init.d/cupsys ]; then
-    /etc/init.d/cupsys restart
-  fi
-sleep 2s
-port2=`lpinfo -v | grep -i 'usb://Brother/MFC7860DW' | head -1`
-if [ "$port2" = '' ];then
-  port2=`lpinfo -v | grep -i 'usb://Brother/' | head -1`
-  if [ "$port2" = '' ];then
-	   port2=`lpinfo -v | grep 'usb://' | head -1`
-  fi
-fi
-port=`echo $port2| sed s/direct//g`
-if [ "$port" = '' ];then
-	port=usb:/dev/usb/lp0
-fi
-lpadmin -p MFC7860DW -E -v $port -P $ppd_file_name
-  exit 0 
diff -Naur old/usr/local/Brother/Printer/MFC7860DW/inf/brMFC7860DWfunc new/usr/local/Brother/Printer/MFC7860DW/inf/brMFC7860DWfunc
--- old/usr/local/Brother/Printer/MFC7860DW/inf/brMFC7860DWfunc	2010-05-24 06:10:10.000000000 +0300
+++ new/usr/local/Brother/Printer/MFC7860DW/inf/brMFC7860DWfunc	2013-01-28 12:59:40.000000000 +0200
@@ -24,4 +24,5 @@
 Sleep={PrinterDefault,"1-99"}
 Toner Save Mode={ON,OFF}
 
-
+[psconvert2]
+pstops=/usr/lib/cups/filter/pstops
diff -Naur old/usr/local/Brother/Printer/MFC7860DW/lpd/filterMFC7860DW new/usr/local/Brother/Printer/MFC7860DW/lpd/filterMFC7860DW
--- old/usr/local/Brother/Printer/MFC7860DW/lpd/filterMFC7860DW	2010-05-24 06:10:10.000000000 +0300
+++ new/usr/local/Brother/Printer/MFC7860DW/lpd/filterMFC7860DW	2013-01-28 13:01:20.000000000 +0200
@@ -22,7 +22,7 @@
 PRINTER_TMP=$(echo $PRINTER | sed -e 's/ //g' -e 's/-//g')
 PCL=1
 
-BR_PRT_PATH=/usr/local/Brother/Printer/$PRINTER_TMP
+BR_PRT_PATH=/usr/share/brother/printer/$PRINTER_TMP
 RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'`
 PAPER_INF=$BR_PRT_PATH/inf/paperinf
 PSCONV=$BR_PRT_PATH/lpd/psconvert2
@@ -116,13 +116,11 @@
 else
 	cp $INPUT_TEMP1 $INPUT_TEMP
 fi
-	
-#PSTOPSFILTER=`which pstops`
 
-if [ -e '/usr/bin/pstops' ];then
-	PSTOPSFILTER='/usr/bin/pstops'
-else
-	PSTOPSFILTER=''
+PSTOPSFILTER='/usr/lib/cups/filter/pstops'
+ 
+if ! [ -e "$PSTOPSFILTER" ];then
+ 	PSTOPSFILTER=''
 fi