summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2018-02-14 22:53:14 -0500
committerChris Severance2018-02-14 22:53:14 -0500
commite21bca1bbbb85286c15725f8e4867d205bf41b68 (patch)
treeb28b1bd30b57790ba13d10d13d0d042c40524fbe
downloadaur-e21bca1bbbb85286c15725f8e4867d205bf41b68.tar.gz
Initial Import
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD124
-rw-r--r--lpr-license.txt11
3 files changed, 166 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..47915971dc22
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+# Generated by mksrcinfo v8
+# Thu Feb 15 03:53:03 UTC 2018
+pkgbase = brother-mfc-j6935dw
+ pkgdesc = LPR and CUPS driver for the Brother MFC-J6935DW printer
+ pkgver = 1.0.1_0
+ pkgrel = 1
+ url = http://www.brother.com/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = custom
+ depends = cups
+ depends = ghostscript
+ depends = psutils
+ depends = sed
+ depends = grep
+ depends = perl
+ depends = file
+ optdepends = ttf-dejavu: printing text files from lpr
+ optdepends = brscan4: Scanner support
+ source = http://download.brother.com/welcome/dlf103034/mfcj6935dwcupswrapper-1.0.1-0.i386.rpm
+ source = http://download.brother.com/welcome/dlf103010/mfcj6935dwlpr-1.0.1-0.i386.rpm
+ source = lpr-license.txt
+ sha256sums = 9fedc880605dd9be74669f815468fc9d71b26fb8ff9f57291f9642e5e6e1afa6
+ sha256sums = 8f2321e529a6c8474f888a77bd2921cc16b19eae538c9752692316221a0600c5
+ sha256sums = b604def129534d245fa576f8cd7d01df1d2856b9bff6c1d2002404f77f7d4bb3
+ depends_x86_64 = lib32-glibc
+ depends_x86_64 = lib32-gcc-libs
+
+pkgname = brother-mfc-j6935dw
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a25ca86dec71
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,124 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+
+# The cups binary is 64 bit. Until Brother releases source for the 32 bit lpr
+# binary blobs, 64 bit users must enable multilib.
+
+# This has not been tested with non cups lprng.
+
+# NOTE 1: Remember to add user to lp group using
+# gpasswd -a USER lp
+# NOTE 2: Remember to logout after adding groups
+# NOTE 3: Set each printer default Media Size to Letter with
+# lpadmin -p BR7360 -o media=Letter
+
+set -u
+_brotheru='MFC-J6935DW'
+_brotherl="${_brotheru,,}" # mfc-0000dw
+_brotherlnd="${_brotherl//-/}" # mfc0000dw
+_brotherund="${_brotheru//-/}" # MFC0000DW
+pkgname="brother-${_brotherl}"
+pkgver='1.0.1_0'
+pkgrel='1'
+pkgdesc="LPR and CUPS driver for the Brother ${_brotheru} printer"
+arch=('i686' 'x86_64')
+url='http://www.brother.com/'
+license=('GPL' 'custom')
+depends=('cups' 'ghostscript' 'psutils' 'sed' 'grep' 'perl' 'file')
+depends_x86_64=('lib32-glibc' 'lib32-gcc-libs')
+# We look at the scripts and find these programs from which we decide on the depends above.
+# gs: lpr rendering
+# pdf2ps: cups rendering
+# (not) a2ps: rendering ascii text files
+# (not) pstops: pdf resizing
+# (not) psnup: printing n-up pages
+# sed grep awk
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670055
+# Printing a text file fails when Liberation is the only TrueType font available
+# perl: cupswrapper
+optdepends=(
+ 'ttf-dejavu: printing text files from lpr'
+ 'brscan4: Scanner support'
+)
+_brsource="brother_${_brotherlnd}_GPL_source_${pkgver//_/-}"
+#_dlf='http://www.brother.com/pub/bsc/linux/dlf'
+source=(
+ "http://download.brother.com/welcome/dlf103034/${_brotherlnd}cupswrapper-${pkgver//_/-}.i386.rpm"
+ "http://download.brother.com/welcome/dlf103010/${_brotherlnd}lpr-${pkgver//_/-}.i386.rpm"
+ 'lpr-license.txt' # Obtained from web download page
+)
+sha256sums=('9fedc880605dd9be74669f815468fc9d71b26fb8ff9f57291f9642e5e6e1afa6'
+ '8f2321e529a6c8474f888a77bd2921cc16b19eae538c9752692316221a0600c5'
+ 'b604def129534d245fa576f8cd7d01df1d2856b9bff6c1d2002404f77f7d4bb3')
+
+prepare() {
+ set -u
+ # setup cups-directories
+ install -dm755 "${srcdir}/usr/lib/cups/filter"
+ install -dm755 "${srcdir}/usr/share/cups/model"
+ #install -dm755 "${srcdir}/usr/share/ppd" # For cups we don't need the ppd file here.
+
+ # Some Brother installers create files here
+ mkdir -p "${srcdir}/var/tmp"
+
+ local _wrapper_source="${srcdir}/opt/brother/Printers/${_brotherlnd}/cupswrapper/cupswrapper${_brotherlnd}"
+ #cp -p "${_wrapper_source}" "${_wrapper_source}.Arch" # debug: diff compare with Total Commander
+ sed -e '# Install to _srcdir. Some folders may not apply to this model.' \
+ -e 's:/usr:"${_srcdir}"&:g' \
+ -e 's:/opt:"${_srcdir}"&:g' \
+ -e 's:/var:"${_srcdir}"&:g' \
+ -e 's:/etc:"${_srcdir}"&:g' \
+ -e 's:""${_srcdir}":"${_srcdir}:g' \
+ -e "# Stop the Install script after the files are generated. cups doesn't require a reload to see the printer driver." \
+ -e 's:^sleep.*$:exit 0 # & #Arch Linux Compatible:g' \
+ -e '# not using set -u allows bugs like this to slip by' \
+ -e '#/Nup=/ s:`:\\`:g' \
+ -e 's: $errorcode: \\$errorcode:g' \
+ -e '# This printer requires the permissions fix that isnt multi user compatible.' \
+ -e 's:/usr/local/Brother:/usr/share/brother:g' \
+ -e '# Fix symlinks' \
+ -e 's:brotherlpdwrapper="\${_srcdir}":brotherlpdwrapper=:g' \
+ -i "${_wrapper_source}"
+ grep -lq "#Arch Linux Compatible$" "${_wrapper_source}" || echo "${}"
+ test -f "${_wrapper_source}.Arch" && echo "${}" # Halt for debugging
+ # Generate PPD and wrapper. Use sh -x to debug
+ # Possible bug: copying to /usr/share/ppd is disabled.
+ _srcdir="${srcdir}" \
+ sh -u -e "${_wrapper_source}" -i
+ find "${srcdir}" -type 'f' -name '*.ppd' -exec chmod 644 '{}' '+' # Some installers make ppd executable
+ rm -rf "${srcdir}/var"
+
+ # We did everything in the installer so we can get rid of it.
+ rm "${_wrapper_source}"
+
+ cd "${srcdir}"
+ # Misnamed printer does not sort or autodetect properly
+ #sed -e "s:Brother ${_brotherund} :Brother ${_brotheru} :g" -i 'usr/share/cups/model'/*.ppd
+ set +u
+}
+
+package() {
+ set -u
+ local _dir
+ # /var/spool is not used anywhere in this package. Maybe it's needed for non cups lprng.
+ for _dir in 'usr' 'opt'; do # 'var'
+ if [ -d "${srcdir}/${_dir}" ]; then
+ cp -pR "${srcdir}/${_dir}" "${pkgdir}"
+ fi
+ done
+
+ # /etc/printcap is managed by cups. This eliminates any need for a printcap helper.
+ find "${pkgdir}" -type 'f' -name 'setupPrintcap*' -exec rm '{}' '+'
+
+ # Ensure we got a ppd and a filter for CUPS
+ test "$(find "${pkgdir}/usr/share/cups/model" -type f -name '*.ppd')"
+ test "$(find "${pkgdir}/usr/lib/cups/filter/" '(' -type f -o -type l ')')"
+
+ # Ensure there are no forbidden paths
+ ! grep -alqr "/sbin" "${pkgdir}" || echo "${}"
+ ! grep -alqr "/usr/tmp" "${pkgdir}" || echo "${}"
+
+ #install -Dpm644 <(sed -e 's:\r::g' "${_brsource}/Copying") "${pkgdir}/usr/share/licenses/${pkgname}/cupswrapper-licence.txt"
+ install -Dpm644 'lpr-license.txt' "${pkgdir}/usr/share/licenses/${pkgname}/lpr-licence.txt"
+ set +u
+}
+set +u
diff --git a/lpr-license.txt b/lpr-license.txt
new file mode 100644
index 000000000000..f573d4d0f82a
--- /dev/null
+++ b/lpr-license.txt
@@ -0,0 +1,11 @@
+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.
+Note:
+Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu.
+
+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.