aboutsummaryrefslogtreecommitdiff
path: root/system/brother-dcp8410-cups
diff options
context:
space:
mode:
authorShahab Vahedi <list+sbo@vahedi.org>2024-11-16 09:00:09 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-16 09:39:28 +0700
commitea7dad4e648cadc19eb3c7915c597cf938718dfe (patch)
tree6fec693ddb3b9b567ef308b0fb009e268a203ccd /system/brother-dcp8410-cups
parentf5afa518d29c6342af9c3829228a5ea88c80b8a1 (diff)
system/brother-dcp8410-cups: Added (DCP-L8410CDW).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/brother-dcp8410-cups')
-rw-r--r--system/brother-dcp8410-cups/README24
-rw-r--r--system/brother-dcp8410-cups/brother-dcp8410-cups.SlackBuild107
-rw-r--r--system/brother-dcp8410-cups/brother-dcp8410-cups.info10
-rw-r--r--system/brother-dcp8410-cups/doinst.sh10
-rw-r--r--system/brother-dcp8410-cups/douninst.sh7
-rw-r--r--system/brother-dcp8410-cups/slack-desc19
6 files changed, 177 insertions, 0 deletions
diff --git a/system/brother-dcp8410-cups/README b/system/brother-dcp8410-cups/README
new file mode 100644
index 0000000000000..6d8ee7d578789
--- /dev/null
+++ b/system/brother-dcp8410-cups/README
@@ -0,0 +1,24 @@
+This provides the PPD (Postscript Printer Description) driver for
+Brother DCP-L8410CDW printer and is needed by CUPS to support it.
+This is merely a repackaging of the official "deb" package.
+
+You can check if the PPD is installed correctly by:
+$ lpinfo -m | grep 8410
+ Brother/brother_dcpl8410cdw_printer_en.ppd Brother DCP-L8410CDW CUPS
+
+To add the printer to CUPS, first its URI must be retrieved:
+$ lpinfo -v
+ ...
+ network lpd://BRWD0123456789A/BINARY_P1
+
+And eventually, the printer can be added to CUPS by:
+# lpadmin \
+ -p mybrother \ # name
+ -L "Valhalla" \ # location
+ -D "The Almighty Printer" \ # description
+ -E \ # enable
+ -v lpd://BRWD0123456789A/BINARY_P1 \ # device URI
+ -P /usr/share/cups/model/brother_dcpl8410cdw_printer_en.ppd
+
+Later, it may be removed with:
+# lpadmin -x mybrother
diff --git a/system/brother-dcp8410-cups/brother-dcp8410-cups.SlackBuild b/system/brother-dcp8410-cups/brother-dcp8410-cups.SlackBuild
new file mode 100644
index 0000000000000..baf5f97630b14
--- /dev/null
+++ b/system/brother-dcp8410-cups/brother-dcp8410-cups.SlackBuild
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+# Slackware build script for brother-dcp8410-lpr
+
+# Copyright 2024 Shahab Vahedi, NL
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=brother-dcp8410-cups
+VERSION=${VERSION:-1.5.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ ARCH=noarch
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $PKG
+ar p $CWD/dcpl8410cdwcupswrapper-${VERSION}-*.deb data.tar.gz | tar xvz
+
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+INST_OPT=opt/brother/Printers/dcpl8410cdw/cupswrapper
+
+# The goal is to populate the files in the following manner:
+#
+# /usr/share/cups/model/brother_dcpl8410cdw_printer_en.ppd --> ...
+# ... --link-to--> /$INST_OPT/brother_dcpl8410cdw_printer_en.ppd
+# /usr/lib${LIBDIRSUFFIX}/cups/filter/brother_lpdwrapper_dcpl8410cdw --> ...
+# ... --link-to--> /$INST_OPT/brother_lpdwrapper_dcpl8410cdw
+#
+# Creating a symlink to "brother_lpdwrapper_dcpl8410cdw" is utterly
+# important. If we were to copy the lpdwrapper to CUPS filter directory
+# instead of creating a symlink, the printing functionality would not
+# work. Evidently, the actual lpdwrapper uses relative paths to access
+# the LPR driver files installed by brother-dcp8410-lpr:
+#
+# /opt/brother/Printers/dcpl8410cdw/
+# |-- cupswrapper/
+# | |-- brother_dcpl8410cdw_printer_en.ppd
+# | `-- brother_lpdwrapper_dcpl8410cdw <-- The LPD wrapper
+# |-- lpd/ <-- LPD driver dir
+# | |-- brdcpl8410cdwfilter
+# | |-- brprintconf_dcpl8410cdw
+# | `-- filter_dcpl8410cdw
+# `-- inf/
+# `-- ...
+#
+# For what it's worth, I've opted to also create a symlink to
+# "$INST_OPT/brother_dcpl8410cdw_printer_en.ppd" instead of putting
+# the file in /usr/share/cups/model/ directory. Because that directory
+# is owned by CUPS package and not this one.
+chmod 644 $INST_OPT/brother_dcpl8410cdw_printer_en.ppd
+# The link creation parts are done through the doinst.sh script.
+
+# The "cupswrapperdcpl8410cdw" script is poorly written and is not worth
+# hacking to make it work. Instead, notify user of the necessary actions
+# to take through the README doc.
+rm "$INST_OPT/cupswrapperdcpl8410cdw"
+
+mkdir -p usr/doc/$PRGNAM-$VERSION
+cat $CWD/README > usr/doc/$PRGNAM-$VERSION/README.maintainer
+cat $CWD/$PRGNAM.SlackBuild > usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p install
+cat $CWD/slack-desc > install/slack-desc
+cat $CWD/doinst.sh > install/doinst.sh
+cat $CWD/douninst.sh > install/douninst.sh
+
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/brother-dcp8410-cups/brother-dcp8410-cups.info b/system/brother-dcp8410-cups/brother-dcp8410-cups.info
new file mode 100644
index 0000000000000..465e40b207764
--- /dev/null
+++ b/system/brother-dcp8410-cups/brother-dcp8410-cups.info
@@ -0,0 +1,10 @@
+PRGNAM="brother-dcp8410-cups"
+VERSION="1.5.0"
+HOMEPAGE="https://support.brother.com/g/b/producttop.aspx?c=eu_ot&lang=en&prod=dcpl8410cdw_eu"
+DOWNLOAD="https://download.brother.com/welcome/dlf103248/dcpl8410cdwcupswrapper-1.5.0-0.i386.deb"
+MD5SUM="efc8971290459402de7950dee79c4d23"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="brother-dcp8410-lpr"
+MAINTAINER="Shahab Vahedi"
+EMAIL="list+sbo@vahedi.org"
diff --git a/system/brother-dcp8410-cups/doinst.sh b/system/brother-dcp8410-cups/doinst.sh
new file mode 100644
index 0000000000000..0c943946dba90
--- /dev/null
+++ b/system/brother-dcp8410-cups/doinst.sh
@@ -0,0 +1,10 @@
+case "$( uname -m )" in
+ x86_64|aarch64) LIBDIRSUFFIX="64" ;;
+ *) LIBDIRSUFFIX="" ;;
+esac
+
+( cd /usr/lib${LIBDIRSUFFIX}/cups/filter && rm -rf brother_lpdwrapper_dcpl8410cdw )
+( cd /usr/lib${LIBDIRSUFFIX}/cups/filter && ln -sf /opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_lpdwrapper_dcpl8410cdw )
+
+( cd usr/share/cups/model && rm -rf brother_dcpl8410cdw_printer_en.ppd )
+( cd usr/share/cups/model && ln -sf /opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_dcpl8410cdw_printer_en.ppd )
diff --git a/system/brother-dcp8410-cups/douninst.sh b/system/brother-dcp8410-cups/douninst.sh
new file mode 100644
index 0000000000000..e0699baa0db4b
--- /dev/null
+++ b/system/brother-dcp8410-cups/douninst.sh
@@ -0,0 +1,7 @@
+case "$( uname -m )" in
+ x86_64|aarch64) LIBDIRSUFFIX="64" ;;
+ *) LIBDIRSUFFIX="" ;;
+esac
+
+( cd /usr/lib${LIBDIRSUFFIX}/cups/filter && unlink brother_lpdwrapper_dcpl8410cdw )
+( cd /usr/share/cups/model && unlink brother_dcpl8410cdw_printer_en.ppd )
diff --git a/system/brother-dcp8410-cups/slack-desc b/system/brother-dcp8410-cups/slack-desc
new file mode 100644
index 0000000000000..cc0a91e0bb3a0
--- /dev/null
+++ b/system/brother-dcp8410-cups/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+brother-dcp8410-cups: brother-dcp8410-cups (CUPS wrapper)
+brother-dcp8410-cups:
+brother-dcp8410-cups: CUPS support for Brother laser printer DCP-L8410CDW.
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups:
+brother-dcp8410-cups: