1 # Maintainer: Jonas Hörsch <coroa@online.de>
6 pkgdesc="Canon Scanner Driver (For PIXMA MP510 and possibly other Canon scanners)"
7 url="http://support-au.canon.com.au/contents/AU/EN/0900706603.html"
8 #url="http://software.canon-europe.com/software/0028482.asp"
11 depends=('sane' 'gtk2>=2.4.0' 'gimp>=2.0.0' 'libpng>=1.2.8' 'libusb>=0.1.12')
12 makedepends=('rpmextract' 'automake>=1.9.5' 'autoconf>=2.59')
13 source=("http://gdlp01.c-wss.com/gds/6/0900007066/02/${pkgname}-common-${pkgver}-2.src.rpm")
14 md5sums=('b2fcd29f2bb905df50c450a576657f01')
16 install=${pkgname}.install
20 rpmextract.sh "${pkgname}-common-${pkgver}-2.src.rpm" || return 1
21 tar xzf "${pkgname}-common-${pkgver}-2.tar.gz" || return 1
23 cd "${srcdir}/${pkgname}-common-${pkgver}"
25 install -d ${pkgdir}/usr/share/doc/${pkgname}
26 install -m644 LICENSE-scangearmp-1.00E.txt LICENSE-scangearmp-1.00J.txt ${pkgdir}/usr/share/doc/${pkgname}
27 install -m644 -D LICENSE-scangearmp-1.00E.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
31 echo Patching sane driver to use the right function names
32 sed -i -e 's|^//#define __USE_LIBSANE__$|#define __USE_LIBSANE__|' backend/canon_mfp.c
34 libtoolize --copy --force
35 ./autogen.sh --prefix=/usr --enable-libpath=/usr/lib LDFLAGS="-L$(pwd)/../libs_bin"
37 make DESTDIR="${pkgdir}/" install
39 install -d "${pkgdir}/etc/sane.d"
40 ln -sf "/usr/lib/bjlib/canon_mfp.conf" "${pkgdir}/etc/sane.d/canon_mfp.conf"
42 install -d "${pkgdir}/usr/lib/sane"
43 for i in ${pkgdir}/usr/lib/libsane-canon_mfp.*; do
44 ln -sf ${i#$pkgdir} ${pkgdir}/usr/lib/sane
47 install -m644 LICENSE README AUTHORS ChangeLog COPYING ${pkgdir}/usr/share/doc/${pkgname}
54 install -m755 "$i" "${pkgdir}/usr/lib"
55 ln -sf "/usr/lib/$i" "${pkgdir}/usr/lib/${i%.so.*}.so"
59 # copy *.tbl and *.dat
61 install -d "${pkgdir}/usr/lib/bjlib"
62 install -m0755 *.tbl *.dat "${pkgdir}/usr/lib/bjlib"
67 install -d "${pkgdir}/etc/udev/rules.d"
68 # SYSFS{} in rules files is obsolete
69 sed -i -e "s|SYSFS|ATTRS|g" etc/*.rules
70 install -m0644 etc/*.rules "${pkgdir}/etc/udev/rules.d"
73 # setup symlinks for gimp
74 GIMP2DIR1="/usr/lib/gimp/2.0/plug-ins"
75 GIMP2DIR2="/opt/gnome/lib/gimp/2.0/plug-ins"
77 if [ -d ${GIMP2DIR1} ]; then
78 install -d "${pkgdir}/${GIMP2DIR1}"
79 ln -sf /usr/bin/scangearmp "${pkgdir}/${GIMP2DIR1}/scangearmp"
80 elif [ -d ${GIMP2DIR2} ]; then
81 install -d "${pkgdir}/${GIMP2DIR2}"
82 ln -sf /usr/bin/scangearmp "${pkgdir}/${GIMP2DIR2}/scangearmp"
85 unset GIMP2DIR1 GIMP2DIR2