summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d48bb0104b24a7d9dbb63d10cd98c6c04783a804 (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
# Maintainer: Ethan Pailes <ethan at pailes dot org>
#
# Based on PKGBUILD for https://aur.archlinux.org/packages/canon-pixma-mg2200-complete
# That example shows how to add support for a scanner driver as well if desired.
#

pkgname=canon-tr8600-series
pkgver=6.10
pkgrel=1
pkgdesc="Printer drivers for the Cannon 8620 series"
url='https://www.usa.canon.com/internet/portal/us/home/support/details/printers/inkjet-multifunction/tr-series-inkjet/pixma-tr8620?tab=drivers_downloads'
arch=('x86_64')
license=('custom')
# N.B. this is an AUR package, so you'll need to manually install it
makedepends=('deb2targz') # 'sed')

if [ ${CARCH} = 'x86_64' ]; then
  depends=('popt' 'libpng12' 'libusb-compat' 'libtiff' 'libxml2' 'gtk2')
fi

source=(
    'https://gdlp01.c-wss.com/gds/9/0100010919/01/cnijfilter2-6.10-1-deb.tar.gz'
)
md5sums=(
    '75ee391fc452b53b6016be9d03d95715'
)

_ppdFiles="canontr8600.ppd canontr8630.ppd "
_printDrvSrc='cnijfilter2-6.10-1-deb'
_printDrvDebCommon='cnijfilter2_6.10-1_amd64'

build() {
    cd ${srcdir}

    tar xvzf ${_printDrvSrc}.tar.gz

    rm -v *.tar.gz
}

package() {
   cd ${pkgdir}

   cp "${srcdir}/${_printDrvSrc}/packages/${_printDrvDebCommon}.deb" .

   # convert from .deb to tarball
   deb2targz "${_printDrvDebCommon}.deb"
   rm -v *.deb

   # unpack tarball
   tar xzvf "${_printDrvDebCommon}.tar.gz"
   rm -v *.tar.gz

   # install ppd file
   for file in ${_ppdFiles}
   do
       install -vDm 644 "${pkgdir}/usr/share/ppd/${file}" "${pkgdir}/usr/share/cups/model/${file}"
   done
   rm -vrf ${pkgdir}/usr/share/ppd

   # install licence
   install -vDm 644 "${srcdir}/${_printDrvSrc}/documents/LICENSE-cnijfilter-6.10EN.txt" \
       "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

   rm -vrf ${pkgdir}/usr/share/ppd
}