From 894bc8c4d400290db82696ad710b18ec64cac9d7 Mon Sep 17 00:00:00 2001 From: Shahab Vahedi Date: Fri, 2 Aug 2024 16:41:21 +0200 Subject: [PATCH 1/2] New package: brother-dcp8410-lpr-1.5.0 --- srcpkgs/brother-dcp8410-lpr/INSTALL | 4 + .../files/README.voidlinux | 5 + srcpkgs/brother-dcp8410-lpr/files/agree.html | 248 ++++++++++++++++++ .../patches/fix-setup-script.patch | 17 ++ srcpkgs/brother-dcp8410-lpr/template | 45 ++++ 5 files changed, 319 insertions(+) create mode 100644 srcpkgs/brother-dcp8410-lpr/INSTALL create mode 100644 srcpkgs/brother-dcp8410-lpr/files/README.voidlinux create mode 100644 srcpkgs/brother-dcp8410-lpr/files/agree.html create mode 100644 srcpkgs/brother-dcp8410-lpr/patches/fix-setup-script.patch create mode 100644 srcpkgs/brother-dcp8410-lpr/template diff --git a/srcpkgs/brother-dcp8410-lpr/INSTALL b/srcpkgs/brother-dcp8410-lpr/INSTALL new file mode 100644 index 00000000000000..b3bc10a08d1f8c --- /dev/null +++ b/srcpkgs/brother-dcp8410-lpr/INSTALL @@ -0,0 +1,4 @@ +case "${ACTION}" in +post) + mkdir -p var/spool/lpd +esac diff --git a/srcpkgs/brother-dcp8410-lpr/files/README.voidlinux b/srcpkgs/brother-dcp8410-lpr/files/README.voidlinux new file mode 100644 index 00000000000000..768afa57c17ac6 --- /dev/null +++ b/srcpkgs/brother-dcp8410-lpr/files/README.voidlinux @@ -0,0 +1,5 @@ +If you have attached the device through a USB interface, then run: +# /opt/brother/Printers/dcpl8410cdw/inf/setupPrintcapij dcpl8410cdw -i + +Also, before removing the package, you have to execute: +# /opt/brother/Printers/dcpl8410cdw/inf/setupPrintcapij dcpl8410cdw -e diff --git a/srcpkgs/brother-dcp8410-lpr/files/agree.html b/srcpkgs/brother-dcp8410-lpr/files/agree.html new file mode 100644 index 00000000000000..577f6b82035fa8 --- /dev/null +++ b/srcpkgs/brother-dcp8410-lpr/files/agree.html @@ -0,0 +1,248 @@ + + + +End-User License Agreement for Brother Software + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + + + + + +
License Agreement

This Agreement provides terms and conditions for license grant for use + of the software that is distributed with this Agreement ("Software") + from Brother Industries, Ltd. ("Brother") to recipients thereof + ("You").

