summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2018-12-09 03:49:41 -0500
committerChris Severance2018-12-09 03:49:41 -0500
commitaf595ebbdb414191b8bb862b7781ee9d64f63eac (patch)
tree1a0925a533276267e1cb4578dbe099a38fb0f787
parent43eb0a3cf8383c38c17b8eef3c1726c281470b57 (diff)
downloadaur-brother-mfc-j5720dw.tar.gz
autu: Update to 3.0.1_1-1 use brother inf
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD345
2 files changed, 264 insertions, 103 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bba860bfa9bb..e9807b0cb451 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,10 +1,10 @@
# Generated by mksrcinfo v8
-# Fri Jun 9 04:36:30 UTC 2017
+# Sun Dec 9 08:49:41 UTC 2018
pkgbase = brother-mfc-j5720dw
pkgdesc = LPR and CUPS driver for the Brother MFC-J5720DW printer
pkgver = 3.0.1_1
pkgrel = 1
- url = http://www.brother.com/
+ url = https://support.brother.com/g/s/id/linux/en/
arch = i686
arch = x86_64
license = GPL
@@ -15,16 +15,26 @@ pkgbase = brother-mfc-j5720dw
depends = a2ps
depends = sed
depends = grep
+ depends = perl
optdepends = ttf-dejavu: printing text files from lpr
optdepends = brscan4: Scanner support
- source = http://download.brother.com/welcome/dlf101185/mfcj5720dwcupswrapper-3.0.1-1.i386.rpm
- source = http://download.brother.com/welcome/dlf101184/mfcj5720dwlpr-3.0.1-1.i386.rpm
+ optdepends = brscan-skey: Scanner button support
+ options = !strip
+ source = mfcj5720dw-3.0.1_1.inf::http://www.brother.com/pub/bsc/linux/infs/MFCJ5720DW
source = http://download.brother.com/welcome/dlf101198/brother_mfcj5720dw_GPL_source_3.0.1-1.tar.gz
source = lpr-license.txt
- sha256sums = e9757e3b8b3a7dfa85aef9f4c950ac8cd66f7e3063195515a604f80142e312f8
- sha256sums = 58c5f451b07fc4470edbe1b5f112f2bf784e124f8170230ca9e4d8aa888a78a9
+ source = http://www.brother.com/pub/bsc/linux/packages/mfcj5720dwcupswrapper-3.0.1-1.i386.rpm
+ source = http://www.brother.com/pub/bsc/linux/packages/mfcj5720dwlpr-3.0.1-1.i386.rpm
+ md5sums = bddea503a43b89e801b362c9a9a56e24
+ md5sums = 5e97706e57c4984f2fccaa002edf749c
+ md5sums = 4f14b328317aac0d22c7f7f73c581628
+ md5sums = f9aed4e75902dcd95950bde95fd7ba38
+ md5sums = 18c107ee3129634629ca99349bc8b56f
+ sha256sums = 56c1e9cf7cba175a130d85876e851226839b0070c2029f6734fea63a3a281c76
sha256sums = adaa952837ca45834f76047e4a4dda2a0eecf6ef8bee2a586c7ea638d58e55d4
sha256sums = b604def129534d245fa576f8cd7d01df1d2856b9bff6c1d2002404f77f7d4bb3
+ sha256sums = e9757e3b8b3a7dfa85aef9f4c950ac8cd66f7e3063195515a604f80142e312f8
+ sha256sums = 58c5f451b07fc4470edbe1b5f112f2bf784e124f8170230ca9e4d8aa888a78a9
depends_x86_64 = lib32-glibc
pkgname = brother-mfc-j5720dw
diff --git a/PKGBUILD b/PKGBUILD
index 415d45016cc1..05ed5da8f425 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,178 +1,331 @@
# 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.
+_brinf=(
+[MFC-J5720DW]
+PRN_CUP_RPM=mfcj5720dwcupswrapper-3.0.1-1.i386.rpm
+PRN_CUP_DEB=mfcj5720dwcupswrapper-3.0.1-1.i386.deb
+PRN_LPD_RPM=mfcj5720dwlpr-3.0.1-1.i386.rpm
+PRN_LPD_DEB=mfcj5720dwlpr-3.0.1-1.i386.deb
+PRINTERNAME=MFCJ5720DW
+SCANNER_DRV=brscan4
+SCANKEY_DRV=brscan-skey
+)
+_brinf+=(
+REQUIRE32LIB=yes
+)
-# 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
+_opt_DEB=0
set -u
_brotheru='MFC-J5720DW'
_brotherl="${_brotheru,,}" # mfc-0000dw
_brotherlnd="${_brotherl//-/}" # mfc0000dw
_brotherund="${_brotheru//-/}" # MFC0000DW
+_brotherxnd="${_brotherlnd}" # upper or lower as required by scripts
pkgname="brother-${_brotherl}"
pkgver='3.0.1_1'
pkgrel='1'
pkgdesc="LPR and CUPS driver for the Brother ${_brotheru} printer"
arch=('i686' 'x86_64')
-url='http://www.brother.com/'
+url='https://support.brother.com/g/s/id/linux/en/'
license=('GPL' 'custom')
depends=('cups' 'ghostscript' 'psutils' 'a2ps' 'sed' 'grep')
-depends_x86_64=('lib32-glibc')
# We look at the scripts and find these programs from which we decide on the depends above.
# gs: lpr rendering
# pdf2ps: cups rendering
# a2ps: rendering ascii text files
-# (not) pstops: pdf resizing
+# (no) pstops: pdf resizing
# 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
+depends+=('perl') # cupswrapper
optdepends=(
'ttf-dejavu: printing text files from lpr'
- 'brscan4: Scanner support'
)
+options=('!strip')
+#install="${pkgname}.install"
_brsource="brother_${_brotherlnd}_GPL_source_${pkgver//_/-}"
-#_dlf='http://www.brother.com/pub/bsc/linux/dlf'
+_dlf='http://www.brother.com/pub/bsc/linux'
+_inf="${_brotherlnd}-${pkgver}.inf"
source=(
- "http://download.brother.com/welcome/dlf101185/${_brotherlnd}cupswrapper-${pkgver//_/-}.i386.rpm"
- "http://download.brother.com/welcome/dlf101184/${_brotherlnd}lpr-${pkgver//_/-}.i386.rpm"
+ "${_inf}::${_dlf}/infs/${_brotherund}"
"http://download.brother.com/welcome/dlf101198/${_brsource}.tar.gz"
'lpr-license.txt'
)
-sha256sums=('e9757e3b8b3a7dfa85aef9f4c950ac8cd66f7e3063195515a604f80142e312f8'
- '58c5f451b07fc4470edbe1b5f112f2bf784e124f8170230ca9e4d8aa888a78a9'
+md5sums=('bddea503a43b89e801b362c9a9a56e24'
+ '5e97706e57c4984f2fccaa002edf749c'
+ '4f14b328317aac0d22c7f7f73c581628'
+ 'f9aed4e75902dcd95950bde95fd7ba38'
+ '18c107ee3129634629ca99349bc8b56f')
+sha256sums=('56c1e9cf7cba175a130d85876e851226839b0070c2029f6734fea63a3a281c76'
'adaa952837ca45834f76047e4a4dda2a0eecf6ef8bee2a586c7ea638d58e55d4'
- 'b604def129534d245fa576f8cd7d01df1d2856b9bff6c1d2002404f77f7d4bb3')
+ 'b604def129534d245fa576f8cd7d01df1d2856b9bff6c1d2002404f77f7d4bb3'
+ 'e9757e3b8b3a7dfa85aef9f4c950ac8cd66f7e3063195515a604f80142e312f8'
+ '58c5f451b07fc4470edbe1b5f112f2bf784e124f8170230ca9e4d8aa888a78a9')
+
+_mismatch=0
+_brverchk() {
+ local _ver="$1"
+ _ver="${_ver%.*}"
+ _ver="${_ver%.*}"
+ local _vb="${_ver%-*}"
+ _vb="${_vb%-*}-"
+ _ver="${_ver#${_vb}}"
+ local _pv="$2"
+ if [ -z "${_pv}" ]; then
+ _pv="$3"
+ fi
+ if [ -z "${_pv}" ]; then
+ _pv="$4"
+ fi
+ if [ "${_ver}" != "${_pv//_/-}" ]; then
+ echo "Version mismatch: ${_ver} ${_pv//_/-}" 1>&2
+ _mismatch=$((_mismatch+1))
+ fi
+}
+
+_procinf() {
+ local _fd _fvar _fval
+ for _fd in "${_brinf[@]}"; do
+ _fvar="${_fd%%=*}="
+ _fval="${_fd##*=}"
+ if [ ! -z "${_fval}" ]; then
+ case "${_fvar}" in
+ '['*);;
+ PRN_CUP_RPM=)
+ _brverchk "${_fval}" "${_cuprpmver:-}" "${_cupver:-}" "${pkgver}"
+ if [ "${_opt_DEB}" -eq 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ PRN_CUP_DEB=)
+ _brverchk "${_fval}" "${_cupdebver:-}" "${_cupver:-}" "${pkgver}"
+ if [ "${_opt_DEB}" -ne 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ PRN_LPD_RPM=)
+ _brverchk "${_fval}" "${_lprrpmver:-}" "${_lprver:-}" "${pkgver}"
+ if [ "${_opt_DEB}" -eq 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ PRN_LPD_DEB=)
+ _brverchk "${_fval}" "${_lprdebver:-}" "${_lprver:-}" "${pkgver}"
+ if [ "${_opt_DEB}" -ne 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ PRN_DRV_RPM=)
+ _brverchk "${_fval}" "" "" "${pkgver}"
+ if [ "${_opt_DEB}" -eq 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ PRN_DRV_DEB=)
+ _brverchk "${_fval}" "" "" "${pkgver}"
+ if [ "${_opt_DEB}" -ne 0 ]; then
+ source+=("${_dlf}/packages/${_fval}")
+ fi
+ ;;
+ REQUIRE32LIB=)
+ if [ "${_fval}" = 'yes' ]; then
+ depends_x86_64+=('lib32-glibc')
+ fi
+ ;;
+ PRINTERNAME=);;
+ SCANNER_DRV=)optdepends+=("${_fval}: Scanner support");;
+ SCANKEY_DRV=)optdepends+=("${_fval}: Scanner button support");;
+ *) echo "Unrecognized line: ${_fd}" 1>&2; exit 1;;
+ esac
+ fi
+ done
+ test "${_mismatch}" -eq 0 || exit 1
+}
+_procinf
+unset -f _procinf _brverchk
+unset _mismatch _brinf
+
+# Must be same length as
+# 'Brother'
+_conflict='brother'
prepare() {
set -u
+
+ shopt -s nullglob
+ local _deb
+ local _debn=1
+ for _deb in *.deb; do
+ local _dx="debextract.${_debn}"
+ mkdir "${_dx}"
+ bsdtar -C "${_dx}" -xf "${_deb}"
+ bsdtar -C "${_dx}" -xf "${_dx}"/control.tar.?z
+ bsdtar -xf "${_dx}"/data.tar.?z
+ rm "${_dx}"/*.tar.?z
+ _debn=$((_debn+1))
+ done
+ shopt -u nullglob
+
# Do not Install in '/usr/local'. Does not apply to all Brother models.
# This may modify binary blobs which only
# works when the old and new strings are exactly the same length.
- if [ -d "${srcdir}/usr/local/Brother" ]; then
- install -dm755 "${srcdir}/usr/share"
- mv "${srcdir}/usr/local/Brother/" "${srcdir}/usr/share/brother"
- rm -rf "${srcdir}/usr/local"
- sed -e 's:/usr/local/Brother:/usr/share/brother:g' -i $(grep -lr '/usr/local/Brother' ./)
+ if [ -d 'usr/local' ]; then
+ install -d 'usr/share'
+ mv 'usr/local/Brother' "usr/share/${_conflict}"
+ rmdir 'usr/local'
+ sed -e "s:/usr/local/Brother:/usr/share/${_conflict}:g" -i $(grep -lare '/usr/local/Brother' ./)
fi
- # 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.
-
- # Get the dirs and the name of the wrapper. Either in /opt or /usr.
- # This is set up to adapt or crash. Unlike false, ${} shows the line number.
- cd "${srcdir}/opt" 2>/dev/null || cd "${srcdir}/usr"
- local _rcfile="$(find "`pwd`" -type f -ipath "*inf/br${_brotherund}rc")"
- test -f "${_rcfile}" || echo "${}"
- local _bindir="$(find "`pwd`" -type d -name 'cupswrapper')"
- test -d "${_bindir}" || echo "${}" # die if blank or invalid before we rm something we don't want to
- pushd "${_bindir}" > /dev/null
- local _brcupsconf=(brcupsconf*); _brcupsconf="${_brcupsconf[0]}"
- test -x "${_brcupsconf}" || echo "${}"
- rm -f "${_bindir}"/* # We download the cups driver only to throw it all away. All I want is the dir name without hunting for it in the installer.
- local _basedir="${srcdir}/${_brsource}"
- test -d "${_basedir}" || echo "${}"
- cd "${_basedir}/cupswrapper" 2>/dev/null || cd "${_basedir}/scripts" 2>/dev/null || cd "${_basedir}"
- local _wrapdir="$(pwd)"
- cd "${_wrapdir}"
- local _wrapper_source="$(echo cupswrapper${_brotherund}*)"
- if ! test -f "${_wrapper_source}"; then
- _wrapper_source="$(echo cupswrapper*)"
- test -f "${_wrapper_source}" || echo "${}"
- fi
- cd "${_basedir}"/brcups*
- local _makedir="$(pwd)"
- if cd "${_basedir}/PPD" 2>/dev/null || cd "${_basedir}/ppd" 2>/dev/null; then
- local _ppddir="$(pwd)"
- fi
+ # setup cups-directories, some installers create these for us
+ install -d 'usr/lib/cups/filter'
+ install -d 'usr/share/cups/model'
+ #install -d 'usr/share/ppd' # For cups we don't need the ppd file here.
- # Source is available for the cups binary, not the lpr binaries so we can't
- # get away from multilib. Any usage of /opt is hardcoded into some binaries
- # for which we can't find an equal length replacement so we can't easily get
- # rid of that either.
- cd "${_makedir}"
- if [ -s 'Makefile' ]; then
- 'ma''ke' -s
- cp -p 'brcupsconfig' "${_bindir}/${_brcupsconf}"
- else
- # gcc options are pulled from other Brother makefiles.
- gcc -pipe -Wall -W -O2 -s -o "${_bindir}/${_brcupsconf}" 'brcupsconfig.c'
- fi
+ # /etc/printcap is managed by cups
+ find . -type 'f' -name 'setupPrintcap*' -delete
+
+ set +u
+}
+
+build() {
+ set -u
+
+ local _basedir="opt/brother/Printers/${_brotherxnd}"
+ #local _basedir="usr/share/${_conflict}"
+ #local _basedir="usr/share/${_conflict}/Printer/${_brotherxnd}"
+ shopt -s nullglob
+ local _wrapper_source=("${_basedir}/cupswrapper/cupswrapper${_brotherxnd}"*)
+ shopt -u nullglob
+ test "${#_wrapper_source[@]}" -eq 1 || echo "${}"
+ _wrapper_source="${_wrapper_source[0]}"
+ test -x "${_wrapper_source}" || echo "${}"
+ echo "Wrapper source: ${_wrapper_source}"
+
+ shopt -s nullglob
+ local _brcupsconf=("${_basedir}/cupswrapper"/brcupscon*); test "${#_brcupsconf[@]}" -eq 1 || echo "${}"
+ shopt -u nullglob
+ _brcupsconf="${_brcupsconf[0]}"
+ if [ ! -z "${_brsource:-}" ]; then
+ shopt -s nullglob
+ local _makedir=("${_brsource}/brcupsconf"*)
+ shopt -u nullglob
+ test "${#_makedir[@]}" -eq 1 || echo "${}"
+ _makedir="${_makedir[0]}"
+ test -d "${_makedir}" || echo "${}"
+
+ # Source is available for the cups binary, not the lpr binaries so we can't
+ # get away from multilib. Any usage of /opt is hardcoded into some binaries
+ # for which we can't find an equal length replacement so we can't easily get
+ # rid of that either.
+ pushd "${_makedir}" > /dev/null
+ if [ -s 'Makefile' ]; then
+ 'ma''ke' -s
+ cp -p 'brcupsconfig' "${srcdir}/${_brcupsconf}"
+ else
+ # gcc options are pulled from other Brother makefiles.
+ gcc -pipe -Wall -W -O2 -s -o "${srcdir}/${_brcupsconf}" "brcupsconfig.c"
+ fi
+ popd > /dev/null
+
+ # Use the wrapper from the source file if available
+ pushd "${_brsource}" > /dev/null
+ [ -d 'scripts' ] && cd 'scripts'
+ [ -d 'SCRIPT' ] && cd 'SCRIPT'
+ [ -d 'cupswrapper' ] && cd 'cupswrapper'
+ shopt -s nullglob
+ local _wr2=("cupswrapper${_brotherxnd}"*)
+ shopt -u nullglob
+ if [ "${#_wr2[@]}" -eq 1 ]; then
+ rm "${srcdir}/${_wrapper_source}"
+ _wrapper_source="${_brsource}/${PWD#*/${_brsource}/}/${_wr2[0]}"
+ unset _wr2
+ set +u; msg2 "Alternate wrapper ${_wrapper_source}"; set -u
+ fi
+ popd >/dev/null
- # Some models supply the ppd in the install script
- cd "${_bindir}"
- if [ ! -z "${_ppddir:-}" ]; then
# Use the ppd supplied in the source
- cp -p "${_ppddir}"/*.ppd "${_bindir}/"
- chmod 644 "${_bindir}"/*.ppd
+ shopt -s nullglob
+ local _altppd=("${_brsource}"/[Pp][Pp][Dd]/)
+ shopt -u nullglob
+ if [ "${#_altppd[@]}" -eq 1 ]; then
+ _altppd="${_altppd[0]}"
+ local _altppdn="brother_${_brotherxnd}_printer_en.ppd"
+ mv "${_altppd}/${_altppdn}" "${_basedir}/cupswrapper/"
+ chmod 644 "${_basedir}/cupswrapper"/*.ppd
+ set +u; msg2 "Alternate ppd ${_altppdn}"; set -u
+ fi
fi
# Some Brother installers create files here
- mkdir -p "${srcdir}/var/tmp"
+ mkdir -p 'var/tmp'
# Fix lpr driver.
true sed -e '# Fix sbin reference' \
-e 's:/sbin/:/bin/:g' \
-e '#Fix hash bang' \
-e 's:#/bin/sh:#!/bin/sh:g' \
- -i $(find "${srcdir}/usr" -type f -name 'psconvert2')
+ -i "${_basedir}/lpd/psconvertij2"
# Fix page shifted off center that affects some printers
# Letter prints off center shifted down and right with PaperType=A4
# I can only test printing A4 on Letter paper. A4 appears to print correctly with PaperType=Letter
- sed -e 's:^\(PaperType\)=.\+$:\1=Letter:g' -i "${_rcfile}"
+ sed -e 's:^\(PaperType\)=.\+$:\1=Letter:g' -i "${_basedir}/inf/br${_brotherxnd}rc"
# Modify the installer so we can finish the install here in PKGBUILD.
- cp -p "${_wrapdir}/${_wrapper_source}" "${_bindir}/"
#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 '# quick fix for path that needs to be double quoted' \
+ -e "s:'/usr/share/ppd':"'"/usr/share/ppd":g' \
-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 '# Remove unwanted srcdir from the generated files' \
+ -e '/^cat <<ENDOFPPDFILE/,/^ENDOFPPDFILE/ s:"${_srcdir}"::g' \
+ -e '/^cat <<!ENDOFWFILTER/,/^!ENDOFWFILTER!/ s:"${_srcdir}"::g' \
+ -e '# Remove extra quotes where path was already quoted' \
+ -e 's:""\${_srcdir}":"${_srcdir}:g' \
+ -e '#s:/model/Brother:/model: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 '# Fix a forgotten escape script error' \
+ -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 "s:/usr/local/Brother:/usr/share/${_conflict}:g" \
-i "${_wrapper_source}"
- grep -lq "#Arch Linux Compatible$" "${_wrapper_source}" || echo "${}"
+ grep -lqe '#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"
+ local _ppdir='usr/share/cups/model/Brother'
+ chmod 644 "${_ppdir}"/*.ppd # Some installers make ppd executable
+ rm -rf 'var'
+
+ #local _wrapgen="${_basedir}/cupswrapper/brother_lpdwrapper_${_brotherxnd}"
+ #local _wrapgen="usr/lib/cups/filter/brlpdwrapper${_brotherxnd}"
+ local _wrapgen="usr/lib/cups/filter/brother_lpdwrapper_${_brotherxnd}"
+ test -s "${_wrapgen}" || echo "${}"
# Remove srcdir from the generated wrapper file.
# No paths in the generated ppd.
- sed -e '# Remove the ${_srcdir} variety' \
- -e 's:${_srcdir}::' \
- -e '# Remove the /home/... variety' \
+ sed -e '# Remove the /home/... variety' \
-e "s:${srcdir}::" \
- -e '# Remove surplus quotes' \
- -e 's:""/:/:g' \
- -i "${srcdir}/usr/lib/cups/filter"/*lpdwrapper*
+ -i "${_wrapgen}"
+
+ # Ensure all paths were removed
+ grep -qFe $'${_srcdir}\n'"${srcdir}" "${_wrapgen}" && echo "${}"
# 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
+ # sed -e "s:Brother ${_brotherund} :Brother ${_brotheru} :g" -i "${_ppdir}"/*.ppd
# Check to see if the lpd wrapper is referenced by the ppd
# Check to see if our compiled code is referenced by the lpd wrapper
@@ -180,10 +333,10 @@ prepare() {
local _ncodefound=0
local _lwrapper
for _lwrapper in 'usr/lib/cups/filter'/*; do
- if grep -sq "$(basename "${_lwrapper}")" 'usr/share/cups/model'/*.ppd || grep -sq "$(basename "${_lwrapper}")" 'usr/share/cups/model/Brother'/*.ppd; then
+ if grep -q "$(basename "${_lwrapper}")" "${_ppdir}"/*.ppd; then
_nppdfound=$((_nppdfound+1))
fi
- if grep -q "${_brcupsconf}" "${_lwrapper}"; then
+ if grep -q "${_brcupsconf##*/}" "${_lwrapper}"; then
_ncodefound=$((_ncodefound+1))
fi
done
@@ -195,6 +348,7 @@ prepare() {
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'
@@ -203,12 +357,9 @@ package() {
fi
done
- # /etc/printcap is managed by cups. This eliminates any need for a printcap helper.
- rm -f "`find "${pkgdir}" -type f -name 'setupPrintcap*'`"
-
# 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)"
+ test ! -z "$(find "${pkgdir}/usr/share/cups/model" -type 'f' -name '*.ppd')" || echo "${}"
+ test ! -z "$(find "${pkgdir}/usr/lib/cups/filter/" '(' -type 'f' -o -type 'l' ')')" || echo "${}"
# Ensure there are no forbidden paths
! grep -alqr "/sbin" "${pkgdir}" || echo "${}"