brother-mfc-j985dw
maintainer AngryUbuntuNerd
· 5 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The package downloads source and binary blobs from Brother's official download domain for building and packaging printer drivers, which is expected behavior for proprietary hardware drivers; the non-whitelisted host is Brother's own infrastructure, and the build process is transparent and follows standard AUR practices.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package downloads source and binary blobs from Brother's official download domain for building and packaging printer drivers, which is expected behavior for proprietary hardware drivers; the non-whitelisted host is Brother's own infrastructure, and the build process is transparent and follows standard AUR practices.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
source=() URL on a non-standard host
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:36
"https://download.brother.com/welcome/dlf102747/${_brotherlnd}cupswrapper-$pkgver-$pkgrel.i386.rpm"
PKGBUILD
1 offending line(s) highlighted
1
# The cups binary is 64 bit. Until Brother releases source for the 32 bit lpr
2
# binary blobs, 64 bit users must enable multilib.
3
4
# This has not been tested with non cups lprng.
5
6
set -u
7
_brotheru='MFC-J985DW'
8
_brotherl="${_brotheru,,}" # mfc-0000dw
9
_brotherlnd="${_brotherl//-/}" # mfc0000dw
10
_brotherund="${_brotheru//-/}" # MFC0000DW
11
pkgname="brother-${_brotherl}"
12
pkgver='1.0.0'
13
pkgrel='0'
14
pkgdesc="LPR and CUPS driver for the Brother ${_brotheru} printer"
15
arch=('i686' 'x86_64')
16
url='http://solutions.brother.com/linux/en_us/'
17
license=('custom:Brother Industries')
18
depends=('cups' 'ghostscript' 'psutils' 'a2ps' 'sed' 'grep')
19
depends_x86_64=('lib32-glibc')
20
# We look at the scripts and find these programs from which we decide on the depends above.
21
# gs: lpr rendering
22
# pdf2ps: cups rendering
23
# a2ps: rendering ascii text files
24
# (not) pstops: pdf resizing
25
# psnup: printing n-up pages
26
# sed grep awk
27
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670055
28
# Printing a text file fails when Liberation is the only TrueType font available
29
optdepends=(
30
'ttf-dejavu: Printing text files from lpr'
31
'brscan4: Scanner support'
32
)
33
# The cups wrapper uses the lpr driver.
34
_brsource="${_brotherlnd}_cupswrapper_GPL_source_${pkgver}-${pkgrel}"
35
source=(
36
"https://download.brother.com/welcome/dlf102747/${_brotherlnd}cupswrapper-$pkgver-$pkgrel.i386.rpm"
37
"https://download.brother.com/welcome/dlf102746/${_brotherlnd}lpr-$pkgver-$pkgrel.i386.rpm"
38
"https://download.brother.com/welcome/dlf102750/${_brsource}.tar.gz"
39
'cupswrapper-license.txt'
40
'lpr-license.txt'
41
)
42
md5sums=(
43
'4f1c504c42e457771f4398cda38759a4'
44
'564727c54c3691a630cc172f7e086aa0'
45
'1e2b3fe6939096730c2d7f150e23ea66'
46
'97ad0cffd216059e9d1d3121899d8646'
47
'5e87a3dc0f3e3438c088eda0f3565f0d'
48
)
49
50
build() {
51
set -u
52
# Do not Install in '/usr/local'. Does not apply to all Brother models.
53
# This may modify binary blobs which only
54
# works when the old and new strings are exactly the same length.
55
if [ -d "${srcdir}/usr/local/Brother" ]; then
56
install -dm755 "${srcdir}/usr/share"
57
mv "${srcdir}/usr/local/Brother/" "${srcdir}/usr/share/brother"
58
rm -rf "${srcdir}/usr/local"
59
sed -i -e 's:/usr/local/Brother:/usr/share/brother:g' $(grep -lr '/usr/local/Brother' ./)
60
fi
61
62
# setup cups-directories
63
install -dm755 "${srcdir}/usr/lib/cups/filter"
64
install -dm755 "${srcdir}/usr/share/cups/model"
65
#install -dm755 "${srcdir}/usr/share/ppd" # For cups we don't need the ppd file here.
66
67
# Get the dirs and the name of the wrapper. Either in /opt or /usr.
68
# This is set up to adapt or crash. Unlike false, ${} shows the line number.
69
cd "${srcdir}/opt" 2>/dev/null || cd "${srcdir}/usr"
70
local _rcfile="$(find "`pwd`" -type f -ipath "*inf/br${_brotherund}rc")"
71
test -f "${_rcfile}" || echo "${}"
72
local _bindir="$(find "`pwd`" -type d -name 'cupswrapper')"
73
test -d "${_bindir}" || echo "${}" # die if blank or invalid before we rm something we don't want to
74
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.
75
local _basedir="${srcdir}/${_brsource}"
76
test -d "${_basedir}" || echo "${}"
77
cd "${_basedir}/cupswrapper" 2>/dev/null || cd "${_basedir}/scripts" 2>/dev/null || cd "${_basedir}"
78
local _wrapdir="$(pwd)"
79
cd "${_wrapdir}"
80
local _wrapper_source="$(echo cupswrapper${_brotherund}*)"
81
if ! test -f "${_wrapper_source}"; then
82
_wrapper_source="$(echo cupswrapper*)"
83
test -f "${_wrapper_source}" || echo "${}"
84
fi
85
cd "${_basedir}"/brcups*
86
local _makedir="$(pwd)"
87
if cd "${_basedir}/PPD" 2>/dev/null || cd "${_basedir}/ppd" 2>/dev/null; then
88
local _ppddir="$(pwd)"
89
fi
90
91
# Source is available for the cups binary, not the lpr binaries so we can't
92
# get away from multilib. Any usage of /opt is hardcoded into some binaries
93
# for which we can't find an equal length replacement so we can't easily get
94
# rid of that either.
95
cd "${_makedir}"
96
if [ -s 'Makefile' ]; then
97
make -s
98
cp -p 'brcupsconfpt1' "${_bindir}"
99
else
100
# Not sure why it's called brcupsconfig3 some places and brcupsconfig4 in others.
101
# The version in their binary matches the version in the source so it looks good to me.
102
# gcc options are pulled from other Brother makefiles.
103
gcc -pipe -Wall -W -O2 -s -o "${_bindir}/brcupsconfig3" "brcupsconfig.c"
104
fi
105
106
cd "${_bindir}"
107
if [ ! -z "${_ppddir:-}" ]; then
108
# Use the ppd supplied in the source
109
cp -p "${_ppddir}"/*.ppd "${_bindir}/"
110
chmod 644 "${_bindir}"/*.ppd
111
fi
112
113
# Some Brother installers create files here
114
mkdir -p "${srcdir}/var/tmp"
115
116
# Fix any sbin reference in the lpr driver. The cups driver uses bin.
117
#sed -i -e 's:/sbin/:/bin/:g' $(find "${srcdir}/usr" -type f -name "psconvert2")
118
119
# Fix page shifted off center that affects some printers
120
# Letter prints off center shifted down and right with PaperType=A4
121
# I can only test printing A4 on Letter paper. A4 appears to print correctly with PaperType=Letter
122
sed -i -e 's:^\(PaperType\)=.\+$:\1=Letter:g' "${_rcfile}"
123
124
# Modify the installer so we can finish the install here in PKGBUILD.
125
cp -p "${_wrapdir}/${_wrapper_source}" "${_bindir}/"
126
#cp -p "${_wrapper_source}" "${_wrapper_source}.Arch" # debug: diff compare with Total Commander
127
sed -i -e '# Install to _srcdir. Some folders may not apply to this model.' \
128
-e 's:/usr:${_srcdir}&:g' \
129
-e 's:/opt:${_srcdir}&:g' \
130
-e 's:/var:${_srcdir}&:g' \
131
-e "# Stop the Install script after the files are generated. cups doesn't require a reload to see the printer driver." \
132
-e 's:^if \[ -e /etc/init:exit 0 #Arch Linux Compatible\n&:g' \
133
"${_wrapper_source}"
134
grep -lq "#Arch Linux Compatible" "${_wrapper_source}" || echo "${}"
135
test -f "${_wrapper_source}.Arch" && echo "${}" # Halt for debugging
136
# Generate PPD and wrapper. Use sh -x to debug
137
# Possible bug: copying to /usr/share/ppd is disabled.
138
export _srcdir="${srcdir}"
139
sh -e "${_wrapper_source}" -i
140
unset _srcdir
141
142
rm -rf "${srcdir}/var"
143
144
# Remove srcdir from the generated wrapper file.
145
# No paths in the generated ppd.
146
sed -i -e '# Remove the ${_srcdir} variety' \
147
-e 's:${_srcdir}::' \
148
-e '# Remove the /home/... variety' \
149
-e "s:${srcdir}::" "${srcdir}/usr/lib/cups/filter/"*lpdwrapper*
150
151
# We did everything in the installer so we can get rid of it.
152
rm -f "${_wrapper_source}"
153
set +u
154
}
155
156
package() {
157
set -u
158
local _dir
159
# /var/spool is not used anywhere in this package. Maybe it's needed for non cups lprng.
160
for _dir in usr opt; do # var
161
if [ -d "${srcdir}/${_dir}" ]; then
162
cp -pR "${srcdir}/${_dir}" "${pkgdir}"
163
fi
164
done
165
166
# /etc/printcap is managed by cups. This eliminates any need for a printcap helper.
167
rm -f "`find "${pkgdir}" -type f -name 'setupPrintcap*'`"
168
169
# Ensure we got a ppd and a filter for CUPS
170
test "$(find "${pkgdir}/usr/share/cups/model" -type f -name '*.ppd')"
171
test "$(find "${pkgdir}/usr/lib/cups/filter/" -type f)"
172
173
# Ensure there are no forbidden paths
174
grep -alqr "/sbin" "${pkgdir}" && echo "${}"
175
grep -alqr "/usr/tmp" "${pkgdir}" && echo "${}"
176
177
install -Dm644 'cupswrapper-license.txt' "${pkgdir}/usr/share/licenses/${pkgname}/cupswrapper-licence.txt"
178
install -Dm644 'lpr-license.txt' "${pkgdir}/usr/share/licenses/${pkgname}/lpr-licence.txt"
179
set +u
180
}
181
set +u
182
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |