1 diff -Naur data.org/usr/local/Brother/Printer/mfc260c/cupswrapper/cupswrappermfc260c data/usr/local/Brother/Printer/mfc260c/cupswrapper/cupswrappermfc260c
2 --- data.org/usr/local/Brother/Printer/mfc260c/cupswrapper/cupswrappermfc260c 2008-11-08 18:51:51.000000000 +0100
3 +++ data/usr/local/Brother/Printer/mfc260c/cupswrapper/cupswrappermfc260c 2008-11-08 19:37:11.000000000 +0100
5 printer_name=`echo $printer_model | tr '[a-z]' '[A-Z]'`
6 device_name=`echo $printer_name | eval sed -e 's/MFC/MFC-/' -e 's/DCP/DCP-/' -e 's/FAX/FAX-/'`
7 pcfilename=`echo $printer_name | tr -d '[A-Z]'`
8 -device_model="Printer"
9 -if [ "$1" = '-e' ]; then
10 - lpadmin -x ${printer_name}
11 - rm -f /usr/share/cups/model/br${printer_model}.ppd
12 - rm -f /usr/share/ppd/br${printer_model}.ppd
13 - rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}
14 - rm -f /usr/lib64/cups/filter/brlpdwrapper${printer_model}
15 - rm -f /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
16 -if [ -e /etc/init.d/cups ]; then
17 - /etc/init.d/cups restart
18 -elif [ -e /etc/init.d/cupsys ]; then
19 - /etc/init.d/cupsys restart
21 -# /etc/init.d/cups restart
24 -if [ "$1" = "-r" ]; then
25 - lpadmin -x ${printer_name}
26 -if [ -e /etc/init.d/cups ]; then
27 - /etc/init.d/cups restart
28 -elif [ -e /etc/init.d/cupsys ]; then
29 - /etc/init.d/cupsys restart
31 -# /etc/init.d/cups restart
34 -if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
35 - echo 'option -h : help'
36 - echo ' -i : install'
37 - echo ' -e : uninstall'
38 - echo ' -r : remove printer'
41 -#mkdir -p /usr/local/Brother/${device_model}/${printer_model}/filter
42 -#mkdir -p /usr/lib/cups/filter
43 +device_model="printer"
45 -if [ -e "/usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
48 - echo "ERROR : Brother LPD filter is not installed."
50 -rm -f /usr/share/cups/model/br${printer_model}.ppd
51 -ppd_file_name=/usr/share/cups/model/br${printer_model}.ppd
52 +ppd_file_name=br${printer_model}.ppd
54 cat <<ENDOFPPDFILE1 >$ppd_file_name
60 -chmod 644 $ppd_file_name
62 -if [ -d /usr/share/ppd ]
64 - cp $ppd_file_name /usr/share/ppd/br${printer_model}.ppd
65 - chmod 644 /usr/share/ppd/br${printer_model}.ppd
68 -#################################################
70 -if [ -d /usr/lib/cups/filter ]
72 - brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapper${printer_model}
74 - brotherlpdwrapper=/usr/lib64/cups/filter/brlpdwrapper${printer_model}
78 -rm -f $brotherlpdwrapper
79 -#echo 'rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}'
81 +brotherlpdwrapper=brlpdwrapper${printer_model}
83 cat <<!ENDOFWFILTER! >$brotherlpdwrapper
89 -if [ -e "/usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
90 +if [ -e "/usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
93 - echo "ERROR: /usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist" >>\$LOGFILE
94 + echo "ERROR: /usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist" >>\$LOGFILE
99 CUPSOPTION=\`echo "\$5 Copies=\$4" | sed -e 's/BrChain/Chain/' -e 's/BrBrightness/Brightness/' -e 's/BrContrast/Contrast/' -e 's/BrHalfCut/HalfCut/' -e 's/BrAutoTapeCut/AutoCut/' -e 's/BrMirror/Mirror/' -e 's/BrHalftonePattern/Halftone/' -e 's/Binary/Binary/' -e 's/Dither/Dither/' -e 's/ErrorDiffusion/ErrorDiffusion/' -e 's/PageSize/media/' -e 's/BrSheets/Sheets/' -e 's/multiple-document-handling/Collate/' -e 's/separate-documents-collated-copies/ON/' -e 's/separate-documents-uncollated-copies/OFF/'\`
100 -if [ -e "/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
101 +if [ -e "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
102 if [ \$DEBUG = 0 ]; then
103 - /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
104 + /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
106 - /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC \$LOGCLEVEL "\$CUPSOPTION" "${printer_model}">>\$LOGFILE
107 + /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC \$LOGCLEVEL "\$CUPSOPTION" "${printer_model}">>\$LOGFILE
111 if [ \$DEBUG -lt 10 ]; then
112 - cat \$INPUT_TEMP_PS | /usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
113 + cat \$INPUT_TEMP_PS | /usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
115 if [ \$LOGLEVEL -gt 2 ]; then
116 if [ \$LOGFILE != "/dev/null" ]; then
119 rm -f \$INPUT_TEMP_PS
126 -chmod 755 $brotherlpdwrapper
127 -#if [ -e /usr/lib64/cups/backend ]; then
128 -# cp $brotherlpdwrapper $brotherlpdwrapper64
131 -chmod a+w /usr/local/Brother/${device_model}/${printer_model}/inf/br${printer_model}rc
132 -chmod a+w /usr/local/Brother/${device_model}/${printer_model}/inf
133 -if [ -e /etc/init.d/lpd ]; then
134 - /etc/init.d/lpd stop
136 -if [ -e /etc/init.d/lprng ]; then
137 - /etc/init.d/lprng stop
141 -if [ -e /etc/init.d/cups ]; then
142 - /etc/init.d/cups restart
143 -elif [ -e /etc/init.d/cupsys ]; then
144 - /etc/init.d/cupsys restart
150 -port2=`lpinfo -v | grep -i 'usb://Brother/${device_name}' | head -1`
151 -if [ "$port2" = '' ];then
152 - port2=`lpinfo -v | grep 'usb://Brother' | head -1`
155 -if [ "$port2" = '' ];then
156 - port2=`lpinfo -v | grep 'usb://' | head -1`
158 -port=`echo $port2| sed s/direct//g`
160 -if [ "$port" = '' ];then
161 - port=usb:/dev/usb/lp0
163 -lpadmin -p ${printer_name} -E -v $port -m br${printer_model}.ppd