From aa01538bf361c56cf94d2e2c6e0f30c6d13e168c Mon Sep 17 00:00:00 2001 From: Alexandru Barbur Date: Fri, 2 Jun 2023 19:57:38 -0400 Subject: [PATCH] New package: brother-brscan5-1.2.12 --- srcpkgs/brother-brscan5/INSTALL | 9 ++++ srcpkgs/brother-brscan5/INSTALL.msg | 2 + srcpkgs/brother-brscan5/REMOVE | 7 +++ srcpkgs/brother-brscan5/template | 68 +++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 srcpkgs/brother-brscan5/INSTALL create mode 100644 srcpkgs/brother-brscan5/INSTALL.msg create mode 100644 srcpkgs/brother-brscan5/REMOVE create mode 100644 srcpkgs/brother-brscan5/template diff --git a/srcpkgs/brother-brscan5/INSTALL b/srcpkgs/brother-brscan5/INSTALL new file mode 100644 index 000000000000..2e917d6143b7 --- /dev/null +++ b/srcpkgs/brother-brscan5/INSTALL @@ -0,0 +1,9 @@ +case "${ACTION}" in + post) + # Add brother driver to sane configuration + _SANE_CONF='/etc/sane.d/dll.conf' + if [ "$(grep brother5 ${_SANE_CONF})" = '' ]; then + echo brother5 >> ${_SANE_CONF} + fi; + ;; +esac diff --git a/srcpkgs/brother-brscan5/INSTALL.msg b/srcpkgs/brother-brscan5/INSTALL.msg new file mode 100644 index 000000000000..e83ad9d6e31b --- /dev/null +++ b/srcpkgs/brother-brscan5/INSTALL.msg @@ -0,0 +1,2 @@ +In order to access networked scanners and multifunctionals, the SANE backend +must be configured using 'brsaneconfig5'. diff --git a/srcpkgs/brother-brscan5/REMOVE b/srcpkgs/brother-brscan5/REMOVE new file mode 100644 index 000000000000..b762f8954ee6 --- /dev/null +++ b/srcpkgs/brother-brscan5/REMOVE @@ -0,0 +1,7 @@ +case "${ACTION}" in + pre) + # remove brother driver from sane configuration + _SANE_CONF='/etc/sane.d/dll.conf' + sed -i -e '/brother5/d' ${_SANE_CONF} + ;; +esac diff --git a/srcpkgs/brother-brscan5/template b/srcpkgs/brother-brscan5/template new file mode 100644 index 000000000000..e0f59a54c0af --- /dev/null +++ b/srcpkgs/brother-brscan5/template @@ -0,0 +1,68 @@ +# Template file for 'brother-brscan5' +pkgname=brother-brscan5 +version=1.2.12 +revision=1 +archs="i686 x86_64" +depends="sane libusb-compat" +short_desc="SANE scanner driver for brscan5-compatible printers" +maintainer="Alexandru Barbur " +license="custom:EULA" +homepage="https://support.brother.com/" +repository="nonfree" +nopie=yes +conf_files="/etc/opt/brother/scanner/brscan5/brscan5.ini + /etc/opt/brother/scanner/brscan5/brsanenetdevice.cfg + /opt/brother/scanner/brscan5/models/*.ini" + +_sane_library="libsane-brother5.so.1.0.7" +_pkg_libraries="libLxBsScanCoreApi.so.3.2.0 + libLxBsNetDevAccs.so.1.0.0 + libLxBsDeviceAccs.so.1.0.0 + libLxBsUsbDevAccs.so.1.0.0" + +if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then + _rpmpkgid="0.x86_64" + distfiles="https://download.brother.com/welcome/dlf104036/brscan5-${version}-${_rpmpkgid}.rpm" + checksum="b40ef093be58d298e4429d8c5d4b7ecb48db58b64a5a01c203c9325c14997b47" + _rpmlibdir="usr/lib64" +else + _rpmpkgid="0.i386" + distfiles="https://download.brother.com/welcome/dlf104035/brscan5-${version}-${_rpmpkgid}.rpm" + checksum="7e98f36494e4145c9192067519fe8a0b105eb54ec9ba8ce6474bfc2882f07e67" + _rpmlibdir="usr/lib" +fi + +do_install() { + # based heavily on: + # brother-brscan4 void package: https://github.com/void-linux/void-packages/tree/master/srcpkgs/brother-brscan4 + # brother-brscan5 AUR package: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=brscan5 + + vinstall opt/brother/scanner/brscan5/${_sane_library} 755 usr/lib/sane + ln -sf /usr/lib/sane/${_sane_library} ${DESTDIR}/usr/lib/sane/$(echo ${_sane_library} | sed -e 's/\.[0-9]\.[0-9]$//') + ln -sf /usr/lib/sane/${_sane_library} ${DESTDIR}/usr/lib/sane/$(echo ${_sane_library} | sed -e 's/\.[0-9]\.[0-9]\.[0-9]$//') + + for library in $_pkg_libraries; do + vinstall opt/brother/scanner/brscan5/${library} 755 usr/lib + ln -sf /usr/lib/${library} ${DESTDIR}/usr/lib/$(echo ${library} | sed -e 's/\.[0-9]\.[0-9]$//') + ln -sf /usr/lib/${library} ${DESTDIR}/usr/lib/$(echo ${library} | sed -e 's/\.[0-9]\.[0-9]\.[0-9]$//') + done + + pushd opt/brother/scanner/brscan5/udev-rules + sed '/SYSFS/d' NN-brother-mfp-brscan5-1.0.2-2.rules > 40-brother-mfp-brscan5-1.0.2-2.rules + vinstall 40-brother-mfp-brscan5-1.0.2-2.rules 644 usr/lib/udev/rules.d + popd + + # note: configuration file locations are hard-coded in libsane-brother5.so + vmkdir etc/opt/brother/scanner/brscan5 755 + vinstall opt/brother/scanner/brscan5/brscan5.ini 644 etc/opt/brother/scanner/brscan5 + vinstall opt/brother/scanner/brscan5/brsanenetdevice.cfg 644 etc/opt/brother/scanner/brscan5 + + vmkdir opt/brother/scanner/brscan5 755 + vcopy opt/brother/scanner/brscan5/models opt/brother/scanner/brscan5 + + vlicense opt/brother/scanner/brscan5/doc/LICENSE_ENG.txt + vlicense opt/brother/scanner/brscan5/doc/LICENSE_JPN.txt + vlicense opt/brother/scanner/brscan5/doc/readme.txt # Independent JPEG blurb. + + vbin opt/brother/scanner/brscan5/brsaneconfig5 +}