#Packager: Dimitris Tzemos pkgname=scangearmp-mg5300 pkgver=1.80 _pkgver=1.80-1 pkgrel=1dj source=(http://gdlp01.c-wss.com/gds/1/0100003931/01/scangearmp-source-${_pkgver}.tar.gz 'build-fixes.patch' "${pkgname}-icon.png" "${pkgname}.desktop") url="http://support-my.canon-asia.com/contents/MY/EN/0100393102.html" slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "Canon Scanner Driver (for MG5300 series)" ) build() { if [ "$arch" == "x86_64" ]; then libdir=libs_bin64 else libdir=libs_bin32 fi # Build fixes patch -p0 < build-fixes.patch || return 1 cd ${SRC}/scangearmp-source-${_pkgver}/scangearmp ./autogen.sh --prefix=/usr LDFLAGS="-L`pwd`/../com/${libdir} -lm" # Force the use of system's libtool rm -f libtool ln -s `which libtool` . # Build package make clean || return 1 make || return 1 # Install package install -d -m 0755 $PKG/usr/lib/bjlib make DESTDIR=${PKG} install # Install SANE configuration file install -d -m 0755 $PKG/etc/sane.d/ install -m 0644 ${SRC}/scangearmp-source-${_pkgver}/scangearmp/backend/canon_mfp.conf $PKG/etc/sane.d/canon_mfp.conf # Install common libraries install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/com/${libdir}/libcncpcmcm.so.8.0.1 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/com/${libdir}/libcncpmsimg.so.1.0.2 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/com/${libdir}/libcncpmslld.so.1.0.1 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/com/${libdir}/libcncpmsui.so.1.8.0 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/com/${libdir}/libcncpnet.so.1.2.2 ${PKG}/usr/lib/ # Install mg5300 series specific libraries install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/${libdir}/libcncpmsimg389.so.1.8.0 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/${libdir}/libcncpmslld389c.so.1.04.1 ${PKG}/usr/lib/ install -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/${libdir}/libcncpmslld389.so.1.8.0 ${PKG}/usr/lib/ # Create symbolic links cd ${PKG}/usr/lib/ ln -s libcncpcmcm.so.8.0.1 libcncpcmcm.so ln -s libcncpmsimg.so.1.0.2 libcncpmsimg.so ln -s libcncpmslld.so.1.0.1 libcncpmslld.so ln -s libcncpmsui.so.1.8.0 libcncpmsui.so ln -s libcncpnet.so.1.2.2 libcncpnet.so ln -s libcncpmsimg389.so.1.8.0 libcncpmsimg389.so ln -s libcncpmslld389c.so.1.04.1 libcncpmslld389c.so ln -s libcncpmslld389.so.1.8.0 libcncpmslld389.so # Make scangearmp usable from gimp install -d -m 0755 ${PKG}/usr/lib/gimp/2.0/plug-ins/ ln -s /usr/bin/scangearmp ${PKG}/usr/lib/gimp/2.0/plug-ins/ # Install .tbl and .dat files for mg5300 series install -D -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/cnc1754d.tbl ${PKG}/usr/lib/bjlib/ install -D -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/cnc_3890.tbl ${PKG}/usr/lib/bjlib/ install -D -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/CNC_389H.DAT ${PKG}/usr/lib/bjlib/ install -D -m 0755 ${SRC}/scangearmp-source-${_pkgver}/389/CNC_389P.DAT ${PKG}/usr/lib/bjlib/ # Install udev rules install -D -m 0644 ${SRC}/scangearmp-source-${_pkgver}/scangearmp/etc/80-canon_mfp.rules ${PKG}/etc/udev/rules.d/80-canon_mfp.rules # Install .ini file install -D -m 0666 ${SRC}/scangearmp-source-${_pkgver}/com/ini/canon_mfp_net.ini ${PKG}/usr/lib/bjlib/ # Install license file cd ${SRC}/scangearmp-source-${_pkgver} install -D LICENSE-scangearmp-${pkgver}EN.txt ${PKG}/usr/share/licenses/${pkgname}/LICENSE-scangearmp-${pkgver}EN.txt # Remove unneeded files rm ${PKG}/usr/lib/libsane-canon_mfp.a rm ${PKG}/usr/lib/libsane-canon_mfp.la # Install shortcut and icon install -D -m 644 ${SRC}/${pkgname}-icon.png ${PKG}/usr/share/pixmaps/${pkgname}-icon.png install -D -m 644 ${SRC}/${pkgname}.desktop ${PKG}/usr/share/applications/${pkgname}.desktop }