summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLopo2015-06-17 20:09:37 +0200
committerLopo2015-06-17 20:09:37 +0200
commita09575f58f7751013a0aa3a8bd1a83cf4e9a1970 (patch)
tree32971b11c54dd13f37473fca86e07f6c314195d8
downloadaur-a09575f58f7751013a0aa3a8bd1a83cf4e9a1970.tar.gz
Initial import
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD101
-rw-r--r--configures.patch18
-rw-r--r--fix_scanfile.patch21
4 files changed, 163 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..23b9d8f7b8a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = scangearmp-mg6200
+ pkgdesc = Canon Scanner Driver (for mg6200 series)
+ pkgver = 1.80
+ pkgrel = 2
+ url = http://support-au.canon.com.au/contents/AU/EN/0100393102.html
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = findutils
+ makedepends = grep
+ makedepends = gawk
+ depends = sane
+ depends = gtk2
+ depends = libpng>=1.2.8
+ source = http://gdlp01.c-wss.com/gds/1/0100003931/01/scangearmp-source-1.80-1.tar.gz
+ source = fix_scanfile.patch
+ source = configures.patch
+ md5sums = 88e3891918357304a9f527d043b435d2
+ md5sums = 13df0530aaf3283490e09427070311a8
+ md5sums = 356b6bfbd8577f3fc19d1044605fdbad
+
+pkgname = scangearmp-mg6200
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..063bc13ebff
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,101 @@
+# Maintainer: Pavol Hluchy (Lopo) <lopo at losys dot eu>
+_model=mg6200
+pkgname=scangearmp-${_model}
+pkgver=1.80
+pkgrel=2
+_pkgver=1.80-1
+pkgdesc="Canon Scanner Driver (for ${_model} series)"
+url="http://support-au.canon.com.au/contents/AU/EN/0100393102.html"
+arch=('i686' 'x86_64')
+license=('custom')
+depends=('sane' 'gtk2' 'libpng>=1.2.8')
+makedepends=('findutils' 'grep' 'gawk')
+source=("http://gdlp01.c-wss.com/gds/1/0100003931/01/scangearmp-source-${_pkgver}.tar.gz"
+ 'fix_scanfile.patch'
+ 'configures.patch')
+md5sums=('88e3891918357304a9f527d043b435d2'
+ '13df0530aaf3283490e09427070311a8'
+ '356b6bfbd8577f3fc19d1044605fdbad')
+
+_getmodelid() {
+ echo `grep ^PRINTER_DEPEND_PKG=scangearmp-${_model}- ${srcdir}/scangearmp-source-${_pkgver}/debian/scangearmp-${_model}series.postrm \
+ | gawk -F- '{print $3}'`
+}
+
+_getlibdir() {
+ if [ "$CARCH" == "x86_64" ]; then
+ echo libs_bin64
+ else
+ echo libs_bin32
+ fi
+}
+
+build() {
+
+ # Apply patch
+ cd ${srcdir}/scangearmp-source-${_pkgver}
+ patch -p1 -i ${srcdir}/fix_scanfile.patch
+ patch -p1 -i ${srcdir}/configures.patch
+
+ cd ${srcdir}/scangearmp-source-${_pkgver}/scangearmp
+ ./autogen.sh --prefix=/usr LDFLAGS="-L`pwd`/../com/${libdir}" LIBS=-lm
+ # Force the use of system's libtool
+ rm libtool
+ ln -s `which libtool` .
+ # Build package
+ make clean || return 1
+ make || return 1
+}
+
+package() {
+ _modelid=$(_getmodelid)
+ libdir=$(_getlibdir)
+
+ # Install package
+ cd ${srcdir}/scangearmp-source-${_pkgver}/scangearmp
+ make install DESTDIR=${pkgdir} || return 1
+
+ # Install SANE configuration file
+ install -d -m 0755 ${pkgdir}/etc/sane.d/
+ install -m 0644 ${srcdir}/scangearmp-source-${_pkgver}/scangearmp/backend/canon_mfp.conf ${pkgdir}/etc/sane.d/canon_mfp.conf
+
+ #Install common libraries
+ for _l in cmcm msimg mslld msui net; do
+ install -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/com/${libdir}/libcncp${_l}.so.*.*.* ${pkgdir}/usr/lib/
+ done
+ # Install ${_model} series specific libraries
+ install -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/${_modelid}/${libdir}/libcncpmsimg${_modelid}.so.*.*.* ${pkgdir}/usr/lib/
+ install -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/${_modelid}/${libdir}/libcncpmslld${_modelid}c.so.*.*.* ${pkgdir}/usr/lib/
+ install -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/${_modelid}/${libdir}/libcncpmslld${_modelid}.so.*.*.* ${pkgdir}/usr/lib/
+ # Create symbolic links
+ cd ${pkgdir}/usr/lib/
+ for _l in cmcm msimg mslld msui net; do
+ ln -s libcncp${_l}.so.*.*.* libcncp${_l}.so
+ done
+ ln -s libcncpmsimg${_modelid}.so.*.*.* libcncpmsimg${_modelid}.so
+ ln -s libcncpmslld${_modelid}c.so.*.*.* libcncpmslld${_modelid}c.so
+ ln -s libcncpmslld${_modelid}.so.*.*.* libcncpmslld${_modelid}.so
+
+ # Make scangearmp usable from gimp
+ install -d -m 0755 ${pkgdir}/usr/lib/gimp/2.0/plug-ins/
+ ln -s /usr/bin/scangearmp ${pkgdir}/usr/lib/gimp/2.0/plug-ins/
+
+ # Install .tbl and .dat files for ${_model} series
+ install -d -m 0755 ${pkgdir}/usr/lib/bjlib
+ install -D -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/${_modelid}/cnc*.tbl ${pkgdir}/usr/lib/bjlib/
+ install -D -m 0755 ${srcdir}/scangearmp-source-${_pkgver}/${_modelid}/CNC*.DAT ${pkgdir}/usr/lib/bjlib/
+
+ # Install udev rules
+ install -D -m 0644 ${srcdir}/scangearmp-source-${_pkgver}/scangearmp/etc/80-canon_mfp.rules ${pkgdir}/etc/udev/rules.d/80-canon_mfp.rules
+
+ # Install .ini file
+ install -D -m 0666 ${srcdir}/scangearmp-source-${_pkgver}/com/ini/canon_mfp_net.ini ${pkgdir}/usr/lib/bjlib/
+
+ # Install license file
+ cd ${srcdir}/scangearmp-source-${_pkgver}
+ install -D LICENSE-scangearmp-${pkgver}EN.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-scangearmp-${pkgver}EN.txt
+
+ # Remove unneeded files
+ rm ${pkgdir}/usr/lib/libsane-canon_mfp.a
+ rm ${pkgdir}/usr/lib/libsane-canon_mfp.la
+}
diff --git a/configures.patch b/configures.patch
new file mode 100644
index 00000000000..886ee1fb902
--- /dev/null
+++ b/configures.patch
@@ -0,0 +1,18 @@
+diff -Naur old/scangearmp/configure.in new/scangearmp/configure.in
+--- old/scangearmp/configure.in 2011-02-14 07:19:36.000000000 +0100
++++ new/scangearmp/configure.in 2013-03-19 13:40:10.453796600 +0100
+@@ -21,14 +21,12 @@
+ AC_SUBST(enable_libpath)
+
+ AM_INIT_AUTOMAKE(scangearmp, 1.80-1)
+-AM_CONFIG_HEADER(config.h)
+ AM_PROG_LIBTOOL
+ AC_PROG_LIBTOOL
+ AM_MAINTAINER_MODE
+
+ AC_ISC_POSIX
+ AC_PROG_CC
+-AM_PROG_CC_STDC
+ AC_HEADER_STDC
+ AC_PROG_RANLIB
+
diff --git a/fix_scanfile.patch b/fix_scanfile.patch
new file mode 100644
index 00000000000..f5f83b4c3aa
--- /dev/null
+++ b/fix_scanfile.patch
@@ -0,0 +1,21 @@
+diff -Naur old/scangearmp/src/scanfile.c new/scangearmp/src/scanfile.c
+--- old/scangearmp/src/scanfile.c 2011-02-14 07:19:36.000000000 +0100
++++ new/scangearmp/src/scanfile.c 2012-03-20 13:28:55.000000000 +0100
+@@ -44,6 +44,7 @@
+ #include "progress_bar.h"
+ #include "raw2pdf.h"
+ #include "scanmsg.h"
++#include "zlib.h"
+
+ #define GRAY2MONO_BK (0)
+ #define GRAY2MONO_GRAY (1)
+@@ -386,7 +387,8 @@
+
+ void write_data_for_png( png_structp png_ptr, png_bytep data, png_size_t length )
+ {
+- FileControlWriteFile( *( (int *)png_ptr->io_ptr ), (CNMSLPSTR)data, length );
++ voidp write_io_ptr = png_get_io_ptr(png_ptr);
++ FileControlWriteFile( write_io_ptr, (CNMSLPSTR)data, length );
+
+ return;
+ }