~comcloudway/ccw-aports

af9f919c776ed1531b7db4c6019e39e875aa3777 — Jakob Meier 2 years ago e4ea916
adjusted APKBUILD for alpine linux
A brother-dcpj140w/APKBUILD => brother-dcpj140w/APKBUILD +53 -0
@@ 0,0 1,53 @@
# Contributor: Alessio Bianchi <venator85@gmail.com>
# Contributor: Jacek Roszkowski <j.roszk@gmail.com>
# Contributor: Javier Cordero <jneight@gmail.com>
# Contributor: M. Arnout <marnout at free.fr>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>

pkgname=brother-dcpj140w
pkgver=1.1.3
pkgrel=4
pkgdesc="Driver for the Brother DCP-j140w wifi multifuncional printer"
url="http://solutions.brother.com/linux/en_us/index.html"
license="custom:brother"
makedepends="rpm2cpio"
depends="a2ps cups gcompat"
install="brother-dcpj140w.post-install
brother-dcpj140w.pre-deinstall"
arch="x86 x86_64"
options="!check"
source="fix_lp.patch
wrapper_usr_share.patch
lp_usr_share.patch
http://www.brother.com/pub/bsc/linux/dlf/dcpj140wlpr-$pkgver-6.i386.rpm
http://www.brother.com/pub/bsc/linux/dlf/dcpj140wcupswrapper-$pkgver-6.i386.rpm"

prepare() {
  rpm2cpio dcpj140wlpr-$pkgver-6.i386.rpm | cpio -idmv
  rpm2cpio dcpj140wcupswrapper-$pkgver-6.i386.rpm | cpio -idmv
}

build() {
  cd "$srcdir"
  patch -Np0 < fix_lp.patch
  patch -Np0 < wrapper_usr_share.patch
  patch -Np0 < lp_usr_share.patch
}

post_install() {
  /usr/share/brother/Printers/dcpj140w/cupswrapper/cupswrapperdcpj140w
}

package() {
  install -d $pkgdir/usr/bin
  install -d $pkgdir/var/spool/lpd
  install -Dm755 "$srcdir"/usr/bin/brprintconf_dcpj140w "$pkgdir"/usr/bin/
  cp -R $srcdir/opt $pkgdir/usr/share
}
sha512sums="
804d289eded628dc61d8cd7d5e786d38b2c275e4d7c403554b94abf13c843f6dd087152e99911453f838210637ca7b58e2237d32b22e19c3f820ac8565a7e871  fix_lp.patch
cb908a52256a679796633113d40c8c70e7ab10086fb63badfbe8d56a8a061cf8589078249793ed80629d40091af9e411a6aacdf38e764368b53013e13acd73b9  wrapper_usr_share.patch
da0d8730bca6d37d455eb479ff072b6479f997e7f1fe0e513c88ef88e25038031b461c6f8d7aa46d2d0d4e31b9ef9f79ee6be6da85a50fbe6c3c6618d09c65db  lp_usr_share.patch
34e92df28ee94508b956f56dc71a19f04639b5ca1415c25a6fa32e3226f3419e29de550e9f7b907cfd66ece1c2d752d7bb05475f58bc6c4a2e00fdd49cdf179b  dcpj140wlpr-1.1.3-6.i386.rpm
2f59330b9d6e9a596371fbcd509aa933a28293238114c0bfb6d2067698a0c3aa60fc16982729d86881bfd72c6d8cbe58ecf0ca63bf23205066521bf796dbe7b0  dcpj140wcupswrapper-1.1.3-6.i386.rpm
"

A brother-dcpj140w/brother-dcpj140w.post-install => brother-dcpj140w/brother-dcpj140w.post-install +7 -0
@@ 0,0 1,7 @@
# lpr
/usr/share/brother/Printers/dcpj140w/inf/setupPrintcapij dcpj140w -i

# cupswrapper
/usr/share/brother/Printers/dcpj140w/cupswrapper/cupswrapperdcpj140w

rc-service cupsd restart

A brother-dcpj140w/brother-dcpj140w.pre-deinstall => brother-dcpj140w/brother-dcpj140w.pre-deinstall +5 -0
@@ 0,0 1,5 @@
# lpr
/usr/share/brother/Printers/dcpj140w/inf/setupPrintcapij dcpj140w -e

# cupswrapper
/usr/share/brother/Printers/dcpj140w/cupswrapper/cupswrapperdcpj140w -e

