Commit 21482a30 authored by Agrigor's avatar Agrigor

all files included

parent 79bebc7d
post_install() {
__port2=`lpinfo -v | grep -i 'usb://Brother/HL-2070N%20series' | head -1`
if [ "$__port2" = '' ];then
__port2=`lpinfo -v | grep 'usb://' | head -1`
fi
__port=`echo $__port2| sed s/direct//g`
if [ "$__port" = '' ];then
__port="usb:/dev/usb/lp0"
fi
lpadmin -p HL2070N -E -v $__port -P /usr/share/cups/model/HL2070N.ppd
echo "If CUPS is not running now, start it after installation"
echo "and type command:"
echo " lpadmin -p HL2070N -E -v URL -P /usr/share/cups/model/HL2070N.ppd"
echo "where URL can be found using command:"
echo " lpinfo -v | grep -i 'Brother'"
echo "You can also register new printer using web interface at:"
echo " http://localhost:631/"
}
post_upgrade() {
/bin/true
}
pre_remove() {
lpadmin -x HL2070N
}
op=$1
shift
$op "$@"
# Generated by makepkg 4.2.1
# using fakeroot version 1.20.2
# Thu Aug 13 21:56:17 UTC 2015
pkgname = brother-hl2070n
pkgver = 2.0.1-3
pkgdesc = Brother HL-2070N CUPS driver
url = http://www.brother.com
builddate = 1439502977
packager = Unknown Packager
size = 182272
arch = x86_64
license = custom:Brother Industries
depend = lib32-glibc
makedepend = rpmextract
makepkgopt = strip
makepkgopt = docs
makepkgopt = libtool
makepkgopt = staticlibs
makepkgopt = emptydirs
makepkgopt = zipman
makepkgopt = purge
makepkgopt = !upx
makepkgopt = !debug
#! /bin/sh
#================================================
# Copyright(C) 2006 Brother Industries, Ltd.
#================================================
/usr/bin/brprintconflsr2 $@
#! /bin/sh
#
# Brother Print filter
# Copyright (C) 2005 Brother. Industries, Ltd.
# Ver1.00
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
#
LOGFILE="/dev/null"
LOGCLEVEL="7"
DEBUG=0
NUPENABLE=1
ENABLECOPY=0
LOG_LATESTONLY=1
errorcode=0
set +o noclobber
if [ "`echo $5 | grep 'debug-noprint=1'`" != '' ]; then
DEBUG=1
fi
if [ "`echo $5 | grep 'debug-noprint=2'`" != '' ]; then
DEBUG=2
fi
if [ "`echo $5 | grep 'debug-noprint=3'`" != '' ]; then
DEBUG=3
fi
if [ $DEBUG != 0 ]; then
LOGFILE=/tmp/br_cupsfilter_debug_log
fi
PRINTER=HL2070N
if [ "$PPD" = "" ]; then
PPD="/usr/share/cups/model/HL2070N.ppd"
fi
if [ $LOGFILE != "/dev/null" ]; then
if [ $LOG_LATESTONLY == "1" ]; then
rm -f $LOGFILE
date >$LOGFILE
else
if [ -e $LOGFILE ]; then
date >>$LOGFILE
else
date >$LOGFILE
fi
fi
echo "arg0 = $0" >>$LOGFILE
echo "arg1 = $1" >>$LOGFILE
echo "arg2 = $2" >>$LOGFILE
echo "arg3 = $3" >>$LOGFILE
echo "arg4 = $4" >>$LOGFILE
echo "arg5 = $5" >>$LOGFILE
echo "arg6 = $6" >>$LOGFILE
echo "PPD = $PPD" >>$LOGFILE
fi
INPUT_TEMP_PS=`mktemp /tmp/br_input_ps.XXXXXX`
nup="cat"
if [ "`echo $5 | grep 'Nup='`" != '' ] && [ $NUPENABLE != 0 ]; then
if [ "`echo $5 | grep 'Nup=64'`" != '' ]; then
nup="psnup -64"
elif [ "`echo $5 | grep 'Nup=32'`" != '' ]; then
nup="psnup -32"
elif [ "`echo $5 | grep 'Nup=25'`" != '' ]; then
nup="psnup -25"
elif [ "`echo $5 | grep 'Nup=16'`" != '' ]; then
nup="psnup -16"
elif [ "`echo $5 | grep 'Nup=8'`" != '' ]; then
nup="psnup -8"
elif [ "`echo $5 | grep 'Nup=6'`" != '' ]; then
nup="psnup -6"
elif [ "`echo $5 | grep 'Nup=4'`" != '' ]; then
nup="psnup -4"
elif [ "`echo $5 | grep 'Nup=2'`" != '' ]; then
nup="psnup -2"
elif [ "`echo $5 | grep 'Nup=1'`" != '' ]; then
nup="cat"
fi
echo "NUP=$nup" >>$LOGFILE
if [ -e /usr/bin/psnup ]; then
if [ $# -ge 7 ]; then
cat $6 | $nup > $INPUT_TEMP_PS
else
cat | $nup > $INPUT_TEMP_PS
fi
else
if [ $# -ge 7 ]; then
cp $6 $INPUT_TEMP_PS
else
cat > $INPUT_TEMP_PS
fi
fi
else
if [ $# -ge 7 ]; then
cp $6 $INPUT_TEMP_PS
else
cat > $INPUT_TEMP_PS
fi
fi
if [ "$ENABLECOPY" != 0 ];then
if [ "$4" -ge 2 ];then
options="$5"" ""Copies=$4"
else
options="$5"
fi
else
options="$5"
fi
if [ -e "/usr/share/brother/lpd/filter$PRINTER" ]; then
:
else
echo "ERROR: /usr/share/brother/lpd/filter$PRINTER does not exist" >>$LOGFILE
errorcode=30
exit
fi
if [ -e "/usr/share/brother/cupswrapper/brcupsconfig3" ]; then
if [ $DEBUG = 0 ]; then
/usr/share/brother/cupswrapper/brcupsconfig3 $PRINTER $PPD 0 "$options" >> /dev/null
else
/usr/share/brother/cupswrapper/brcupsconfig3 $PRINTER $PPD $LOGCLEVEL "$options" >>$LOGFILE
fi
fi
if [ $DEBUG -le 2 ]; then
cat $INPUT_TEMP_PS | /usr/share/brother/lpd/filter$PRINTER
fi
if [ $DEBUG -ge 2 ]; then
if [ $LOGFILE != "/dev/null" ]; then
echo "" >>$LOGFILE
echo " ------PostScript Data-------" >>$LOGFILE
cat $INPUT_TEMP_PS >>$LOGFILE
fi
fi
rm -f $INPUT_TEMP_PS
exit $errorcode
[HL2070N]
[default]
Resolution={600}
Paper Source={Tray1}
Duplex={OFF}
Duplex Type={Long}
Paper Type={(LANG_USA,LANG_CANADA)=Letter,A4}
Media={PlainPaper}
Copies={1}
Sleep={PrinterDefault}
Sleep Count={5}
Toner Save Mode={OFF}
[SelectionItem]
Resolution={300,600,HQ1200}
Resolution2={300,600,1200A}
Paper Source={Manual,Tray1,Tray2,Tray3,MpTray,AutoSelect}
Duplex={OFF,ON}
Duplex Type={Long,Short}
Paper Type={A4,Letter,Legal,Exective,A5,A6,B5,B6,C5,DL,Com-10,Monarch}
Media={PlainPaper,ThinPaper,ThickPaper,Thicker Paper,BondPaper,Transparencies,Envelopes,Env.Thick,Env.Thin}
Copies={"1-999"}
Sleep={PrinterDefault,"1-99"}
Toner Save Mode={ON,OFF}
[psconvert2]
pstops=/usr/lib/cups/filter/pstops
[HL2070N]
Language=LANG_USA
Resolution=600
PaperSource=Tray1
Duplex=OFF
DuplexType=Long
PaperType=A4
Media=PlainPaper
Copies=1
Sleep=PrinterDefault
TonerSaveMode=OFF
paper type: width height
A4: 4969 7015
Letter: 5100 6600
Legal: 5100 8400
Exective: 4350 6300
A5: 3505 4960
A6: 2479 3505
B5: 4159 5899
B6: 2950 4160
C5: 3835 5410
DL: 2599 5194
Com-10: 2475 5700
Monarch: 2325 4500
#! /bin/sh
#
# Brother Print filter
# Copyright (C) 2006 Brother. Industries, Ltd.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
#
PRINTER="HL2070N"
PRINTER_TMP=$(echo $PRINTER | sed -e 's/ //g' -e 's/-//g')
BR_PRT_PATH=/usr/share/brother
RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'`
PAPER_INF=$BR_PRT_PATH/inf/paperinf
PSCONV=$BR_PRT_PATH/lpd/psconvert2
BRCONV=$BR_PRT_PATH/lpd/rawtobr2
RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'`
INPUT_TEMP=`mktemp /tmp/br_input.XXXXXX`
INPUT_TEMP1=`mktemp /tmp/br_input.XXXXXX`
cat > $INPUT_TEMP1
FILE_TYPE=`file $INPUT_TEMP1 | sed -e 's/^.*:[ ]*//' -e 's/[ ].*//'`
#if [ "$FILE_TYPE" = "PostScript" -o "$FILE_TYPE" = "PDF" ] ; then
PSCONV_OP="$PAPER_INF $RCFILE"
BRCONV_OP="-pi $PAPER_INF -rc $RCFILE"
#fi
#
#landscape
#
xoffset=0
yoffset=0
ORIENTATION=`grep LandscapeAdjustment $RCFILE|sed 's/LandscapeAdjustment=//'`
if [ "$ORIENTATION" ]; then
if [ "$ORIENTATION" = Adjust ]; then
PAPERTYPE=`grep PaperType $RCFILE|sed -e's/PaperType=//'`
WIDTH=`grep $PAPERTYPE $PAPER_INF`
HEIGHT=`grep $PAPERTYPE $PAPER_INF`
WIDTH=`echo $WIDTH | sed -e 's/^.*:[ ]//' -e 's/[ ].*//'`
HEIGHT=`echo $HEIGHT | sed -e 's/^.*[ ]//'`
xoffset=`expr $WIDTH \* 72 / 600`
yoffset=`expr $HEIGHT \* 72 / 600`
fi
fi
#
#xshift and yshift
#
INIT_FILE=`eval echo $BR_PRT_PATH/inf/brPRINTERinit|eval sed 's/PRINTER/"$PRINTER"/'`
if [ -e $INIT_FILE ]; then
xshift=`grep xshift $INIT_FILE|sed 's/xshift=//'`
yshift=`grep yshift $INIT_FILE|sed 's/yshift=//'`
if [ $xshift ]; then
echo
else
xshift=0
fi
if [ $yshift ]; then
echo
else
yshift=0
fi
xoffset=`expr $xoffset + $xshift`
#
#pre-filter and post-filter
#
prefilter=`grep pre-filter $INIT_FILE|sed 's/pre-filter=//'`
postfilter=`grep post-filter $INIT_FILE|sed 's/post-filter=//'`
if [ $prefilter ]; then
echo
else
prefilter=cat
fi
if [ $prefilter ]; then
echo
else
postfilter=cat
fi
else
xshift=0
yshift=0
prefilter=cat
postfilter=cat
fi
if [ $prefilter = cat ]; then
cat $INPUT_TEMP1>$INPUT_TEMP
else
cat $INPUT_TEMP1| $prefilter >$INPUT_TEMP
fi
PSTOPSFILTER='/usr/lib/cups/filter/pstops'
if ! [ -e "$PSTOPSFILTER" ];then
PSTOPSFILTER=''
fi
trap '' 2
if [ $postfilter = cat ];then
case "$FILE_TYPE" in
"PostScript")
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $INPUT_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $INPUT_TEMP | "$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
fi
RET=$?
;;
"PDF")
PS_TEMP=`mktemp /tmp/br_ps.XXXXXX`
pdf2ps $INPUT_TEMP $PS_TEMP
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $PS_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $PS_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $PS_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $PS_TEMP | "$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
fi
RET=$?
rm -f $PS_TEMP
;;
* )
A2PS_OP="--output=- -q -1 --no-header --borders no"
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP | a2ps $A2PS_OP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $INPUT_TEMP | a2ps $A2PS_OP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP | a2ps $A2PS_OP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
else
eval cat $INPUT_TEMP | a2ps $A2PS_OP | "$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP
fi
fi
RET=$?
;;
esac
else
case "$FILE_TYPE" in
"PostScript")
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $INPUT_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\) | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $INPUT_TEMP | "$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\) | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
fi
RET=$?
;;
"PDF")
PS_TEMP=`mktemp /tmp/br_ps.XXXXXX`
pdf2ps $INPUT_TEMP $PS_TEMP
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $PS_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $PS_TEMP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $PS_TEMP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $PS_TEMP | "$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\) | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
fi
RET=$?
rm -f $PS_TEMP
;;
* )
A2PS_OP="--output=- -q -1 --no-header --borders no"
if [ $xshift = 0 ]&&[ $yshift = 0 ]; then
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP | a2ps $A2PS_OP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,0\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $INPUT_TEMP | a2ps $A2PS_OP | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
else
if [ "$ORIENTATION" = Adjust ]&&[ "$PSTOPSFILTER" ]; then
eval cat $INPUT_TEMP | a2ps $A2PS_OP |"$PSTOPSFILTER" 1:0L@1.0\($xoffset,$yshift\)| $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
else
eval cat $INPUT_TEMP | a2ps $A2PS_OP |"$PSTOPSFILTER" 1:0@1.0\($xshift,$yshift\) | $PSCONV $PSCONV_OP | $BRCONV $BRCONV_OP | $postfilter
fi
fi
RET=$?
;;
esac
fi
trap 2
rm -f $INPUT_TEMP
rm -f $INPUT_TEMP1
exit $RET
#/bin/sh
#
# psconert [Paper_inf] [rc_file]
# Copyright (C) 2003 Brother. Industries, Ltd.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
#
PAPER_INF=$1
RC_FILE=$2
FUNC_FILE=`echo $RC_FILE | sed s/rc$/func/`
PCL=0
PS2PS=0
# get Paper Type
PAPER_TYPE=`sed -n '/PaperType/p' $RC_FILE`
PAPER_TYPE=`echo $PAPER_TYPE | sed -e 's/ //g' -e 's/PaperType=//'`
# get Resolution
RESOLUTION=`sed -n '/Resolution/p' $RC_FILE`
RESOLUTION=`echo $RESOLUTION | sed -e 's/ //g' -e 's/Resolution=//'`
# get paper size
LINE=`eval sed -n '/^"$PAPER_TYPE"/p' $PAPER_INF`
WIDTH=$LINE
HEIGHT=$LINE
WIDTH=`echo $WIDTH | sed -e 's/^.*:[ ]//' -e 's/[ ].*//'`
HEIGHT=`echo $HEIGHT | sed -e 's/^.*[ ]//'`
PRINTABLEAREA=`sed -n '/PrintableArea/p' $RC_FILE`
PRINTABLEAREA=`echo $PRINTABLEAREA | sed -e 's/ //g' -e 's/PrintableArea=//'`
#---
PSTOPS='/usr/sbin/pstops'
if ! [ -f $PSTOPS ];then
PSTOPS=`grep 'pstops=' $FUNC_FILE | head -1 | sed s/'pstops='//`
fi
#---
shift_x_point=18 # 150 * 72 / 600
shift_y_point=12 # 100 * 72 / 600
printablearea_x_point=`expr $WIDTH \* 72 / 600 - 36`
printablearea_y_point=`expr $HEIGHT \* 72 / 600 - 24`
case "$RESOLUTION" in
"300" )
WIDTH=`expr $WIDTH / 2`
HEIGHT=`expr $HEIGHT / 2`
WIDTH_P=`expr $WIDTH - 150`
HEIGHT_P=`expr $HEIGHT - 100`
;;
"600" )