+ + + + +
Note:
+ Please click on "I Accept" while holding down "Shift" or + right click on "I Accept" and select "Save Target As,,," from + the menu.
+
    +
  1. The Software is comprised of the following software modules:
    +
    + (1) Certain software modules that is the subject of GNU GENERAL PUBLIC + LICENSE ("GPL Modules"), and +
    + (2) Other software modules ("Non-GPL Modules") +
    +
    + You may distinguish each of GPL Modules by downloading source files + of the Software as Brother separately makes available and reading such + files.
    +
  2. +
  3. Your use of all GPL Modules shall be subject to the terms and conditions + of GNU GENERAL PUBLIC LICENSE Version 2, June 1991 ("GPLv2"). + Please see http://www.brother.com/agreement/English_gpl/agree.html. You + shall use GPL Modules in accordance with the terms and conditions of GPLv2. + Your use of GPL Modules shall be deemed + as your agreement to the terms and conditions of GPLv2.
    +
  4. +
  5. You have the right to use all Non-GPL Modules only in accordance with + the following terms and conditions. Your use of Non-GPL Modules shall be + deemed as your agreement to the following terms and conditions: +

    (1) Brother retains any and all copyrights to Non-GPL Modules. In no + case this Agreement shall be construed to assign or otherwise transfer + from Brother to you any copyrights or other intellectual property rights + to whole or any part of Non-GPL Modules.

    +

    (2) Brother grants you a non-exclusive license to reproduce and/or distribute + (via Internet or in any other manner) Non-GPL Modules. Brother further + grants you a non-exclusive license to modify, alter, translate or otherwise + prepare derivative works of Non-GPL Modules and to reproduce and/or distribute + (via Internet or in any other manner) such modification, alteration, + translation or other derivative works of Non-GPL Modules.

    +

    (3) When you distribute (via Internet or in any other manner) Non-GPL + Modules or any modification, alteration, translation or other derivative + works thereof under the license granted in accordance with subparagraph + 3(2) above, you must expressly grant any and all recipient thereof the + license equivalent to this Agreement which applies to Non-GPL Modules.

    +

    (4) The license of Non-GPL Modules from Brother hereunder is granted "AS + IS. BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO NON-GPL MODULES, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, + MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.

    +

    (5) To the extent allowed by applicable laws, Brother shall have no + liability in contract, tort (including negligence or breach of statutory + duty) or otherwise for any interruption of use, loss of data, or for + any indirect, incidental, punitive or consequential loss or damage, or + for any loss of profit, revenue, data, goodwill or anticipated savings + that arises under, out of, or in contemplation of this Agreement or otherwise + arises due to any error, inaccuracy or defect in Non-GPL Modules even + if Brother has been advised of the possibility of such loss or damage.

    +

    (6) The form in which Non-GPL Modules is distributed is subject to Brother’s + sole discretion. Brother does not have any obligation to distribute or + disclose Non-GPL Modules in source code form. In no case shall this Agreement + be deemed as Brother’s express or implied agreement to disclose source + code of Non-GPL Modules.

    +
  6. +
