summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduard Wirch2017-09-15 16:21:54 +0200
committerEduard Wirch2017-09-18 10:49:19 +0200
commit5171559ccffad5021a1b96fe2fda51bc64b33366 (patch)
tree22ebb4c1f624b25bd375737e7dcb52b4cc02ad8a
parentc2b54cfbd9c0fab24e1616f80c5da9cd32e164f1 (diff)
downloadaur-5171559ccffad5021a1b96fe2fda51bc64b33366.tar.gz
Update to 5.20.606.3946 and fix Arch incompatibility
- Dependencies sed and awk are used by CUPS filter usr/lib/cups/filter/XeroxQScript. - systemctl wrapper: xeroxprtmgr invokes "service cups restart". Arch uses systemd, there is no 'service' command. A 'service' script and a xeroxprtmgr wrapper try to work around this. - XeroxQScript.patch: the original filter failes to respect RequestID and Copies. - xerox-prtdrv-xhost-permissions.desktop: autostart entry from postinstall script to extend xhost permissions
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD54
-rw-r--r--XeroxQScript.patch19
-rwxr-xr-xservice23
-rw-r--r--xerox-prtdrv-xhost-permissions.desktop4
-rw-r--r--xeroxprtdrv.install24
-rw-r--r--xeroxprtmgr7
7 files changed, 129 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a65e63ea7ec..be386d95e99 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,3 @@
-# Generated by mksrcinfo v8
-# Fri Sep 15 14:23:00 UTC 2017
pkgbase = xeroxprtdrv
pkgdesc = Xerox Unix Print Drivers
pkgver = 5.20.606.3946
@@ -17,15 +15,24 @@ pkgbase = xeroxprtdrv
depends = libxau
depends = libxdmcp
depends = xorg-xhost
+ depends = sed
+ depends = awk
+ optdepends = cups>=1.7
options = emptydirs
+ source = xeroxprtdrv.license
+ source = xerox-prtdrv-xhost-permissions.desktop
+ source = service
+ source = xeroxprtmgr
+ source = XeroxQScript.patch
+ md5sums = 0a8eb0c1480a6ccc1ddab7cbb5e1bde4
+ md5sums = c489163605720e1340a0af25d1c08d6c
+ md5sums = d380002eef6bbbbeb43cd0691123a7d4
+ md5sums = 1976d9d3e95065820adbe417ec4e5b2d
+ md5sums = 117637c64980344ca9bb87e8a8f10938
source_i686 = http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxi686-5.20.606.3946.rpm
- source_i686 = xeroxprtdrv.license
md5sums_i686 = 22698c5829eb56bcecd4633352a6274f
- md5sums_i686 = 0a8eb0c1480a6ccc1ddab7cbb5e1bde4
source_x86_64 = http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxx86_64-5.20.606.3946.rpm
- source_x86_64 = xeroxprtdrv.license
md5sums_x86_64 = 95a26aec1130153a6094057546668f72
- md5sums_x86_64 = 0a8eb0c1480a6ccc1ddab7cbb5e1bde4
pkgname = xeroxprtdrv
diff --git a/PKGBUILD b/PKGBUILD
index bd481c0223a..2d07ec504ea 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
# Maintainer: Troy Engel <troyengel+arch@gmail.com>
+# Contributor: Eduard Wirch <wirch.eduard@gmail.com>
pkgname=xeroxprtdrv
pkgver=5.20.606.3946
@@ -10,32 +11,59 @@ install=${pkgname}.install
license=('custom')
options=('emptydirs')
depends=('gcc-libs' 'libxinerama' 'libxcursor' 'libxdamage' 'libx11'
- 'libxau' 'libxdmcp' 'xorg-xhost')
+ 'libxau' 'libxdmcp' 'xorg-xhost' 'sed' 'awk')
+optdepends=('cups>=1.7')
-source_i686=("http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxi686-${pkgver}.rpm"
- 'xeroxprtdrv.license')
-md5sums_i686=('22698c5829eb56bcecd4633352a6274f'
- '0a8eb0c1480a6ccc1ddab7cbb5e1bde4')
-md5sums_x86_64=('95a26aec1130153a6094057546668f72'
- '0a8eb0c1480a6ccc1ddab7cbb5e1bde4')
+source=('xeroxprtdrv.license'
+ 'xerox-prtdrv-xhost-permissions.desktop'
+ 'service'
+ 'xeroxprtmgr'
+ 'XeroxQScript.patch'
+)
+source_i686=("http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxi686-${pkgver}.rpm")
+source_x86_64=("http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxx86_64-${pkgver}.rpm")
+md5sums=('0a8eb0c1480a6ccc1ddab7cbb5e1bde4'
+ 'c489163605720e1340a0af25d1c08d6c'
+ 'd380002eef6bbbbeb43cd0691123a7d4'
+ '1976d9d3e95065820adbe417ec4e5b2d'
+ '117637c64980344ca9bb87e8a8f10938')
+md5sums_i686=('22698c5829eb56bcecd4633352a6274f')
+md5sums_x86_64=('95a26aec1130153a6094057546668f72')
-source_x86_64=("http://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/Xeroxv5Pkg-Linuxx86_64-${pkgver}.rpm"
- 'xeroxprtdrv.license')
+prepare() {
+ cd "$srcdir"
+
+ # bug-fixing cups filter
+ patch -p1 -i XeroxQScript.patch
+}
package() {
+ cd "${srcdir}"
+
# remove RPM SElinux files, they delete these in RPM post-install
rm -f "${pkgdir}/opt/Xerox/prtsys/PatchSELinuxPolicy" \
"${pkgdir}/opt/Xerox/prtsys/SELinuxExceptions*.pp"
# copy the bits
- cp -dpr "${srcdir}/opt" "${pkgdir}"
- cp -dpr "${srcdir}/usr" "${pkgdir}"
+ cp -dpr opt "${pkgdir}"
+ cp -dpr usr "${pkgdir}"
- # it's in the RPM post-install 777, not sure what for; skipping chmod 777
- mkdir -p "${pkgdir}/opt/Xerox/prtsys/db/phonebook/user"
+ # systemctl wrapper patch
+ cp service "$pkgdir/opt/Xerox/prtsys/"
+ mv "$pkgdir/opt/Xerox/prtsys/xeroxprtmgr" "$pkgdir/opt/Xerox/prtsys/xeroxprtmgr.wrapped"
+ install -m 755 xeroxprtmgr "$pkgdir/opt/Xerox/prtsys/"
+
+ # Stuff from Xerox's postinstall file
+ install -m 775 -g lp -d "$pkgdir/etc/cups/interfaces"
+ install -m 775 -g lp -d "$pkgdir/var/spool/lpd"
+ # unsing 777 so any user will be able to create a phonebook
+ install -m 777 -d "$pkgdir/opt/Xerox/prtsys/db/phonebook/user"
# commercial license
install -Dm0644 "../${pkgname}.license" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+ install -d "$pkgdir/etc/xdg/autostart"
+ install xerox-prtdrv-xhost-permissions.desktop "$pkgdir/etc/xdg/autostart"
}
diff --git a/XeroxQScript.patch b/XeroxQScript.patch
new file mode 100644
index 00000000000..ab966d19364
--- /dev/null
+++ b/XeroxQScript.patch
@@ -0,0 +1,19 @@
+--- ./usr/lib/cups/filter/XeroxQScript 2017-09-15 14:11:33.027480086 +0200
++++ ./usr/lib/cups/filter/XeroxQScript 2017-09-15 14:11:56.717611267 +0200
+@@ -73,6 +73,7 @@
+ UserName=`echo "$2" | sed -e "s/^/-u /g" -e "s/\"//g"`
+ USER=$2
+ Title=`echo "$3" | sed -e "s/^/-t/g" -e "s/\"//g"`
++ Copies=$4
+ if [ "_${5}" != "_" ]; then
+ OptionList=`echo "$5" | sed -e "s/ / -o /g" -e "s/^/-o /" -e "s/\"//g"`
+ fi
+@@ -88,7 +89,7 @@
+ DISPLAY=${DISPLAY:-":0.0"}
+ export DISPLAY
+ fi
+- ${ToolPath}/xeroxdriver -d${PRINTER} $Copies $UserName "$Title" $OptionList $* 1>>/dev/null 2>>/dev/null
++ ${ToolPath}/xeroxdriver -d${PRINTER} $Copies $UserName "$Title" $OptionList $RequestID $* 1>>/dev/null 2>>/dev/null
+ exit 0
+ ;;
+ esac
diff --git a/service b/service
new file mode 100755
index 00000000000..fdb66f164fc
--- /dev/null
+++ b/service
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+#
+# wrapper around systemctl used by Xerox driver.
+#
+# Xerox's xeroxprtmgr invokes 'service cups restart', which will fail on systemd systems. This script "translates" the
+# service invocation to a systemctl invocation.
+#
+
+set -e
+
+SERVICE=$1
+COMMAND=$2
+
+if [ $SERVICE == "cups" ]; then
+ SERVICE=org.cups.cupsd.service
+else
+ SERVICE=$SERVICE.service
+fi
+
+echo "systemctl $COMMAND $SERVICE"
+
+systemctl $COMMAND $SERVICE
diff --git a/xerox-prtdrv-xhost-permissions.desktop b/xerox-prtdrv-xhost-permissions.desktop
new file mode 100644
index 00000000000..f511d2f2379
--- /dev/null
+++ b/xerox-prtdrv-xhost-permissions.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Name=Print-Time Dialog Permissions
+Type=Application
+Exec=xhost +si:localuser:lp
diff --git a/xeroxprtdrv.install b/xeroxprtdrv.install
index 6eda2864b62..8d73212e274 100644
--- a/xeroxprtdrv.install
+++ b/xeroxprtdrv.install
@@ -1,6 +1,26 @@
post_install() {
- echo "As root run the following to detect the printing subsystem:"
- echo "# cd /opt/Xerox/prtsys; /opt/Xerox/prtsys/xeroxquemgr -setprtsubsys"
+ if [ -f /bin/service ]; then
+ echo "This package installs a wrapper to /bin/service because the Xerox driver"
+ echo "invokes the service command, but Arch uses systemd (systemctl). This"
+ echo "system already has a /bin/service file. We will not overwrite it."
+ echo "Installation will cancel."
+ return 1;
+ fi
+
+ echo 'Detecting printing subsystem'
+ cd /opt/Xerox/prtsys; /opt/Xerox/prtsys/xeroxquemgr -setprtsubsys || echo 'Unable to detect printing subsystem' 1>> /tmp/PrtDrvInstaller.log 2>>/tmp/PrtDrvInstaller.log
+ echo 'Registering man pages'
+
+ env | grep DISPLAY > /opt/Xerox/prtsys/.xp_disp
+
+ /opt/Xerox/prtsys/PatchAppArmorPolicy || echo 'AppArmor policy patch failed' 1>> /tmp/PrtDrvInstaller.log 2>>/tmp/PrtDrvInstaller.log
+
+ if [ "_$DISPLAY" = "_" ]; then
+ DISPLAY=:0.0 xhost +si:localuser:lp >> /dev/null 2>> /dev/null || echo 'Failed to grant lp xhost permissions' 1>> /tmp/PrtDrvInstaller.log
+ else
+ xhost +si:localuser:lp >> /tmp/PrtDrvInstaller.log 2>> /tmp/PrtDrvInstaller.log || echo 'Failed to grant lp xhost permissions' 1>> /tmp/PrtDrvInstaller.log
+ fi
+ echo "Run xeroxprtmgr as root to administer print queues"
}
diff --git a/xeroxprtmgr b/xeroxprtmgr
new file mode 100644
index 00000000000..65575bda051
--- /dev/null
+++ b/xeroxprtmgr
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+ln -s /opt/Xerox/prtsys/service /bin/service
+
+/opt/Xerox/prtsys/xeroxprtmgr.wrapped
+
+rm /bin/service