updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / brother-hl5040-cups / cupswrapper.patch
blobb6ccc5fba6913265882cf98199ca4fa3d2aac746
1 --- cupswrapperHL5040-1.0.2 2005-06-13 01:38:23.000000000 +0200
2 +++ cupswrapper_NEW 2011-01-26 11:31:53.000000000 +0100
3 21,53c21,61
4 < if [ "$1" = '-e' ]; then
5 < lpadmin -x HL5040
6 < rm -f /usr/share/cups/model/brhl5040_cups.ppd
7 < rm -f /usr/lib/cups/filter/brlpdwrapperHL5040
8 < rm -f /usr/lib64/cups/filter/brlpdwrapperHL5040
9 < rm -f /usr/local/Brother/cupswrapper/brcupsconfig
10 < if [ -e /etc/init.d/cups ]; then
11 < /etc/init.d/cups restart
12 < fi
13 < if [ -e /etc/init.d/cupsys ]; then
14 < /etc/init.d/cupsys restart
15 < fi
16 < exit 0
17 < fi
18 < if [ "$1" = "-r" ]; then
19 < lpadmin -x HL5040
20 < if [ -e /etc/init.d/cups ]; then
21 < /etc/init.d/cups restart
22 < fi
23 < if [ -e /etc/init.d/cupsys ]; then
24 < /etc/init.d/cupsys restart
25 < fi
26 < exit 0
27 < fi
28 < if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
29 < echo 'option -h : help'
30 < echo ' -i : install'
31 < echo ' -e : uninstall'
32 < echo ' -r : remove printer'
33 < exit 0
34 < fi
35 < mkdir -p /usr/local/Brother/filter
36 < mkdir -p /usr/lib/cups/filter
37 ---
38 > #if [ "$1" = '-e' ]; then
39 > # lpadmin -x HL5040
40 > # rm -f /usr/share/cups/model/brhl5040_cups.ppd
41 > # rm -f /usr/lib/cups/filter/brlpdwrapperHL5040
42 > # rm -f /usr/lib64/cups/filter/brlpdwrapperHL5040
43 > # rm -f /usr/local/Brother/cupswrapper/brcupsconfig
44 > # if [ -e /etc/init.d/cups ]; then
45 > # /etc/init.d/cups restart
46 > # fi
47 > # if [ -e /etc/init.d/cupsys ]; then
48 > # /etc/init.d/cupsys restart
49 > # fi
50 > # exit 0
51 > #fi
52 > #if [ "$1" = "-r" ]; then
53 > # lpadmin -x HL5040
54 > # if [ -e /etc/init.d/cups ]; then
55 > # /etc/init.d/cups restart
56 > # fi
57 > # if [ -e /etc/init.d/cupsys ]; then
58 > # /etc/init.d/cupsys restart
59 > # fi
60 > # exit 0
61 > #fi
62 > #if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
63 > # echo 'option -h : help'
64 > # echo ' -i : install'
65 > # echo ' -e : uninstall'
66 > # echo ' -r : remove printer'
67 > # exit 0
68 > #fi
69 > #mkdir -p /usr/local/Brother/filter
70 > #mkdir -p /usr/lib/cups/filter
71 > #
72 > #if [ -e "/usr/local/Brother/lpd/filterHL5040" ]; then
73 > # :
74 > #else
75 > # echo "ERROR : Brother LPD filter is not installed."
76 > #fi
77 > #rm -f /usr/share/cups/model/brhl5040_cups.ppd
78 > #ppd_file_name=/usr/share/cups/model/brhl5040_cups.ppd
79 55,61c63,64
80 < if [ -e "/usr/local/Brother/lpd/filterHL5040" ]; then
81 < :
82 < else
83 < echo "ERROR : Brother LPD filter is not installed."
84 < fi
85 < rm -f /usr/share/cups/model/brhl5040_cups.ppd
86 < ppd_file_name=/usr/share/cups/model/brhl5040_cups.ppd
87 ---
88 > # Write PPD file into CWD
89 > ppd_file_name=HL5040.ppd
90 332,335c335,338
91 < brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL5040
92 < brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL5040
93 < rm -f $brotherlpdwrapper
94 < echo 'rm -f /usr/lib/cups/filter/brlpdwrapperHL5040'
95 ---
96 > #brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL5040
97 > #brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL5040
98 > #rm -f $brotherlpdwrapper
99 > #echo 'rm -f /usr/lib/cups/filter/brlpdwrapperHL5040'
100 336a340,341
101 > # Write brlpdwrapper into CWD
102 > brotherlpdwrapper=brlpdwrapperHL5040
103 483,504c488,509
104 < chmod a+x $brotherlpdwrapper
105 < if [ -e /usr/lib64/cups/filter ]; then
106 < cp $brotherlpdwrapper $brotherlpdwrapper64
107 < fi
109 < chmod a+w /usr/local/Brother/inf/brHL5040rc
110 < chmod a+w /usr/local/Brother/inf
111 < if [ -e /etc/init.d/lpd ]; then
112 < /etc/init.d/lpd stop
113 < fi
114 < if [ -e /etc/init.d/lprng ]; then
115 < /etc/init.d/lprng stop
116 < fi
117 < if [ -e /etc/init.d/cups ]; then
118 < /etc/init.d/cups restart
119 < fi
120 < if [ -e /etc/init.d/cupsys ]; then
121 < /etc/init.d/cupsys restart
122 < fi
123 < sleep 2s
124 < lpadmin -p HL5040 -E -v usb:/dev/usb/lp0 -m brhl5040_cups.ppd
125 < exit 0
127 > #chmod a+x $brotherlpdwrapper
128 > #if [ -e /usr/lib64/cups/filter ]; then
129 > # cp $brotherlpdwrapper $brotherlpdwrapper64
130 > #fi
132 > #chmod a+w /usr/local/Brother/inf/brHL5040rc
133 > #chmod a+w /usr/local/Brother/inf
134 > #if [ -e /etc/init.d/lpd ]; then
135 > # /etc/init.d/lpd stop
136 > #fi
137 > #if [ -e /etc/init.d/lprng ]; then
138 > # /etc/init.d/lprng stop
139 > #fi
140 > # if [ -e /etc/init.d/cups ]; then
141 > # /etc/init.d/cups restart
142 > # fi
143 > # if [ -e /etc/init.d/cupsys ]; then
144 > # /etc/init.d/cupsys restart
145 > # fi
146 > #sleep 2s
147 > #lpadmin -p HL5040 -E -v usb:/dev/usb/lp0 -m brhl5040_cups.ppd
148 > # exit 0