+ + diff --git a/srcpkgs/brother-dcp8410-lpr/patches/fix-setup-script.patch b/srcpkgs/brother-dcp8410-lpr/patches/fix-setup-script.patch new file mode 100644 index 00000000000000..09b116bdcc7cab --- /dev/null +++ b/srcpkgs/brother-dcp8410-lpr/patches/fix-setup-script.patch @@ -0,0 +1,17 @@ +Source: package maintainer +Upstream: no +Reason: There's no "lp" user on Void Linux + +--- a/opt/brother/Printers/dcpl8410cdw/inf/setupPrintcapij ++++ b/opt/brother/Printers/dcpl8410cdw/inf/setupPrintcapij +@@ -34,9 +34,8 @@ case "$2" in + if [ ! -d $SPOOLER_NAME ]; then + mkdir -p $SPOOLER_NAME + fi +- chown lp $SPOOLER_NAME + chgrp lp $SPOOLER_NAME +- chmod 700 $SPOOLER_NAME ++ chmod 770 $SPOOLER_NAME + + if [ "$3" = "USB" ]; then + DEVICE_IF=/dev/usb/lp0 diff --git a/srcpkgs/brother-dcp8410-lpr/template b/srcpkgs/brother-dcp8410-lpr/template new file mode 100644 index 00000000000000..c24f93bbeaf396 --- /dev/null +++ b/srcpkgs/brother-dcp8410-lpr/template @@ -0,0 +1,45 @@ +# Template file for 'brother-dcp8410-lpr' +pkgname=brother-dcp8410-lpr +version=1.5.0 +revision=1 +archs="i686 x86_64" +create_wrksrc=yes +depends="ghostscript" +short_desc="LPR driver for the Brother DCP-L8410CDW machines" +maintainer="Shahab Vahedi " +license="custom:EULA" +homepage="https://support.brother.com/g/b/producttop.aspx?c=eu_ot&lang=en&prod=dcpl8410cdw_eu" +distfiles="https://download.brother.com/welcome/dlf103239/dcpl8410cdwlpr-${version}-0.i386.deb" +checksum="1e97cd530e7b6162bf436d16e94098e524b438fdecf0a8044c5e07efa9300080" +repository="nonfree" +conf_files="/opt/brother/Printers/dcpl8410cdw/inf/brdcpl8410cdwrc" +nopie=yes + +do_install() { + vmkdir opt/brother/Printers/dcpl8410cdw/lpd 755 + + vcopy opt/brother/Printers/dcpl8410cdw/inf opt/brother/Printers/dcpl8410cdw + vinstall opt/brother/Printers/dcpl8410cdw/lpd/filter_dcpl8410cdw \ + 755 opt/brother/Printers/dcpl8410cdw/lpd + + # Copy the executables based on architecture type + if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then + _arch="x86_64" + elif [ "$XBPS_TARGET_MACHINE" = "i686" ]; then + _arch="i686" + else + _arch="unknown" + fi + for bin in brdcpl8410cdwfilter brprintconf_dcpl8410cdw; do + vinstall opt/brother/Printers/dcpl8410cdw/lpd/x86_64/${bin} \ + 755 opt/brother/Printers/dcpl8410cdw/lpd/ + done + + vmkdir usr/bin 755 + ln -sf /opt/brother/Printers/dcpl8410cdw/lpd/brprintconf_dcpl8410cdw \ + ${DESTDIR}/usr/bin/brprintconf_dcpl8410cdw + + vlicense ${FILESDIR}/agree.html LICENSE.html + + vdoc "${FILESDIR}/README.voidlinux" +} From f516a3cd94451ddb064c76d64ed07ee0a60a9e39 Mon Sep 17 00:00:00 2001 From: Shahab Vahedi Date: Fri, 2 Aug 2024 16:41:50 +0200 Subject: [PATCH 2/2] New package: brother-dcp8410-cups-1.5.0 --- srcpkgs/brother-dcp8410-cups/INSTALL | 6 + srcpkgs/brother-dcp8410-cups/REMOVE | 5 + srcpkgs/brother-dcp8410-cups/files/agree.html | 248 ++++++++++++++++++ .../files/cupswrapperdcpl8410cdw.void | 152 +++++++++++ srcpkgs/brother-dcp8410-cups/template | 37 +++ 5 files changed, 448 insertions(+) create mode 100644 srcpkgs/brother-dcp8410-cups/INSTALL create mode 100644 srcpkgs/brother-dcp8410-cups/REMOVE create mode 100644 srcpkgs/brother-dcp8410-cups/files/agree.html create mode 100755 srcpkgs/brother-dcp8410-cups/files/cupswrapperdcpl8410cdw.void create mode 100644 srcpkgs/brother-dcp8410-cups/template diff --git a/srcpkgs/brother-dcp8410-cups/INSTALL b/srcpkgs/brother-dcp8410-cups/INSTALL new file mode 100644 index 00000000000000..3f342471bd0f92 --- /dev/null +++ b/srcpkgs/brother-dcp8410-cups/INSTALL @@ -0,0 +1,6 @@ +case "${ACTION}" in +post) + [ -d /var/service/cupsd ] && sv restart cupsd + ;; +esac + diff --git a/srcpkgs/brother-dcp8410-cups/REMOVE b/srcpkgs/brother-dcp8410-cups/REMOVE new file mode 100644 index 00000000000000..1515570c7f7835 --- /dev/null +++ b/srcpkgs/brother-dcp8410-cups/REMOVE @@ -0,0 +1,5 @@ +case ${ACTION} in +post) + [ -d /var/service/cupsd ] && sv restart cupsd + ;; +esac diff --git a/srcpkgs/brother-dcp8410-cups/files/agree.html b/srcpkgs/brother-dcp8410-cups/files/agree.html new file mode 100644 index 00000000000000..577f6b82035fa8 --- /dev/null +++ b/srcpkgs/brother-dcp8410-cups/files/agree.html @@ -0,0 +1,248 @@ + + + +End-User License Agreement for Brother Software + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + + + + + +
License Agreement

This Agreement provides terms and conditions for license grant for use + of the software that is distributed with this Agreement ("Software") + from Brother Industries, Ltd. ("Brother") to recipients thereof + ("You").

