summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 642f96eaa5456104a7b85b6487f35bbf36a88fe3 (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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# Maintainer:  Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: Malte Ohmstede <malte.ohmstede at gmail youknow>

# This package should not be used. Use cnijfilter2 and scangearmp2 instead
# Unfortunately this package will stay until those packages get their Descriptions right so they can be found.

# Based on PKGBUILD from https://aur.archlinux.org/packages/canon-pixma-mg5500-complete
# Scanner icon source: http://openiconlibrary.sourceforge.net/gallery2/open_icon_library-full/icons/png/64x64/devices/scanner-3.png
# The icon source URL isn't alive anymore

# Too many models to list in Package Description. List them all for a Google search.
# Model list assembled from https://ugp01.c-ij.com/ij/webmanual/WebPortal/PTL/ptl-select.html?lng=en&type=setup
# or from Google
# Line stays origional for diff matching when no models found unless odd brand between

# Canon PIXMA  E200   series E201 E204
# Canon E200 series
# Canon PIXMA  E300   series E301 E304
# Canon PIXMA  E3100  series E3110 E3111 E3140 E3170 E3177 E3190 E3195
# Canon PIXMA  E3300  series E3340 E3370 E3390 E3391
# Canon PIXMA  E3400  series E3440 E3470 E3480 E3490 E3491
# Canon PIXMA  E4200  series E4210 E4240 E4270 E4280 E4290
# Canon PIXMA  E4500  series E4570 E4580 E4590
# Canon PIXMA  E460   series E460 E461 E464 E468
# Canon PIXMA  E470   series E470 E471 E474 E477 E478
# Canon PIXMA  E480   series E480 E481 E484 E488 E489
# Canon G1020 series
# Canon G2020 series
# Canon G2060 series
# Canon PIXMA  G3000  series G3000 G3100 G3101 G3102 G3200 G3400 G3500 G3501 G3600 G3800 G3900
# Canon PIXMA  G3010  series G3010 G3012 G3110 G3111 G3310 G3410 G3411 G3415 G3510 G3610 G3810 G3910 G3915
# Canon G3020 series
# Canon G3060 series
# Canon PIXMA  G4000  series G4000 G4100 G4102 G4200 G4400 G4500 G4600 G4800 G4900 G4902
# Canon PIXMA  G4010  series G4010 G4110 G4111 G4210 G4410 G4510 G4511 G4610 G4810 G4910 G4911
# Canon PIXMA  G5000  series G5010 G5011 G5020 G5030 G5040 G5050 G5070 G5090 G5092
# Canon PIXMA  G500   series G510 G540 G550 G570 G580 G590 G595
# Canon G5080 series
# Canon PIXMA  G6000  series G6010 G6011 G6020 G6030 G6040 G6050 G6060 G6065 G6070 G6090 G6091 G6092
# Canon PIXMA  G600   series G610 G620 G640 G650 G660 G670 G680 G690 G695
# Canon G6080 series
# Canon PIXMA  G7000  series G7010 G7011 G7020 G7030 G7040 G7050 G7060 G7065 G7070 G7090 G7091 G7092
# Canon G7080 series
# Canon PIXMA  GM2000 series GM2010 GM2011 GM2030 GM2040 GM2050 GM2070 GM2080 GM2090 GM2092
# Canon GM2080 series
# Canon PIXMA  GM4000 series GM4010 GM4011 GM4030 GM4040 GM4050 GM4070 GM4080 GM4090 GM4092
# Canon GM4080 series
# Canon PIXMA  GX5000 series GX5010 GX5020 GX5030 GX5040 GX5050 GX5060 GX5070 GX5080 GX5090 GX5091 GX5092
# Canon PIXMA  GX6000 series GX6010 GX6020 GX6021 GX6030 GX6040 GX6050 GX6060 GX6070 GX6080 GX6090 GX6091 GX6092
# Canon PIXMA  GX7000 series GX7010 GX7020 GX7021 GX7030 GX7040 GX7050 GX7060 GX7070 GX7080 GX7090 GX7091 GX7092
# Canon MAXIFY iB4000 series iB4010 iB4020 iB4030 iB4040 iB4050 iB4060 iB4070 iB4080 iB4090
# Canon MAXIFY iB4100 series iB4110 iB4120 iB4130 iB4140 iB4150 iB4160 iB4170 iB4180 iB4190
# Canon PIXMA  iP110  series
# Canon MAXIFY MB2000 series MB2010 MB2020 MB2030 MB2040 MB2050 MB2060
# Canon MAXIFY MB2100 series MB2110 MB2120 MB2130 MB2140 MB2150 MB2155 MB2160
# Canon MAXIFY MB2300 series MB2320 MB2330 MB2340 MB2350 MB2360 MB2390
# Canon MAXIFY MB2700 series MB2710 MB2720 MB2730 MB2740 MB2750 MB2755 MB2760 MB2790
# Canon MAXIFY MB5000 series MB5020 MB5030 MB5040 MB5050 MB5060 MB5070 MB5080 MB5090
# Canon MAXIFY MB5100 series MB5110 MB5120 MB5130 MB5140 MB5150 MB5155 MB5160 MB5170 MB5180 MB5190
# Canon MAXIFY MB5300 series MB5310 MB5320 MB5330 MB5340 MB5350 MB5360 MB5370 MB5390
# Canon MAXIFY MB5400 series MB5410 MB5420 MB5430 MB5440 MB5450 MB5455 MB5460 MB5470 MB5480 MB5490
# Canon PIXMA  MG2900 series MG2910 MG2920 MG2922 MG2924 MG2929 MG2940 MG2945 MG2950S MG2950 MG2955 MG2960 MG2965S MG2970 MG2980 MG2990
# Canon PIXMA  MG3000 series MG3010 MG3020 MG3022 MG3040 MG3050 MG3051 MG3052 MG3053 MG3060 MG3070S MG3070 MG3077S MG3077 MG3080 MG3090
# Canon PIXMA  MG3600 series MG3610 MG3620 MG3630 MG3640 MG3640S MG3650 MG3650S MG3660 MG3670 MG3680
# Canon PIXMA  MG5600 series MG5610 MG5620 MG5622 MG5630 MG5640 MG5650 MG5655 MG5660 MG5670 MG5680
# Canon PIXMA  MG5700 series MG5710 MG5720 MG5721 MG5722 MG5730 MG5740 MG5750 MG5751 MG5752 MG5753 MG5760 MG5765 MG5766 MG5770 MG5780 MG5790 MG5795
# Canon PIXMA  MG6600 series MG6610 MG6620 MG6640 MG6650 MG6660 MG6670 MG6680
# Canon PIXMA  MG6800 series MG6810 MG6820 MG6821 MG6822 MG6840 MG6850 MG6851 MG6852 MG6853 MG6860 MG6865 MG6866 MG6870 MG6880
# Canon PIXMA  MG6900 series MG6930
# Canon PIXMA  MG7500 series MG7510 MG7520 MG7530F MG7530 MG7540 MG7550 MG7560 MG7570 MG7580
# Canon PIXMA  MG7700 series MG7710 MG7720 MG7730F MG7730 MG7740 MG7750 MG7751 MG7752 MG7753 MG7760 MG7765 MG7766 MG7770 MG7780 MG7790
# Canon PIXMA  MX490  series MX491 MX492 MX494 MX495 MX496 MX497 MX498 MX499
# Canon TR150 series
# Canon PIXMA  TR4500 series TR4520 TR4522 TR4527 TR4530 TR4540 TR4550 TR4551 TR4560 TR4570 TR4570S TR4580 TR4590 TR4595
# Canon PIXMA  TR4600 series TR4640 TR4650 TR4651 TR4660 TR4665 TR4670 TR4670S TR4690 TR4695
# Canon PIXMA  TR4700 series TR4720 TR4722 TR4723 TR4725 TR4750i TR4751i
# Canon PIXMA  TR7000 series TR7020 TR7020a TR7021a TR7022 TR7022a TR7060 TR7060a
# Canon PIXUS  TR703  series
# Canon PIXMA  TR7500 series TR7520 TR7530 TR7540 TR7550 TR7560
# Canon PIXMA  TR7530 series
# Canon PIXMA  TR7600 series TR7620 TR7620a TR7660 TR7660a
# Canon PIXMA  TR8500 series TR8520 TR8530 TR8540 TR8550 TR8560 TR8570 TR8580
# Canon PIXMA  TR8530 series
# Canon PIXMA  TR8580 series
# Canon PIXMA  TR8600 series TR8620 TR8620a TR8622 TR8622a TR8660 TR8660a
# Canon TR8630 series
# Canon TR9530 series
# Canon PIXMA  TS200  series TS202 TS203 TS204 TS205 TS207 TS208
# Canon TS2400 series
# Canon TS2600 series
# Canon PIXMA  TS300  series TS302 TS304 TS305 TS307 TS308
# Canon PIXMA  TS3100 series TS3110 TS3120 TS3122 TS3129 TS3130 TS3130S TS3140 TS3150 TS3151 TS3160 TS3165 TS3166 TS3170 TS3170S TS3177S TS3180 TS3190 TS3195
# Canon PIXMA  TS3300 series TS3310 TS3320 TS3322 TS3325 TS3327 TS3329 TS3330 TS3340 TS3350 TS3351 TS3352 TS3355 TS3360 TS3365 TS3370 TS3370S TS3380 TS3390 TS3391 TS3392
# Canon PIXMA  TS3400 series TS3420 TS3425 TS3429 TS3440 TS3450 TS3451 TS3452 TS3460 TS3465 TS3466 TS3470 TS3480 TS3490 TS3491 TS3492
# Canon TS3500 series
# Canon PIXMA  TS5000 series TS5010 TS5020 TS5022 TS5030 TS5030S TS5040 TS5050 TS5051 TS5053 TS5055 TS5060 TS5070 TS5080 TS5090
# Canon PIXMA  TS5100 series TS5110 TS5120 TS5130 TS5130S TS5140 TS5150 TS5151 TS5160 TS5170 TS5180
# Canon PIXMA  TS5300 series TS5320 TS5330 TS5340 TS5350 TS5351 TS5352 TS5353 TS5360 TS5365 TS5370 TS5380 TS5390 TS5391 TS5392
# Canon PIXMA  TS5350i series TS3520 TS3522 TS3530 TS3550i TS3551i
# Canon PIXMA  TS5380 series
# Canon TS5400 series
# Canon PIXMA  TS6000 series TS6010 TS6020 TS6030 TS6040 TS6050 TS6051 TS6052 TS6060 TS6070 TS6080
# Canon PIXMA  TS6100 series TS6110 TS6120 TS6130 TS6140 TS6150 TS6151 TS6160 TS6180
# Canon PIXMA  TS6130 series
# Canon PIXMA  TS6180 series
# Canon PIXMA  TS6200 series TS6210 TS6220 TS6230 TS6240 TS6250 TS6251 TS6260 TS6280 TS6290
# Canon PIXMA  TS6230 series
# Canon PIXMA  TS6280 series
# Canon PIXMA  TS6300 series TS6320 TS6330 TS6340 TS6350 TS6351 TS6360 TS6365 TS6370 TS6380 TS6390 TS6391 TS6392
# Canon PIXMA  TS6330 series
# Canon PIXMA  TS6380 series
# Canon PIXMA  TS6400 series TS6420 TS6420a
# Canon PIXMA  TS700  series TS701 TS702 TS704 TS705 TS706 TS707 TS708 TS709
# Canon PIXMA  TS708  series
# Canon PIXMA  TS7330 series
# Canon PIXMA  TS7400 series TS7440 TS7440a TS7450 TS7450a TS7451 TS7451a
# Canon TS7430 series
# Canon TS7450i series
# Canon TS7530 series
# Canon PIXMA  TS8000 series TS8010 TS8020 TS8030 TS8040 TS8050 TS8051 TS8052 TS8053 TS8060 TS8070 TS8080 TS8090
# Canon PIXMA  TS8100 series TS8120 TS8130 TS8140 TS8150 TS8151 TS8152 TS8160 TS8170 TS8180 TS8190 TS8195
# Canon TS8130 series
# Canon TS8180 series
# Canon PIXMA  TS8200 series TS8220 TS8222 TS8230 TS8240 TS8250 TS8251 TS8252 TS8260 TS8270 TS8280 TS8290 TS8295 TS8298
# Canon TS8230 series
# Canon TS8280 series
# Canon PIXMA  TS8300 series TS8320 TS8330 TS8340 TS8350 TS8351 TS8352 TS8360 TS8370 TS8380 TS8390 TS8391 TS8392
# Canon TS8330 series
# Canon TS8380 series
# Canon TS8430 series
# Canon TS8530 series
# Canon PIXMA  TS9000 series TS9010 TS9020 TS9030 TS9040 TS9050 TS9055 TS9060 TS9080
# Canon PIXMA  TS9100 series TS9120 TS9140 TS9150 TS9155 TS9160 TS9170 TS9180
# Canon PIXMA  TS9180 series
# Canon PIXMA  TS9500 series TS9520 TS9521C TS9540 TS9541C TS9550 TS9551C TS9560 TS9565 TS9570 TS9580 TS9590
# Canon PIXMA  TS9580 series
# Canon XK100 series
# Canon PIXUS  XK500 series
# Canon PIXUS  XK50   series
# Canon PIXUS  XK60   series
# Canon PIXUS  XK70   series
# Canon PIXUS  XK80   series
# Canon XK90 series

# awk '/^# Canon / { printf(" %s",$4); }' 'PKGBUILD'

set -u
pkgname='canon-pixma-ts5055-complete'
#pkgver='5.40'; _pkgversg='3.40'; _pdl='9/0100008399/01'; _sdl='2/0100008402/01' # TS5505
#pkgver='5.50'; _pkgversg='3.50'; _pdl='8/0100009108/01'; _sdl='1/0100009111/01' # TS5120
#pkgver='5.60'; _pkgversg='3.60'; _pdl='8/0100009488/01'; _sdl='1/0100009491/01' # G3010
#pkgver='5.70'; _pkgversg='3.70'; _pdl='8/0100009928/01'; _sdl='1/0100009931/01' # TS6220
#pkgver='5.80'; _pkgversg='3.70'; _pdl='1/0100010271/01'; _sdl='1/0100009931/01' # TS702 TR703
#pkgver='5.90'; _pkgversg='3.90'; _pdl='2/0100010482/01'; _sdl='5/0100010485/01' # TS3340
#pkgver='6.00'; _pkgversg='4.00'; _pdl='8/0100010738/01'; _sdl='1/0100010741/01' # G7020 GM4030, G7050 GM4050
#pkgver='6.10'; _pkgversg='4.10'; _pdl='9/0100010919/01'; _sdl='2/0100010922/01' # TS3440 GM7440
#pkgver='6.20'; _pkgversg='4.20'; _pdl='5/0100011055/01'; _sdl='8/0100011058/01' # GX6040 GX6050 GX7040 GX7050
#pkgver='6.30'; _pkgversg='4.30'; _pdl='7/0100011317/01'; _sdl='0/0100011320/01' # E4570 G570 G670 TS3550i
pkgver='6.40'; _pkgversg='4.30'; _pdl='9/0100011379/01'; _sdl='0/0100011320/01' # GX5020 GX5050 GX5070, new models don't scan so no new version
# For the newest driver version go to the docs site and peruse the "NEW" models.
# For old driver versions look for the version in the PPDs or diff models*.txt
# After updating version enable code in package() to check for new models.
pkgrel='1'
_pkgdesc2='E200 E300 E3100 E3300 E3400 E4200 E4500 E460 E470 E480 G1020 G2020 G2060 G3000 G3010 G3020 G3060 G4000 G4010 G5000 G500 G5080 G6000 G600 G6080 G7000 G7080 GM2000 GM2080 GM4000 GM4080 GX5000 GX6000 GX7000 iB4000 iB4100 iP110 MB2000 MB2100 MB2300 MB2700 MB5000 MB5100 MB5300 MB5400 MG2900 MG3000 MG3600 MG5600 MG5700 MG6600 MG6800 MG6900 MG7500 MG7700 MX490 TR150 TR4500 TR4600 TR4700 TR7000 TR703 TR7500 TR7530 TR7600 TR8500 TR8530 TR8580 TR8600 TR8630 TR9530 TS200 TS2400 TS2600 TS300 TS3100 TS3300 TS3400 TS3500 TS5000 TS5100 TS5300 TS5350i TS5380 TS5400 TS6000 TS6100 TS6130 TS6180 TS6200 TS6230 TS6280 TS6300 TS6330 TS6380 TS6400 TS700 TS708 TS7330 TS7400 TS7430 TS7450i TS7530 TS8000 TS8100 TS8130 TS8180 TS8200 TS8230 TS8280 TS8300 TS8330 TS8380 TS8430 TS8530 TS9000 TS9100 TS9180 TS9500 TS9580 XK100 XK500 XK50 XK60 XK70 XK80 XK90'
_pkgdesc2="${_pkgdesc2% GM2000*}"
pkgdesc="cnijfilter2 scangearmp2 Print Scan for Canon MAXIFY PIXMA PIXUS series ${_pkgdesc2}"
arch=('i686' 'x86_64')
# Canon doesn't update the driver for old printers. Here we want any printer with the latest driver.
#url='https://www.canon.de/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_ts_series/pixma-ts5055.html'
#url='https://www.canon-europe.com/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_ts_series/pixma-ts5055.html?type=drivers'
url='https://www.canon-europe.com/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_ts_series/pixma-ts3340.html?type=drivers'
license=('custom')
depends=('cups' 'ghostscript' 'popt' 'libusb-compat' 'gtk2')
depends_x86_64=('libpng12' 'libtiff' 'libxml2')
depends_i686=("${depends_x86_64[@]/#/lib32-}")
conflicts=(
  'cnijfilter2'
  'scangearmp2'
  'canon-maxify-mb5100-complete'
  'canon-pixma-mg3000-complete'
  'canon-pixma-mg5700-complete'
  'canon-pixma-mx495-printer'
  'canon-ts9020'
)
options=('!strip')
install="${pkgname}.install"
_printDrvSrc="cnijfilter2-${pkgver}-1-deb"
_scanDrvSrc="scangearmp2-${_pkgversg}-1-deb"
source=(
  "https://gdlp01.c-wss.com/gds/${_pdl}/${_printDrvSrc}.tar.gz"
  "https://gdlp01.c-wss.com/gds/${_sdl}/${_scanDrvSrc}.tar.gz"
  "${pkgname}-scangear.desktop"
  "${pkgname}-scangear-icon.png"
)
md5sums=('c5da5ec6dcd6af425ab8a9d326c13d8e'
         'de8c822bbb5362a5d35e924e6b8afdec'
         '149560a4ef6a661611e12fafe828093b'
         '3feefd413092d7152f47b7451ba79efe')
sha256sums=('e1527baa828764f152b13c439181d645e8c509cd6c8af8e0177dbc2ef06eac6f'
            '2d4997f1a2265bc2231f41fddb76823287fd9e7cec6cad3106bfdd335fa9ba92'
            '1e9d0f0a8643d0d0d755aa5092a6fb684b24b445d21e7315b3becd15816a7dd1'
            '29dbc682d3f22d79f580bda54801d1f4ef261d857c756eaf4db29e1313406bcc')

_prb="cnijfilter2_${pkgver}-1"
_scb="scangearmp2_${_pkgversg}-1"
_prf="${_prb/_/-}-deb/packages"
_scf="${_scb/_/-}-deb/packages"

#_ppdFile='canonts5000.ppd'

prepare() {
  set -u

  # Unpack debian installer files

  declare -A _cax=([i686]='i386' [x86_64]='amd64')

  cd "${srcdir}/${_prf}"
  bsdtar -xf "${_prb}_${_cax[${CARCH}]}.deb"

  cd "${srcdir}/${_scf}"
  bsdtar -xf "${_scb}_${_cax[${CARCH}]}.deb"

  set +u
}

package() {
  set -u
  cd "${pkgdir}"

  bsdtar --no-same-owner -xf "${srcdir}/${_prf}"/data.tar.?z
  bsdtar --no-same-owner -xf "${srcdir}/${_scf}"/data.tar.?z
  # Move ppd file to where cups expects

  install -d 'usr/share/cups/'
  mv 'usr/share/ppd' 'usr/share/cups/model'

  # Install license files

  find 'usr/share/doc/' -name 'LICENSE*' -execdir install -Dpm644 '{}' -t "${pkgdir}/usr/share/licenses/${pkgname}/" ';'

  # Install entry in application menu, including icon

  install -Dpm644 "${srcdir}/${pkgname}-scangear.desktop" -t 'usr/share/applications/'
  install -Dpm644 "${srcdir}/${pkgname}-scangear-icon.png" -t 'usr/share/pixmaps/'

  # Mark shared libs executable

  find 'usr/lib' -name '*.so*' -exec chmod 755 '{}' '+'

  # Check for new models.
  if ! :; then
    grep -he '^*ModelName:' 'usr/share/cups/model'/*.ppd | sed -Ee 's:^[^"]+":# :g' -e 's:"$::g' | sort -u > "${startdir}/models.${pkgver}.txt"
    echo 'Checking supported models'
    diff -u <(tr ' ' '\n' <<<"${_pkgdesc2}")  <(awk '{print $3;}' "${startdir}/models.${pkgver}.txt") || :
  fi

  set +u
}
set +u