summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeinrich Siebmanns2015-06-18 09:35:52 +0200
committerHeinrich Siebmanns2015-06-18 09:35:52 +0200
commit1d9f9513c8ef2b5f5075d45268c8a2219a73a817 (patch)
tree558ac003f3b8c9739e15a0d10fdceb0b95117187
downloadaur-1d9f9513c8ef2b5f5075d45268c8a2219a73a817.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD39
-rwxr-xr-xbrscan4.install46
-rwxr-xr-xmk-udev-rules16
4 files changed, 122 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..a8feedb90eb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = brscan4
+ pkgdesc = SANE drivers from Brother for brscan4 compatible models
+ pkgver = 0.4.3_0
+ pkgrel = 5
+ url = http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_scn.html
+ install = brscan4.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = custom:Brother
+ depends = sane
+ depends = libusb-compat
+ source = http://download.brother.com/welcome/dlf006647/brscan4-0.4.3-0.i386.rpm
+ source = http://www.brother.com/agreement/English_sane/agree.html
+ source = mk-udev-rules
+ md5sums = d12d79fa08aaac5fdf5fdc85a5d380d2
+ md5sums = ccffb9a6f6d436b21be25b0241068981
+ md5sums = 9e0cf3931ce740494559f87644610c1b
+
+pkgname = brscan4
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6fe22fbfac1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Harvey <harv@gmx.de>
+license=('GPL' 'custom:Brother')
+arch=('i686' 'x86_64')
+pkgname=brscan4
+pkgver=0.4.3_0
+pkgrel=5
+pkgdesc="SANE drivers from Brother for brscan4 compatible models"
+depends=('sane' 'libusb-compat')
+url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_scn.html"
+install=brscan4.install
+
+[ "$CARCH" = "x86_64" ] && pkg="dlf006648/${pkgname}-${pkgver/_/-}.x86_64.rpm" || pkg="dlf006647/${pkgname}-${pkgver/_/-}.i386.rpm"
+[ "$CARCH" = "x86_64" ] && pkg_md5sum="b15962f7694c1bd9cb7e2ec35c553480" || pkg_md5sum="d12d79fa08aaac5fdf5fdc85a5d380d2"
+
+source=("http://download.brother.com/welcome/$pkg"
+ "http://www.brother.com/agreement/English_sane/agree.html"
+ mk-udev-rules)
+md5sums=($pkg_md5sum
+ 'ccffb9a6f6d436b21be25b0241068981'
+ '9e0cf3931ce740494559f87644610c1b')
+
+build() {
+ cd "$srcdir"
+ umask 022
+ mkdir -p etc/udev/rules.d
+ ./mk-udev-rules opt/brother/scanner/brscan4/{Brsane4.ini,models4/*.ini} > etc/udev/rules.d/$pkgname.rules
+}
+
+package() {
+ cp -r $srcdir/etc $pkgdir
+ cp -r $srcdir/opt $pkgdir
+ cp -r $srcdir/usr $pkgdir
+ install -D -m644 $srcdir/agree.html $pkgdir/usr/share/licenses/$pkgname/LICENSE.html
+ [ "$CARCH" = "x86_64" ] && mv $pkgdir/usr/lib64 $pkgdir/usr/lib
+ # move the links to the right direction
+ cd $pkgdir/usr/lib/sane
+ ln -sf libsane-brother4.so.1.0.7 $pkgdir/usr/lib/sane/libsane-brother4.so.1
+ ln -sf libsane-brother4.so.1 $pkgdir/usr/lib/sane/libsane-brother4.so
+}
diff --git a/brscan4.install b/brscan4.install
new file mode 100755
index 00000000000..3936d2a8df1
--- /dev/null
+++ b/brscan4.install
@@ -0,0 +1,46 @@
+# new package version
+devices_file="/opt/brother/scanner/brscan4/brsanenetdevice4.cfg"
+
+pre_install() {
+ /bin/true
+}
+
+# new package version
+post_install() {
+ echo "Find additional documentation about scanner driver install at:"
+ echo "http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_scn1.html"
+ echo "For a network installation run the following as root:"
+ echo "brsaneconfig4 -a name=\"Brother\" model=\"YOURMODELHERE\" ip=YOUR.SCANNER.IP.HERE"
+ /opt/brother/scanner/brscan4/setupSaneScan4 -i
+}
+
+# the new package version
+# old package version
+pre_upgrade() {
+ # If user has already configured their scanner then make a config backup
+ if [ -f $devices_file ]; then
+ cp $devices_file $devices_file.backup || return 1
+ fi
+}
+
+# new package version
+# old package version
+post_upgrade() {
+ # After upgrade revert user's scanner config and delete a config backup
+ if [ -f $devices_file.backup ]; then
+ cp $devices_file.backup $devices_file || return 1
+ rm $devices_file.backup || return 1
+ fi
+}
+
+# old package version
+pre_remove() {
+ /opt/brother/scanner/brscan4/setupSaneScan4 -e
+ /bin/true
+}
+
+# old package version
+post_remove() {
+ /bin/true
+}
+
diff --git a/mk-udev-rules b/mk-udev-rules
new file mode 100755
index 00000000000..951ba28b9ad
--- /dev/null
+++ b/mk-udev-rules
@@ -0,0 +1,16 @@
+#!/usr/bin/gawk -f
+BEGIN {
+ FS = ",";
+ print "ACTION==\"add\", ATTR{idVendor}==\"04f9\", GOTO=\"brscan4\"";
+ print "GOTO=\"brscan4_end\"";
+ print "LABEL=\"brscan4\"";
+}
+NF >= 3 && $1 ~ /^ *0[xX][[:xdigit:]]+ *$/ {
+ id = "000" tolower( substr( $1, 3 ));
+ id = substr( id, length( id ) - 3 );
+ print "ATTR{idProduct}==\"" id "\", MODE=\"0664\", GROUP=\"scanner\", ENV{libsane_matched}=\"yes\"";
+}
+END {
+ print "LABEL=\"brscan4_end\"";
+}
+