+ + + + +
Note:
+ Please click on "I Accept" while holding down "Shift" or + right click on "I Accept" and select "Save Target As,,," from + the menu.
+
    +
  1. The Software is comprised of the following software modules:
    +
    + (1) Certain software modules that is the subject of GNU GENERAL PUBLIC + LICENSE ("GPL Modules"), and +
    + (2) Other software modules ("Non-GPL Modules") +
    +
    + You may distinguish each of GPL Modules by downloading source files + of the Software as Brother separately makes available and reading such + files.
    +
  2. +
  3. Your use of all GPL Modules shall be subject to the terms and conditions + of GNU GENERAL PUBLIC LICENSE Version 2, June 1991 ("GPLv2"). + Please see http://www.brother.com/agreement/English_gpl/agree.html. You + shall use GPL Modules in accordance with the terms and conditions of GPLv2. + Your use of GPL Modules shall be deemed + as your agreement to the terms and conditions of GPLv2.
    +
  4. +
  5. You have the right to use all Non-GPL Modules only in accordance with + the following terms and conditions. Your use of Non-GPL Modules shall be + deemed as your agreement to the following terms and conditions: +

    (1) Brother retains any and all copyrights to Non-GPL Modules. In no + case this Agreement shall be construed to assign or otherwise transfer + from Brother to you any copyrights or other intellectual property rights + to whole or any part of Non-GPL Modules.

    +

    (2) Brother grants you a non-exclusive license to reproduce and/or distribute + (via Internet or in any other manner) Non-GPL Modules. Brother further + grants you a non-exclusive license to modify, alter, translate or otherwise + prepare derivative works of Non-GPL Modules and to reproduce and/or distribute + (via Internet or in any other manner) such modification, alteration, + translation or other derivative works of Non-GPL Modules.

    +

    (3) When you distribute (via Internet or in any other manner) Non-GPL + Modules or any modification, alteration, translation or other derivative + works thereof under the license granted in accordance with subparagraph + 3(2) above, you must expressly grant any and all recipient thereof the + license equivalent to this Agreement which applies to Non-GPL Modules.

    +

    (4) The license of Non-GPL Modules from Brother hereunder is granted "AS + IS. BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO NON-GPL MODULES, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, + MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.

    +

    (5) To the extent allowed by applicable laws, Brother shall have no + liability in contract, tort (including negligence or breach of statutory + duty) or otherwise for any interruption of use, loss of data, or for + any indirect, incidental, punitive or consequential loss or damage, or + for any loss of profit, revenue, data, goodwill or anticipated savings + that arises under, out of, or in contemplation of this Agreement or otherwise + arises due to any error, inaccuracy or defect in Non-GPL Modules even + if Brother has been advised of the possibility of such loss or damage.

    +

    (6) The form in which Non-GPL Modules is distributed is subject to Brother’s + sole discretion. Brother does not have any obligation to distribute or + disclose Non-GPL Modules in source code form. In no case shall this Agreement + be deemed as Brother’s express or implied agreement to disclose source + code of Non-GPL Modules.

    +
  6. +
