1) copy the script into your favorite text editor and save it as "brothermfc7340_LMDE.sh"
2) make the script executable $ sudo chmod 777 brothermfc7340_LMDE.sh
3) run the script $ sudo ./brothermfc7340_LMDE.sh
4) at the end of the script your browser should open up to the CUPS admin page. add the printer and choose your settings.
NOTES: i'm using xsane for a scanning gui and the permission fix that Brother provides doesn't work, therefore, it has to be run as root. i simply added gksu to the launcher command. there is also a bug in GTK2 that causes xsane to crash with certain themes (like clearlooks). changing themes worked for me.
EDIT (10/23/12): added some tweaks for scanner support. to enable network scanning check out this thread http://ubuntuforums.org/showthread.php?t=1519201
Code: Select all
#!/bin/sh
#designed for LMDE (update 4)
#script_name="brothermfc7340_LMDE.sh"
# Script must run as root
if [ $(id -u) -ne 0 ]; then
echo "You need to run this script as root."
echo "Use 'sudo ./$script_name' then enter your password when prompted."
exit 1
fi
# make the required directories
mkdir -p /var/spool/lpd
mkdir -p /usr/share/cups/model
mkdir -p /usr/lib/sane
#install scan dependancies
apt-get install -y sane-utils psutils tcsh lib32stdc++
#sym link cups/lpd
ln -s /etc/init.d/cups /etc/init.d/lpd
#download and install .deb files
if [ $(uname -m) = "x86_64" ]; then
# 64-bit
wget http://www.brother.com/pub/bsc/linux/dlf/brmfc7340lpr-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperMFC7340-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brscan3-0.2.11-4.amd64.deb http://www.brother.com/pub/bsc/linux/dlf/brscan-skey-0.2.1-3.amd64.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brmfcfaxcups-1.0.0-1.i386.deb
dpkg -i --force-all --force-architecture brmfc7340lpr-2.0.2-1.i386.deb cupswrapperMFC7340-2.0.2-1.i386.deb brscan3-0.2.11-4.amd64.deb brscan-skey-0.2.1-3.amd64.deb brmfcfaxcups-1.0.0-1.i386.deb
else
# 32-bit
wget http://www.brother.com/pub/bsc/linux/dlf/brmfc7340lpr-2.0.2-1.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperMFC7340-2.0.2-1.i386.deb http://www.brother.com/pub/bsc/linux/dlf/brscan3-0.2.11-4.i386.deb http://www.brother.com/pub/bsc/linux/dlf/brscan-skey-0.2.1-3.i386.deb http://pub.brother.com/pub/com/bsc/linux/dlf/brmfcfaxcups-1.0.0-1.i386.deb
dpkg -i --force-all --force-architecture brmfc7340lpr-2.0.2-1.i386.deb cupswrapperMFC7340-2.0.2-1.i386.deb brscan3-0.2.11-4.i386.deb brscan-skey-0.2.1-3.i386.deb brmfcfaxcups-1.0.0-1.i386.deb
fi
#add user to lpr group
usermod -aG lpadmin "$USER"
#enable normal user to access the scanner
sed -i '/autosuspend/i\# Brother scanner\nATTRS{idVendor}=="04f9", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"' /lib/udev/rules.d/60-libsane.rules
#run post installation scripts (fixes)
/usr/local/Brother/inf/setupPrintcap MFC7340 -i USB
/usr/local/Brother/inf/braddprinter -i MFC7340
if [ -d /usr/lib32 ]
then ln -s /usr/lib/libbrcomplpr2.so /usr/lib32/libbrcomplpr2.so
fi
if [ -e /etc/init.d/lprng ]; then
/etc/init.d/lprng restart
elif [ -e /etc/init.d/lpd ]; then
/etc/init.d/lpd restart
fi
if [ ! -e /usr/sbin/pstops ]
then PSTOPS=`which pstops`
if [ "`echo $PSTOPS | grep -i cups`" != "" ]
then PSTOPS=""
fi
if [ "$PSTOPS" != "" ]
then echo [psconvert2] >>/usr/local/Brother/inf/brMFC7340func
echo pstops=$PSTOPS >>/usr/local/Brother/inf/brMFC7340func
fi
fi
if [ -e /bin/sh ]
then sh /usr/local/Brother/cupswrapper/cupswrapperMFC7340-2.0.2 -i
elif [ -e /bin/bash ]
then bash /usr/local/Brother/cupswrapper/cupswrapperMFC7340-2.0.2 -i
else echo ''
echo '****** ERROR: bash is required. ******'
fi
#create symlinks for installed files
ln -s /usr/lib64/sane/libsane-brother3.so.1.0.7 /usr/lib/sane/libsane-brother3.so.1.0.7
ln -s /usr/lib64/sane/libsane-brother3.so.1 /usr/lib/sane/libsane-brother3.so.1
ln -s /usr/lib64/sane/libsane-brother3.so /usr/lib/sane/libsane-brother3.so
ln -s /usr/lib64/libbrscandec3.so /usr/lib/libbrscandec3.so
ln -s /usr/lib64/libbrscandec3.so.1 /usr/lib/libbrscandec3.so.1
ln -s /usr/lib64/libbrscandec3.so.1.0.0 /usr/lib/libbrscandec3.so.1.0.0
#display cups webui
echo ''
echo 'installation completed'
sleep 2
echo 'cups admin will now launch in your browser'
sleep 2
xdg-open http://localhost:631/admin