summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStick2019-06-11 22:21:09 -0400
committerStick2019-06-11 22:21:09 -0400
commit43b6d505c5ca1635b95c37d6ac6dcf9a0a444113 (patch)
tree0d9faf8ef1aa07e8011b3af07b13c92634417266
parent1ebe0abccf287155f9a3211d80263737c557d260 (diff)
downloadaur-43b6d505c5ca1635b95c37d6ac6dcf9a0a444113.tar.gz
clean up PKGBUILD
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore20
-rw-r--r--PKGBUILD108
-rw-r--r--brother-mfc-j480dw.install6
4 files changed, 91 insertions, 61 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b0ada3716fec..5aa95ed5f6ec 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,10 +1,8 @@
-# Generated by mksrcinfo v8
-# Wed Sep 13 02:53:21 UTC 2017
pkgbase = brother-mfc-j480dw
- pkgdesc = LPR and CUPS driver for the Brother MFC-j480DW
+ pkgdesc = CUPS and LPR drivers for the Brother MFC-J480DW printer
pkgver = 1.0.0
pkgrel = 0
- url = http://solutions.brother.com/linux/en_us/
+ url = https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj480dw_us_eu_as&os=127
install = brother-mfc-j480dw.install
arch = i686
arch = x86_64
@@ -12,14 +10,16 @@ pkgbase = brother-mfc-j480dw
depends = cups
depends = ghostscript
depends = a2ps
- source = http://download.brother.com/welcome/dlf102091/mfcj480dwlpr-1.0.0-0.i386.rpm
+ depends = lib32-glibc
+ optdepends = brscan4: Scanner support
source = http://download.brother.com/welcome/dlf102092/mfcj480dwcupswrapper-1.0.0-0.i386.rpm
+ source = http://download.brother.com/welcome/dlf102091/mfcj480dwlpr-1.0.0-0.i386.rpm
source = cupswrapper-license.txt
source = lpr-license.txt
- md5sums = 1b44c6183f61cc7a43a090da0c1df087
- md5sums = 436d3273bb9516bab14878c9aa787e06
- md5sums = 97ad0cffd216059e9d1d3121899d8646
- md5sums = 5e87a3dc0f3e3438c088eda0f3565f0d
+ sha256sums = 2a18c4943adc92a2e97f674a638dbdfb87656137a97073577f716ace6a196854
+ sha256sums = 2a1e03b59d6af9dc8d67a9799f06ab439e67565410373081f2f8be65eb697a64
+ sha256sums = 2c6aa6a641332e5c87e971ac2a8beae13b059747bdba331bbd515914770d72d9
+ sha256sums = 9d85a8aafdaac8fac80e04234ad2acf5642bbf0b91ee582d2a89519a55f6dd67
pkgname = brother-mfc-j480dw
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..ccdadf693590
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+
+# Created by https://www.gitignore.io/api/archlinuxpackages
+# Edit at https://www.gitignore.io/?templates=archlinuxpackages
+
+### ArchLinuxPackages ###
+*.tar
+*.tar.*
+*.jar
+*.exe
+*.msi
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+
+pkg/
+src/
+
+# End of https://www.gitignore.io/api/archlinuxpackages
diff --git a/PKGBUILD b/PKGBUILD
index 980d142efdbf..4fa0b44df87b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,63 +3,73 @@
# Contributor: Peter Vasil <mail@petervasil.net>
# shellcheck disable=SC2034,SC2148,SC2154
-pkgname="brother-mfc-j480dw"
+_printer="MFC-J480DW"
+pkgname="brother-${_printer,,}"
pkgver="1.0.0"
pkgrel=0
-pkgdesc="LPR and CUPS driver for the Brother MFC-j480DW"
-url="http://solutions.brother.com/linux/en_us/"
+pkgdesc="CUPS and LPR drivers for the Brother $_printer printer"
+url="https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj480dw_us_eu_as&os=127"
arch=('i686' 'x86_64')
license=('custom:brother commercial license')
depends=('cups' 'ghostscript' 'a2ps')
-install="$pkgname.install"
-source=(
- "http://download.brother.com/welcome/dlf102091/mfcj480dwlpr-$pkgver-$pkgrel.i386.rpm"
- "http://download.brother.com/welcome/dlf102092/mfcj480dwcupswrapper-$pkgver-$pkgrel.i386.rpm"
- 'cupswrapper-license.txt'
- 'lpr-license.txt'
-)
-md5sums=('1b44c6183f61cc7a43a090da0c1df087'
- '436d3273bb9516bab14878c9aa787e06'
- '97ad0cffd216059e9d1d3121899d8646'
- '5e87a3dc0f3e3438c088eda0f3565f0d')
+optdepends=('brscan4: Scanner support')
+
if test "$CARCH" == x86_64; then
- depends+=('lib32-glibc')
+ depends+=('lib32-glibc')
fi
+
+install="brother-${_printer,,}.install"
+
+source=(
+ "http://download.brother.com/welcome/dlf102092/mfcj480dwcupswrapper-$pkgver-$pkgrel.i386.rpm"
+ "http://download.brother.com/welcome/dlf102091/mfcj480dwlpr-$pkgver-$pkgrel.i386.rpm"
+ 'cupswrapper-license.txt'
+ 'lpr-license.txt'
+)
+sha256sums=(
+ '2a18c4943adc92a2e97f674a638dbdfb87656137a97073577f716ace6a196854'
+ '2a1e03b59d6af9dc8d67a9799f06ab439e67565410373081f2f8be65eb697a64'
+ '2c6aa6a641332e5c87e971ac2a8beae13b059747bdba331bbd515914770d72d9'
+ '9d85a8aafdaac8fac80e04234ad2acf5642bbf0b91ee582d2a89519a55f6dd67'
+)
+
+
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
- # shellcheck disable=SC2115
- 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*'`
+ # 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"
+ sed -i 's|/usr/local/Brother|/usr/share/brother|g' "$(grep -lr '/usr/local/Brother' ./)"
+ fi
+ # set up cups-directories
+ install -d "$srcdir/usr/share/cups/model"
+ install -d "$srcdir/usr/lib/cups/filter"
+ # find source file in cupswrapper directory
+ cd "$(find . -type d -name 'cupswrapper')" || exit
+ _wrapper_source="$(find . -name "cupswrapper*")"
+ # generate ppd- and wrapper- files
+ sed -i '/^\/etc\/init.d\/cups/d' "$_wrapper_source"
+ sed -i '/^sleep/d' "$_wrapper_source"
+ sed -i '/^lpadmin/d' "$_wrapper_source"
+ # shellcheck disable=2016
+ sed -i 's|/usr|$srcdir/usr|g' "$_wrapper_source"
+ # shellcheck disable=2016
+ 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"
+ # shellcheck disable=2016
+ sed -i 's|$srcdir||' "$srcdir"/usr/lib/cups/filter/*lpdwrapper*
+ sed -i "s|$srcdir||" "$srcdir"/usr/lib/cups/filter/*lpdwrapper*
+ rm "$_wrapper_source"
+ # /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"
+ [ -d "$srcdir/opt" ] && 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"
}
diff --git a/brother-mfc-j480dw.install b/brother-mfc-j480dw.install
index 3ddb04120f84..6b15f3b0a04a 100644
--- a/brother-mfc-j480dw.install
+++ b/brother-mfc-j480dw.install
@@ -3,7 +3,7 @@ post_install() {
}
post_upgrade() {
-echo "Restart CUPS to load the new files"
-echo "You can now register your new printer using the web interface at:"
-echo " http://localhost:631/"
+ printf 'Restart CUPS to load new driver files:\n'
+ printf ' sudo systemctl restart org.cups.cupsd\n'
+ printf 'You can register your printer via the web interface at http://localhost:631/'
}