[arch-commits] Commit in catalyst-utils/trunk (PKGBUILD authatieventsd.sh)

2013-03-16 Thread Laurent Carlier
Date: Saturday, March 16, 2013 @ 19:06:54
  Author: lcarlier
Revision: 86411

upgpkg: catalyst-utils 13.1-4

Add conflict with xorg-server 1.14.0, fix FS#33542

Modified:
  catalyst-utils/trunk/PKGBUILD
  catalyst-utils/trunk/authatieventsd.sh

---+
 PKGBUILD  |   15 ++-
 authatieventsd.sh |9 +
 2 files changed, 11 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2013-03-16 13:23:29 UTC (rev 86410)
+++ PKGBUILD2013-03-16 18:06:54 UTC (rev 86411)
@@ -6,19 +6,17 @@
 pkgbase=catalyst-utils
 pkgname=('catalyst-utils' 'opencl-catalyst')
 pkgver=13.1
-pkgrel=3
+pkgrel=4
 pkgdesc=AMD Catalyst drivers utilities and libraries with OpenCL 
implementation.
 arch=('i686' 'x86_64')
 url=http://www.amd.com;
 license=('custom')
 
source=(http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-${pkgver}-linux-x86.x86_64.zip
-fglrx-authfile-locations.patch
 atieventsd.service
 authatieventsd.sh)
 md5sums=('b5d9de9b000448dcc2a9eb74a889116d'
- '82bc263302a38fc3c97cd9ac05513435'
  '4bdb353dea68e33ac9e20ec30cc42082'
- 'a50e1c36b0669e84f8c6cf36432659db')
+ '796ab13af170e900c85eb27b4b03f285')
 
 if [ ${CARCH} = i686 ]; then
   _ARCHDIR=x86
@@ -34,15 +32,14 @@
   cd ${srcdir}
   
   sh ./amd-driver-installer*.run --extract fglrx-install
-   
-  patch -Np0 -i fglrx-authfile-locations.patch
 }
 
 package_catalyst-utils() {
   pkgdesc=AMD Catalyst drivers utilities and libraries.
   provides=('libgl')
-  conflicts=('mesa-libgl' 'nvidia-utils' 'nvidia-304xx-utils')
-  depends=('xorg-server=1.7.0'  'gcc-libs' 'libxinerama' 'libxcursor' 
'libxxf86vm' 'libxrandr' 'libsm' 'fontconfig' 'libxi' 'xorg-xauth' 'which' 
'netkit-bsd-finger')
+  conflicts=('mesa-libgl' 'nvidia-utils' 'nvidia-304xx-utils' 
'xorg-server1.14.0' 'X-ABI-VIDEODRV_VERSION13')
+  depends=('xorg-server' 'gcc-libs' 'libxinerama' 'libxcursor' 'libxxf86vm' 
'libxrandr' 'libsm' 'fontconfig'
+   'libxi' 'xorg-xauth' 'which' 'netkit-bsd-finger')
   optdepends=('qt: amdcccle'
   'acpid: acpi event support')
   
@@ -119,7 +116,7 @@
   pkgdesc=OpenCL implemention from AMD
   provides=('libcl')
   conflicts=('libcl')
-  depends=('gcc-libs')
+  depends=('gcc-libs' 'catalyst-utils')
   optdepends=('opencl-headers: headers necessary for OpenCL development')
 
   install -dm755 ${pkgdir}/usr/{bin,lib}

Modified: authatieventsd.sh
===
--- authatieventsd.sh   2013-03-16 13:23:29 UTC (rev 86410)
+++ authatieventsd.sh   2013-03-16 18:06:54 UTC (rev 86411)
@@ -34,8 +34,9 @@
 
 # Check xdm/kdm
 
-XDM_AUTH_MASK=/var/lib/xdm/authdir/authfiles/A$1*
-XDM_AUTH_FILE=`ls -t $XDM_AUTH_MASK 2/dev/null | head -n 1`   # Choose 
the newest file
+XDM_AUTH_MASK=/var/lib/xdm/authfiles/A$1*
+KDM_AUTH_MASK=/var/run/xauth/A$1*
+XDM_AUTH_FILE=`ls -t $XDM_AUTH_MASK $KDM_AUTH_MASK 2/dev/null | head -n 
1`   # Choose the newest file
 if [ -n $XDM_AUTH_FILE ]; then
 SERVER_AUTH_FILE=$XDM_AUTH_FILE
 DISP_SEARCH_STRING=##
@@ -44,10 +45,10 @@
 
 # Check gdm
 
-GDM_AUTH_FILE=/var/lib/gdm/$1.Xauth
+GDM_AUTH_FILE=/var/run/gdm/auth-for-gdm-*/database
 if [ -e $GDM_AUTH_FILE ]; then
 SERVER_AUTH_FILE=$GDM_AUTH_FILE
-DISP_SEARCH_STRING=$1
+DISP_SEARCH_STRING=unix$1
 return 0
 fi
 



[arch-commits] Commit in catalyst-utils/trunk (PKGBUILD authatieventsd.sh)

2013-03-02 Thread Laurent Carlier
Date: Saturday, March 2, 2013 @ 11:52:02
  Author: lcarlier
Revision: 85512

upgpkg: catalyst-utils 13.1-2

Fix FS#33542, remove dependency on sysvinit-tools

Added:
  catalyst-utils/trunk/authatieventsd.sh
Modified:
  catalyst-utils/trunk/PKGBUILD

---+
 PKGBUILD  |   13 --
 authatieventsd.sh |  102 
 2 files changed, 110 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2013-03-02 09:50:49 UTC (rev 85511)
+++ PKGBUILD2013-03-02 10:52:02 UTC (rev 85512)
@@ -6,7 +6,7 @@
 pkgbase=catalyst-utils
 pkgname=('catalyst-utils' 'opencl-catalyst')
 pkgver=13.1
-pkgrel=1
+pkgrel=2
 pkgdesc=AMD Catalyst drivers utilities and libraries with OpenCL 
implementation.
 arch=('i686' 'x86_64')
 url=http://www.amd.com;
@@ -14,11 +14,11 @@
 
source=(http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-${pkgver}-linux-x86.x86_64.zip
 fglrx-authfile-locations.patch
 atieventsd.service
-signature.from.12.9)
+authatieventsd.sh)
 md5sums=('b5d9de9b000448dcc2a9eb74a889116d'
  '82bc263302a38fc3c97cd9ac05513435'
  '4bdb353dea68e33ac9e20ec30cc42082'
- '01a51cd64705c0dfb1dcc7e285bf7637')
+ 'a50e1c36b0669e84f8c6cf36432659db')
 
 if [ ${CARCH} = i686 ]; then
   _ARCHDIR=x86