A brother-dcpj140w/lp_usr_share.patch => brother-dcpj140w/lp_usr_share.patch +11 -0
@@ 0,0 1,11 @@
--- opt/brother/Printers/dcpj140w/inf/setupPrintcapij.old
+++ opt/brother/Printers/dcpj140w/inf/setupPrintcapij
@@ -48,7 +48,7 @@
         :sd=/var/spool/lpd/$BRPRINTER_MODEL:\\
         :sh:\\
         :lp=$DEVICE_IF:\\
-        :if=/opt/brother/Printers/$BRPRINTER_MODEL/lpd/filter$BRPRINTER_MODEL:
+        :if=/usr/share/brother/Printers/$BRPRINTER_MODEL/lpd/filter$BRPRINTER_MODEL:
 EOF
 	;;
 	-e)

A brother-dcpj140w/wrapper_usr_share.patch => brother-dcpj140w/wrapper_usr_share.patch +84 -0
@@ 0,0 1,84 @@
--- opt/brother/Printers/dcpj140w/cupswrapper/cupswrapperdcpj140w.old
+++ opt/brother/Printers/dcpj140w/cupswrapper/cupswrapperdcpj140w
@@ -45,7 +45,7 @@
   rm -f /usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
   rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}
   rm -f /usr/lib64/cups/filter/brlpdwrapper${printer_model}
-  rm -f /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
+  rm -f /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
 # rm -f /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
 if [  -e /etc/init.d/cups ]; then
    /etc/init.d/cups restart
@@ -72,10 +72,10 @@
   echo   '       -r : remove printer'
   exit 0
 fi
-#mkdir -p /opt/brother/${device_model}/${printer_model}/filter
+#mkdir -p /usr/share/brother/${device_model}/${printer_model}/filter
 #mkdir -p /usr/lib/cups/filter
 
-if [ -e "/opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
+if [ -e "/usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
   :
 else
   echo "ERROR : Brother LPD filter is not installed."
@@ -87,12 +87,12 @@
   ppd_file_name=/usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
 fi
 
-if [ -e "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd" ];	then
-cp "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd" $ppd_file_name
+if [ -e "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd" ];	then
+cp "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd" $ppd_file_name
 else
   echo "ERROR : copy failed."
-  echo "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd."
-  echo "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd"
+  echo "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd."
+  echo "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd"
 fi
 
 chmod 644 $ppd_file_name
@@ -218,25 +218,25 @@
       cat    > \$INPUT_TEMP_PS
    fi
 fi
-if [ -e "/opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
+if [ -e "/usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
        :
 else
-    echo "ERROR: /opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist"   >>\$LOGFILE
+    echo "ERROR: /usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist"   >>\$LOGFILE
     errorcode=30
     exit
 fi
 
 CUPSOPTION=\`echo "\$5 Copies=\$4" | sed -e 's/BrMirror=OFF/MirrorPrint=OFF/' -e 's/BrMirror=ON/MirrorPrint=ON/' -e 's/BrChain/Chain/' -e 's/BrBrightness/Brightness/' -e 's/BrContrast/Contrast/' -e 's/BrHalfCut/HalfCut/' -e 's/BrAutoTapeCut/AutoCut/' -e 's/BrHalftonePattern/Halftone/' -e 's/Binary/Binary/' -e 's/Dither/Dither/' -e 's/ErrorDiffusion/ErrorDiffusion/' -e 's/PageSize/media/' -e 's/BrSheets/Sheets/' -e 's/multiple-document-handling/Collate/' -e 's/separate-documents-collated-copies/ON/' -e 's/separate-documents-uncollated-copies/OFF/'\`
-if [ -e "/opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
+if [ -e "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
   if [ \$DEBUG = 0 ]; then
-     /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
+     /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
   else
-     /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  \$PPDC \$LOGCLEVEL "\$CUPSOPTION" "${printer_model}">>\$LOGFILE
+     /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  \$PPDC \$LOGCLEVEL "\$CUPSOPTION" "${printer_model}">>\$LOGFILE
   fi
 fi
 
 if [ \$DEBUG -lt 10 ]; then
-    cat    \$INPUT_TEMP_PS | /opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
+    cat    \$INPUT_TEMP_PS | /usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
 
     if [ \$LOGLEVEL -gt 2 ];  then
 	   if [ \$LOGFILE != "/dev/null" ]; then
@@ -277,8 +277,8 @@
 #
 rm -f  $tmp_filter
 
-chmod a+w /opt/brother/${device_model}/${printer_model}/inf/br${printer_model}rc
-chmod a+w /opt/brother/${device_model}/${printer_model}/inf
+chmod a+w /usr/share/brother/${device_model}/${printer_model}/inf/br${printer_model}rc
+chmod a+w /usr/share/brother/${device_model}/${printer_model}/inf
 if [ -e /etc/init.d/lpd ]; then
    /etc/init.d/lpd stop
 fi