+ + diff --git a/srcpkgs/brother-dcp8410-cups/files/cupswrapperdcpl8410cdw.void b/srcpkgs/brother-dcp8410-cups/files/cupswrapperdcpl8410cdw.void new file mode 100755 index 00000000000000..5ec8b25520e1ad --- /dev/null +++ b/srcpkgs/brother-dcp8410-cups/files/cupswrapperdcpl8410cdw.void @@ -0,0 +1,152 @@ +#! /bin/sh +# +# Brother Print filter +# Copyright (C) 2005-2016 Brother. Industries, Ltd. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA +# + +# This is trimmed down and tailored for brother-dcpl8410cdw-cupswrapper +# package of Void Linux + +printer_model="dcpl8410cdw" +printer_name="DCPL8410CDW" # uppercase of $printer_model +device_name="DCP-L8410CDW" # $printer_name with a hyphen after {MFC,DCP,HL} +inst_path="/opt/brother/Printers/${printer_model}" +lpdwrapper="$inst_path/cupswrapper/brother_lpdwrapper_${printer_model}" +ppd_file_name=/usr/share/cups/model/Brother/brother_${printer_model}_printer_en.ppd +brotherlpdwrapper=/usr/lib/cups/filter/brother_lpdwrapper_${printer_model} + +if [ -d "/usr/share/cups/model" ] +then + mkdir -p /usr/share/cups/model/Brother +fi + +# Eliminate +if [ "$1" = '-e' ] +then + lpadmin -x ${printer_name} + rm -f "$ppd_file" + rm -f "$brotherlpdwrapper" + rm -f "$lpdwrapper" + sv restart cupsd + exit 0 +fi + +# Restart +if [ "$1" = "-r" ] +then + lpadmin -x ${printer_name} + sv restart cupsd + exit 0 +fi + +if [ "$1" = "help" ] || [ "$1" = "-h" ] +then + echo 'option -h : help' + echo ' -i : install' + echo ' -e : uninstall' + echo ' -r : remove printer' + exit 0 +fi + +# +# The rest is "install" +# + +if [ -e "$inst_path/lpd/filter_${printer_model}" ] +then + : +else + echo "ERROR : Brother LPD filter is not installed." +fi +rm -f $ppd_file_name + +src_ppd="$inst_path/cupswrapper/brother_${printer_model}_printer_en.ppd" +if [ -e "$src_ppd" ] +then + cp "$src_ppd" $ppd_file_name +fi +chmod 644 $ppd_file_name + +# +# check /usr/lib/cups/filter +# +if [ -d /usr/lib/cups/filter ] +then + rm -f $brotherlpdwrapper + ln -s $lpdwrapper $brotherlpdwrapper +fi + +sv restart cupsd + +sleep 2s + +uris=$(lpinfo -v) + +for uri in $uris +do + URI=$(echo $uri | grep ${device_name} | grep usb) + if [ "$URI" != '' ] + then + break; + fi +done + +if [ "$URI" = '' ] +then + for uri in $uris + do + URI=$(echo $uri | grep ${device_name} ) + if [ "$URI" != '' ] + then + break; + fi + done +fi + +if [ "$URI" = '' ] +then + for uri in $uris + do + URI=$(echo $uri | grep -i Brother | grep usb ) + if [ "$URI" != '' ] + then + break; + fi + done +fi + +if [ "$URI" = '' ] +then + for uri in $uris + do + URI=$(echo $uri | grep usb) + if [ "$URI" != '' ] + then + break; + fi + done +fi + +if [ "$URI" = '' ] +then + URI="usb://dev/usb/lp0" +fi + +echo lpadmin -p ${printer_name} -E -v $URI -P $ppd_file_name +lpadmin -p ${printer_name} -E -v $URI -P $ppd_file_name + +exit 0 diff --git a/srcpkgs/brother-dcp8410-cups/template b/srcpkgs/brother-dcp8410-cups/template new file mode 100644 index 00000000000000..e3d0026dd07a15 --- /dev/null +++ b/srcpkgs/brother-dcp8410-cups/template @@ -0,0 +1,37 @@ +# Template file for 'brother-dcp8410-cups' +pkgname=brother-dcp8410-cups +version=1.5.0 +revision=1 +archs="i686 x86_64" +create_wrksrc=yes +depends="brother-dcp8410-lpr cups cups-filters" +short_desc="CUPS wrapper driver for the Brother DCP-L8410CDW machines" +maintainer="Shahab Vahedi " +license="custom:EULA" +homepage="https://support.brother.com/g/b/producttop.aspx?c=eu_ot&lang=en&prod=dcpl8410cdw_eu" +distfiles="https://download.brother.com/welcome/dlf103248/dcpl8410cdwcupswrapper-${version}-0.i386.deb" +checksum="b9deb04a6b8f7dd800e04cd90dcd3fa6129214bf36d63649b1710915fd8b549a" +repository="nonfree" + +do_install() { + vmkdir opt/brother/Printers/dcpl8410cdw/cupswrapper 755 + + vinstall opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_dcpl8410cdw_printer_en.ppd \ + 644 opt/brother/Printers/dcpl8410cdw/cupswrapper + vinstall opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_lpdwrapper_dcpl8410cdw \ + 755 opt/brother/Printers/dcpl8410cdw/cupswrapper + vinstall ${FILESDIR}/cupswrapperdcpl8410cdw.void \ + 755 opt/brother/Printers/dcpl8410cdw/cupswrapper + + # Copy the PPD file to its rightful place + vmkdir usr/share/cups/model/Brother 755 + vinstall opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_dcpl8410cdw_printer_en.ppd \ + 644 usr/share/cups/model/Brother + + # Create a link to lpdwrapper in CUPS filter directory + vmkdir usr/lib/cups/filter 755 + ln -sf /opt/brother/Printers/dcpl8410cdw/cupswrapper/brother_lpdwrapper_dcpl8410cdw \ + ${DESTDIR}/usr/lib/cups/filter/brother_lpdwrapper_dcpl8410cdw + + vlicense ${FILESDIR}/agree.html LICENSE.html +}