@@ -41,8 +41,8 @@
 package_catalyst-utils() {
   pkgdesc=AMD Catalyst drivers utilities and libraries.
   provides=('libgl')
-  conflicts=('libgl' 'nvidia-utils')
-  depends=('xorg-server=1.7.0'  'gcc-libs' 'libxinerama' 'libxcursor' 
'libxxf86vm' 'libxrandr' 'libsm' 'fontconfig' 'libxi' 'netkit-bsd-finger')
+  conflicts=('mesa-libgl' 'nvidia-utils' 'nvidia-nvidia-304xx-utils')
+  depends=('xorg-server=1.7.0'  'gcc-libs' 'libxinerama' 'libxcursor' 
'libxxf86vm' 'libxrandr' 'libsm' 'fontconfig' 'libxi' 'xorg-xauth' 'which' 
'netkit-bsd-finger')
   optdepends=('qt: amdcccle'
   'acpid: acpi event support')
   
@@ -100,6 +100,9 @@
   # systemd script
   install -m644 ${srcdir}/atieventsd.service 
${pkgdir}/usr/lib/systemd/system/
 
+  # (FS#33542) also use ps instead of pidof
+  install -m755 ${srcdir}/authatieventsd.sh 
${pkgdir}/etc/ati/authatieventsd.sh
+
   # provided in opencl-catalyst package
   rm ${pkgdir}/usr/lib/lib{amdocl*,OpenCL}.so* 
   

Added: authatieventsd.sh
===
--- authatieventsd.sh   (rev 0)
+++ authatieventsd.sh   2013-03-02 10:52:02 UTC (rev 85512)
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+#
+# Control script grant/revoke access to X for the ATI External Events Daemon
+#
+# Distro maintainers may modify this reference script as necessary to conform
+# to their distribution policies.
+#
+# Copyright (c) 2006, ATI Technologies Inc.  All rights reserved.
+#
+
+#
+# Parameters:
+#   $1 is a keyword, either grant or revoke
+#   $2 is the display name
+#   $3 is the X authorization file to be authorized
+#
+# Returns:
+#   0 if authorization was successfully granted/revoked
+#   nonzero on failure
+#
+# Note:
+#   The third parameter only makes sense if xauth is being used.  If another
+#   mechanism such as xhost is being used it can be ignored.  For setups that
+#   do not do any form of authentication(!) this script can be trimmed down
+#   to just exit 0 and the daemon will assume that it is always authorized.
+#
+
+GetServerAuthFile()
+{
+# Determine where the authorization key may be hiding.  The location will
+# vary depending upon whether X was started via xdm/kdm, gdm or startx, so
+# check each one in turn.
+
+# Check xdm/kdm
+
+XDM_AUTH_MASK=/var/lib/xdm/authdir/authfiles/A$1*
+XDM_AUTH_FILE=`ls -t $XDM_AUTH_MASK 2/dev/null | head -n 1`   # Choose 
the newest file
+if [ -n $XDM_AUTH_FILE ]; then
+SERVER_AUTH_FILE=$XDM_AUTH_FILE
+DISP_SEARCH_STRING=##
+return 0
+fi
+
+# Check gdm
+
+GDM_AUTH_FILE=/var/lib/gdm/$1.Xauth
+if [ -e $GDM_AUTH_FILE ]; then
+SERVER_AUTH_FILE=$GDM_AUTH_FILE
+DISP_SEARCH_STRING=$1
+return 0
+fi
+
+# Finally, check for startx
+
+for XPID in `ps -C X -o pid=`; do
+TRIAL_XAUTH_FILE=`tr '\0' '\n'  /proc/$XPID/environ | grep -e 
^XAUTHORITY= | cut -d= -f2`
+TRIAL_XAUTH_KEY=`xauth -f $TRIAL_XAUTH_FILE list | grep unix$1`
+if [ -n $TRIAL_XAUTH_KEY ]; then
+SERVER_AUTH_FILE=$TRIAL_XAUTH_FILE
+DISP_SEARCH_STRING=unix$1
+return 0
+fi
+done
+
+# Couldn't find the key
+
+return 1
+}
+
+# Main part of script
+
+#
+# Since the daemon is usually started during init time before X comes up,
+# $PATH may not yet contain the paths to the X binaries, particularly xauth.
+# Add the usual location for where xauth may live and fail out if we still
+# can't find it.
+#
+
+PATH=$PATH:/usr/bin:/usr/X11R6/bin
+which xauth  /dev/null