summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD30
-rw-r--r--brother-dcpj1200w.install28
-rw-r--r--fix_lp.patch11
5 files changed, 89 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..920439a07345
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = brother-dcpj1200w
+ pkgdesc = Driver for the Brother DCP-J1200W
+ pkgver = 3.5.0
+ pkgrel = 1
+ url = https://support.brother.com/g/b/producttop.aspx?c=gb&lang=en&prod=dcpj1200w_eu_as
+ install = brother-dcpj1200w.install
+ arch = i686
+ arch = x86_64
+ license = custom:brother
+ depends = cups
+ source = fix_lp.patch
+ source = https://download.brother.com/welcome/dlf105286/dcpj1200wpdrv-3.5.0-1.i386.rpm
+ sha256sums = a20b4dcd385b1a8bc1a46e5e648020cb201a9c9b29903dd5b62c371f116c3ca6
+ sha256sums = b39ab6013520ed5d909992c8b6d9263c49126b34a5285e7bf94d40160c8a7cbd
+
+pkgname = brother-dcpj1200w
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f885f1cde34e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+*.rpm
+*.zst
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a5d1cc8053f2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,30 @@
+# Maintainer: Gleb Sinyavskiy <zhulik.gleb@gmail.com>
+pkgname=brother-dcpj1200w
+pkgver=3.5.0
+pkgrel=1
+pkgdesc="Driver for the Brother DCP-J1200W"
+url="https://support.brother.com/g/b/producttop.aspx?c=gb&lang=en&prod=dcpj1200w_eu_as"
+license=('custom:brother')
+depends=('cups')
+install="$pkgname.install"
+arch=('i686' 'x86_64')
+source=(
+ "fix_lp.patch" \
+ "https://download.brother.com/welcome/dlf105286/dcpj1200wpdrv-$pkgver-1.i386.rpm"
+)
+sha256sums=('a20b4dcd385b1a8bc1a46e5e648020cb201a9c9b29903dd5b62c371f116c3ca6'
+ 'b39ab6013520ed5d909992c8b6d9263c49126b34a5285e7bf94d40160c8a7cbd')
+
+build() {
+ cd "$srcdir"
+ patch -Np0 < fix_lp.patch
+}
+
+package()
+{
+ install -d $pkgdir/usr/bin
+ install -Dm755 "$srcdir"/opt/brother/Printers/dcpj1200w/lpd/x86_64/brprintconf_dcpj1200w "$pkgdir"/usr/bin/
+ cp -R $srcdir/opt $pkgdir/opt
+ mv "$srcdir"/opt/brother/Printers/dcpj1200w/lpd/x86_64/* "$srcdir"/opt/brother/Printers/dcpj1200w/lpd
+ rmdir "$srcdir"/opt/brother/Printers/dcpj1200w/lpd/x86_64
+}
diff --git a/brother-dcpj1200w.install b/brother-dcpj1200w.install
new file mode 100644
index 000000000000..df239978d96a
--- /dev/null
+++ b/brother-dcpj1200w.install
@@ -0,0 +1,28 @@
+post_install() {
+ mkdir -p $pkgdir/var/spool/lpd
+
+ # lpr
+ /opt/brother/Printers/dcpj1200w/inf/setupPrintcapij dcpj1200w -i
+
+ # cupswrapper
+ /opt/brother/Printers/dcpj1200w/cupswrapper/cupswrapperdcpj1200w
+
+ systemctl restart org.cups.cupsd.service
+}
+
+post_upgrade() {
+ /bin/true
+}
+
+pre_remove() {
+ # lpr
+ /opt/brother/Printers/dcpj1200w/inf/setupPrintcapij dcpj1200w -e
+
+ # cupswrapper
+ /opt/brother/Printers/dcpj1200w/cupswrapper/cupswrapperdcpj1200w -e
+}
+
+op=$1
+shift
+
+$op "$@"
diff --git a/fix_lp.patch b/fix_lp.patch
new file mode 100644
index 000000000000..7db50c3c94cd
--- /dev/null
+++ b/fix_lp.patch
@@ -0,0 +1,11 @@
+--- opt/brother/Printers/dcpj1200w/inf/setupPrintcapij.old 2008-09-15 22:01:07.000000000 +0200
++++ opt/brother/Printers/dcpj1200w/inf/setupPrintcapij 2008-09-15 22:01:26.000000000 +0200
+@@ -34,7 +34,7 @@
+ if [ ! -d $SPOOLER_NAME ]; then
+ mkdir $SPOOLER_NAME
+ fi
+- chown lp $SPOOLER_NAME
++ chown root $SPOOLER_NAME
+ chgrp lp $SPOOLER_NAME
+ chmod 700 $SPOOLER_NAME
+