From ac341228496b92b984ce9d61615ec0df8305e516 Mon Sep 17 00:00:00 2001 From: El Christianito Date: Fri, 11 Jun 2021 18:52:32 +0200 Subject: [PATCH 1/3] Add brother-brgenml1 templates --- .../files/brother_lpdwrapper_BrGenML1.patch | 42 +++++++++++++++++++ srcpkgs/brother-brgenml1-cupswrapper/template | 37 ++++++++++++++++ srcpkgs/brother-brgenml1-lpr/INSTALL | 7 ++++ .../files/brprintconflsr3_BrGenML1 | 2 + srcpkgs/brother-brgenml1-lpr/template | 38 +++++++++++++++++ 5 files changed, 126 insertions(+) create mode 100755 srcpkgs/brother-brgenml1-cupswrapper/files/brother_lpdwrapper_BrGenML1.patch create mode 100755 srcpkgs/brother-brgenml1-cupswrapper/template create mode 100755 srcpkgs/brother-brgenml1-lpr/INSTALL create mode 100755 srcpkgs/brother-brgenml1-lpr/files/brprintconflsr3_BrGenML1 create mode 100755 srcpkgs/brother-brgenml1-lpr/template diff --git a/srcpkgs/brother-brgenml1-cupswrapper/files/brother_lpdwrapper_BrGenML1.patch b/srcpkgs/brother-brgenml1-cupswrapper/files/brother_lpdwrapper_BrGenML1.patch new file mode 100755 index 000000000000..0726eec6fd20 --- /dev/null +++ b/srcpkgs/brother-brgenml1-cupswrapper/files/brother_lpdwrapper_BrGenML1.patch @@ -0,0 +1,42 @@ +--- /home/tmp/portage/net-print/brother-mfc7460dn-bin-3.1.0-r1/work/opt/brother/Printers/BrGenML1/cupswrapper/brother_lpdwrapper_BrGenML1 2014-05-14 00:36:11.000000000 -0400 ++++ /opt/brother/Printers/BrGenML1/cupswrapper/brother_lpdwrapper_BrGenML1 2014-10-07 19:35:40.899637092 -0400 +@@ -50,8 +50,9 @@ + } + chomp($basedir); + +-$basedir =~ s/$PRINTER\/cupswrapper\/.*$/$PRINTER\//g; +- ++#$basedir =~ s/$PRINTER\/cupswrapper\/.*$/$PRINTER\//g; ++my $PRINTER = "BrGenML1"; ++my $basedir = "/opt/brother/Printers/$PRINTER"; + + %units = ( pt => \&pt2dot, + mm => \&mm2dot, +@@ -77,16 +78,16 @@ + + my $cmdoptions=$ARGV[4]; + my $PPD = $ENV{PPD}; +-my $PRINTER=$basedir; ++#my $PRINTER=$basedir; + my $CUPSINPUT=''; + if ( @ARGV >= 6 ){ + $CUPSINPUT=$ARGV[7]; + } + + +-$PRINTER =~ s/^\/opt\/.*\/Printers\///g; +-$PRINTER =~ s/\/cupswrapper//g; +-$PRINTER =~ s/\///g; ++#$PRINTER =~ s/^\/opt\/.*\/Printers\///g; ++#$PRINTER =~ s/\/cupswrapper//g; ++#$PRINTER =~ s/\///g; + + for (my $i = 0 ; $i < @ARGV ; $i ++){ + logprint( 0 , "ARG$i = $ARGV[$i]\n"); +@@ -733,7 +734,7 @@ + my $lpddir = $basedir; + my %lpr_options = %$lpr_options_ref; + +- $lpddir = $basedir."/lpd/"; ++ $lpddir = $basedir."/lpd"; + my $lpdconf = $lpddir.'/'.$LPDCONFIGEXE; diff --git a/srcpkgs/brother-brgenml1-cupswrapper/template b/srcpkgs/brother-brgenml1-cupswrapper/template new file mode 100755 index 000000000000..2e508e87e35f --- /dev/null +++ b/srcpkgs/brother-brgenml1-cupswrapper/template @@ -0,0 +1,37 @@ +# Template file for 'brother-brgenml1-cupswrapper' +pkgname=brother-brgenml1-cupswrapper +version=3.1.0 +revision=1 +archs="i686 x86_64" +create_wrksrc=yes +hostmakedepends="rpmextract" +makedepends="cups" +depends="brother-brgenml1-lpr cups cups-filters" +short_desc="CUPS wrapper driver for the brother BrGenML1 printer/scanner" +maintainer="El Christianito " +license="GPL-2.0" +homepage="http://support.brother.com/g/b/index.aspx" +distfiles="https://download.brother.com/welcome/dlf101126/brgenml1cupswrapper-${version}-1.i386.rpm" +checksum="397cb2d91e0748f4c0498d831647efbc62af9e02f576ad52dc520bcac876f795" +nopie=yes +patch_args="-Np1" +_brotherdrivername="BrGenML1" + +if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then + depends+=" glibc-32bit libusb-32bit libusb-compat-32bit" +fi + +do_extract() { + rpmextract ${XBPS_SRCDISTDIR}/${pkgname}-${version}/brgenml1cupswrapper-${version}-1.i386.rpm +} + +do_install() { + vmkdir opt/brother/Printers/ 755 + vcopy opt/brother/Printers/* opt/brother/Printers + + vmkdir usr/share/cups/model/ 755 + ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother-${_brotherdrivername}-cups-en.ppd ${DESTDIR}/usr/share/cups/model/brother-${_brotherdrivername}-cups-en.ppd + + vmkdir usr/lib/cups/filter/ 755 + ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother_lpdwrapper_${_brotherdrivername} ${DESTDIR}/usr/lib/cups/filter/brother_lpdwrapper_${_brotherdrivername} +} \ No newline at end of file diff --git a/srcpkgs/brother-brgenml1-lpr/INSTALL b/srcpkgs/brother-brgenml1-lpr/INSTALL new file mode 100755 index 000000000000..5f8c2e0c07a5 --- /dev/null +++ b/srcpkgs/brother-brgenml1-lpr/INSTALL @@ -0,0 +1,7 @@ +case "${ACTION}" in + post) + mkdir -p var/spool/lpd + opt/brother/Printers/BrGenML1/inf/setupPrintcap BrGenML1 -i + ;; +esac + diff --git a/srcpkgs/brother-brgenml1-lpr/files/brprintconflsr3_BrGenML1 b/srcpkgs/brother-brgenml1-lpr/files/brprintconflsr3_BrGenML1 new file mode 100755 index 000000000000..95ebeb6d9d11 --- /dev/null +++ b/srcpkgs/brother-brgenml1-lpr/files/brprintconflsr3_BrGenML1 @@ -0,0 +1,2 @@ +#! /bin/sh +/opt/brother/Printers/BrGenML1/lpd/brprintconflsr3 -P BrGenML1 $* \ No newline at end of file diff --git a/srcpkgs/brother-brgenml1-lpr/template b/srcpkgs/brother-brgenml1-lpr/template new file mode 100755 index 000000000000..4af0c499af31 --- /dev/null +++ b/srcpkgs/brother-brgenml1-lpr/template @@ -0,0 +1,38 @@ +# Template file for 'brother-brgenml1-lpr' +pkgname=brother-brgenml1-lpr +version=3.1.0 +revision=1 +archs="i686 x86_64" +create_wrksrc=yes +hostmakedepends="rpmextract" +depends="a2ps ghostscript" +short_desc="LPR driver for the brother BrGenML1 printer/scanner" +maintainer="El Christianito Date: Fri, 11 Jun 2021 19:11:46 +0200 Subject: [PATCH 2/3] Add license, fix linting issues --- srcpkgs/brother-brgenml1-cupswrapper/template | 18 +++++++------- srcpkgs/brother-brgenml1-lpr/files/LICENSE | 9 +++++++ srcpkgs/brother-brgenml1-lpr/template | 24 +++++++++++-------- 3 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 srcpkgs/brother-brgenml1-lpr/files/LICENSE diff --git a/srcpkgs/brother-brgenml1-cupswrapper/template b/srcpkgs/brother-brgenml1-cupswrapper/template index 2e508e87e35f..ff8dc1ac252c 100755 --- a/srcpkgs/brother-brgenml1-cupswrapper/template +++ b/srcpkgs/brother-brgenml1-cupswrapper/template @@ -9,7 +9,7 @@ makedepends="cups" depends="brother-brgenml1-lpr cups cups-filters" short_desc="CUPS wrapper driver for the brother BrGenML1 printer/scanner" maintainer="El Christianito " -license="GPL-2.0" +license="GPL-2.0-only" homepage="http://support.brother.com/g/b/index.aspx" distfiles="https://download.brother.com/welcome/dlf101126/brgenml1cupswrapper-${version}-1.i386.rpm" checksum="397cb2d91e0748f4c0498d831647efbc62af9e02f576ad52dc520bcac876f795" @@ -26,12 +26,12 @@ do_extract() { } do_install() { - vmkdir opt/brother/Printers/ 755 - vcopy opt/brother/Printers/* opt/brother/Printers + vmkdir opt/brother/Printers/ 755 + vcopy opt/brother/Printers/* opt/brother/Printers - vmkdir usr/share/cups/model/ 755 - ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother-${_brotherdrivername}-cups-en.ppd ${DESTDIR}/usr/share/cups/model/brother-${_brotherdrivername}-cups-en.ppd - - vmkdir usr/lib/cups/filter/ 755 - ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother_lpdwrapper_${_brotherdrivername} ${DESTDIR}/usr/lib/cups/filter/brother_lpdwrapper_${_brotherdrivername} -} \ No newline at end of file + vmkdir usr/share/cups/model/ 755 + ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother-${_brotherdrivername}-cups-en.ppd ${DESTDIR}/usr/share/cups/model/brother-${_brotherdrivername}-cups-en.ppd + + vmkdir usr/lib/cups/filter/ 755 + ln -s /opt/brother/Printers/${_brotherdrivername}/cupswrapper/brother_lpdwrapper_${_brotherdrivername} ${DESTDIR}/usr/lib/cups/filter/brother_lpdwrapper_${_brotherdrivername} +} diff --git a/srcpkgs/brother-brgenml1-lpr/files/LICENSE b/srcpkgs/brother-brgenml1-lpr/files/LICENSE new file mode 100644 index 000000000000..a2af9db7dee7 --- /dev/null +++ b/srcpkgs/brother-brgenml1-lpr/files/LICENSE @@ -0,0 +1,9 @@ +License Agreement + +This Agreement provides terms and conditions for license grant from Brother Industries, Ltd ("Brother"). Brother, who owns all copyrights to the software that is distributed with this Agreement ("Software") to recipients thereof ("User"), for use of the Software. User shall have the right to use the Software only in accordance with the terms and conditions of this Agreement. Any use by User of the Software shall be deemed as its agreement hereto. + +Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software. + +Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose. + +The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT. 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 the Software even if Brother has been advised of the possibility of such loss or damage. Further, Brother shall have no liability to disclose and/or distribute the source code of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source code of the Software. diff --git a/srcpkgs/brother-brgenml1-lpr/template b/srcpkgs/brother-brgenml1-lpr/template index 4af0c499af31..b9c45600d0dc 100755 --- a/srcpkgs/brother-brgenml1-lpr/template +++ b/srcpkgs/brother-brgenml1-lpr/template @@ -7,7 +7,7 @@ create_wrksrc=yes hostmakedepends="rpmextract" depends="a2ps ghostscript" short_desc="LPR driver for the brother BrGenML1 printer/scanner" -maintainer="El Christianito Date: Fri, 11 Jun 2021 19:27:21 +0200 Subject: [PATCH 3/3] Add lib32mode, move to nonfree repo --- srcpkgs/brother-brgenml1-cupswrapper/template | 2 ++ srcpkgs/brother-brgenml1-lpr/template | 2 ++ 2 files changed, 4 insertions(+) diff --git a/srcpkgs/brother-brgenml1-cupswrapper/template b/srcpkgs/brother-brgenml1-cupswrapper/template index ff8dc1ac252c..6da44277f59d 100755 --- a/srcpkgs/brother-brgenml1-cupswrapper/template +++ b/srcpkgs/brother-brgenml1-cupswrapper/template @@ -13,6 +13,8 @@ license="GPL-2.0-only" homepage="http://support.brother.com/g/b/index.aspx" distfiles="https://download.brother.com/welcome/dlf101126/brgenml1cupswrapper-${version}-1.i386.rpm" checksum="397cb2d91e0748f4c0498d831647efbc62af9e02f576ad52dc520bcac876f795" +lib32mode="full" +repository="nonfree" nopie=yes patch_args="-Np1" _brotherdrivername="BrGenML1" diff --git a/srcpkgs/brother-brgenml1-lpr/template b/srcpkgs/brother-brgenml1-lpr/template index b9c45600d0dc..387bed571fbe 100755 --- a/srcpkgs/brother-brgenml1-lpr/template +++ b/srcpkgs/brother-brgenml1-lpr/template @@ -12,6 +12,8 @@ license="custom:Proprietary" homepage="http://support.brother.com/g/b/index.aspx" distfiles="https://download.brother.com/welcome/dlf101124/brgenml1lpr-${version}-1.i386.rpm" checksum="18823eb345e4e4391d7a6a3a1d442a96b2224e12a0600542f0d3d700cf158706" +lib32mode="full" +repository="nonfree" nopie=yes system_accounts="lp" _brotherdrivername="BrGenML1"