change to udev-hwdb like sane did

This commit is contained in:
Harvey committed 2021-04-14 12:33:58 +02:00
1 parent f72e24d82e
commit 24bbe17a27
4 files changed
+25 -28

No files matched your search

+3 -4
View File
@@ -1,7 +1,7 @@
pkgbase = brscan4
pkgdesc = SANE drivers from Brother for brscan4 compatible models
pkgver = 0.4.10_1
pkgrel = 3
pkgrel = 4
url = http://support.brother.com
install = brscan4.install
arch = i686
@@ -10,13 +10,12 @@ pkgbase = brscan4
license = custom:Brother
depends = sane
depends = libusb-compat
depends = acl
source = https://download.brother.com/welcome/dlf006648/brscan4-0.4.10-1.x86_64.rpm
source = agree.html
source = mk-udev-rules
source = mk-udev-hwdb
md5sums = f4c4d1f214d4c42a6d40f5451fc40312
md5sums = ccffb9a6f6d436b21be25b0241068981
md5sums = 43c64803cb0fc37093146583719cb543
md5sums = 4a69fac9c0053277a9be8e2dd382f168
pkgname = brscan4
+7 -8
View File
@@ -3,9 +3,9 @@ license=('GPL' 'custom:Brother')
arch=('i686' 'x86_64')
pkgname=brscan4
pkgver=0.4.10_1
pkgrel=3
pkgrel=4
pkgdesc="SANE drivers from Brother for brscan4 compatible models"
depends=('sane' 'libusb-compat' 'acl')
depends=('sane' 'libusb-compat')
url="http://support.brother.com"
install=brscan4.install
@@ -14,24 +14,23 @@ install=brscan4.install
source=("https://download.brother.com/welcome/$pkg"
"agree.html"
mk-udev-rules)
mk-udev-hwdb)
md5sums=($pkg_md5sum
'ccffb9a6f6d436b21be25b0241068981'
'43c64803cb0fc37093146583719cb543')
'4a69fac9c0053277a9be8e2dd382f168')
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/40-$pkgname.rules
./mk-udev-hwdb opt/brother/scanner/brscan4/{Brsane4.ini,models4/*.ini} > hwdb
}
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
install -D -m644 $srcdir/agree.html $pkgdir/usr/share/licenses/$pkgname/LICENSE.html
install -D -m644 $srcdir/hwdb $pkgdir/usr/lib/udev/hwdb.d/20-$pkgname.hwdb
# 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
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/gawk -f
BEGIN {
FS = ",";
print "# brscan4-supported scanners (or interfaces of MFD)";
print "";
}
NF >= 3 && $1 ~ /^0[xX][[:xdigit:]]{4}$/ {
id = tolower( substr( $1, 3 ));
name = $4
gsub("\"", "", name)
print "# " name;
print "usb:v04f9p" id "*";
print " libsane_matched=yes";
print "";
}
-16
View File
@@ -1,16 +0,0 @@
#!/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 "\", ENV{libsane_matched}=\"yes\", RUN+=\"/usr/bin/setfacl -m g:scanner:rw /dev/$name\"";
}
END {
print "LABEL=\"brscan4_end\"";
}