summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD50
2 files changed, 23 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5cc2dafc4ac1..d16d12514ced 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Sun Dec 27 22:12:05 UTC 2015
+# Sun Dec 27 22:35:23 UTC 2015
pkgbase = brother-mfc-l2700dw
pkgdesc = LPR and CUPS driver for the Brother MFC-L2700DW
pkgver = 3.2.0
diff --git a/PKGBUILD b/PKGBUILD
index eee1354c2b6e..125d2269a47e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -23,38 +23,32 @@ md5sums=('ff69f49954e8fea524787c617ac3fcfd'
prepare() {
# do not install in '/usr/local'
if [ -d $srcdir/usr/local/Brother ]; then
- install -d $srcdir/usr/share
- mv $srcdir/usr/local/Brother/ $srcdir/usr/share/brother
- rm -rf $srcdir/usr/local
+ install -dm755 "$srcdir/usr/share"
+ mv "$srcdir/usr/local/Brother/" "$srcdir/usr/share/brother"
+ rm -rf "$srcdir/usr/local"
sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' ./`
fi
# setup cups-directories
- install -d $srcdir/usr/share/cups/model
- install -d $srcdir/usr/lib/cups/filter
-# go to the cupswrapper directory and find the source file from wich to generate a ppd- and wrapper-file
- cd `find . -type d -name 'cupswrapper'`
- if [ -f cupswrapper* ]; then
- _wrapper_source=`ls cupswrapper*`
- sed -i '/^\/etc\/init.d\/cups/d' $_wrapper_source
- sed -i '/^sleep/d' $_wrapper_source
- sed -i '/^lpadmin/d' $_wrapper_source
- sed -i 's|/usr|$srcdir/usr|g' $_wrapper_source
- sed -i 's|/opt|$srcdir/opt|g' $_wrapper_source
- sed -i 's|/model/Brother|/model|g' $_wrapper_source
- sed -i 's|lpinfo|echo|g' $_wrapper_source
- export srcdir=$srcdir
- ./$_wrapper_source
- sed -i 's|$srcdir||' $srcdir/usr/lib/cups/filter/*lpdwrapper*
- sed -i "s|$srcdir||" $srcdir/usr/lib/cups/filter/*lpdwrapper*
- rm $_wrapper_source
- fi
-# /etc/printcap is managed by cups
- rm `find $srcdir -type f -name 'setupPrintcap*'`
+ install -dm755 "$srcdir/usr/share/cups/model"
+ install -dm755 "$srcdir/usr/lib/cups/filter"
+# copy ppd and filter file to their destination dirs
+ cd `find . -type d -name 'cupswrapper'`
+ cp *lpdwrapper* "$srcdir/usr/lib/cups/filter/"
+ cp *.ppd "$srcdir/usr/share/cups/model/"
+# set the basedir to an absolute path in the perl-lpdwrapper-script
+# the relative path,generated on the basis of the caller, does not work in this case
+ cd "$srcdir"
+# get absolute printer path
+ _baseDir="\"/$(find opt -maxdepth 3 -depth -print -quit -type d)\""
+# replace the dynamic basedir var with the absolute path
+ sed -i "s|\`readlink\ \$0\`|$_baseDir|" $srcdir/usr/lib/cups/filter/*lpdwrapper*
+# /etc/printcap is managed by cups
+ rm "$(find $srcdir -type f -name 'setupPrintcap*')"
}
package() {
- cp -R $srcdir/usr $pkgdir
- if [ -d $srcdir/opt ]; then cp -R $srcdir/opt $pkgdir; fi
- install -m 644 -D cupswrapper-license.txt $pkgdir/usr/share/licenses/${pkgname}/cupswrapper-licence.txt
- install -m 644 -D lpr-license.txt $pkgdir/usr/share/licenses/${pkgname}/lpr-licence.txt
+ cp -R "$srcdir/usr" "$pkgdir"
+ cp -R "$srcdir/opt" "$pkgdir"
+ install -m 644 -D cupswrapper-license.txt $pkgdir/usr/share/licenses/${pkgname}/cupswrapper-licence.txt
+ install -m 644 -D lpr-license.txt $pkgdir/usr/share/licenses/${pkgname}/lpr-licence.txt
}