diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index cf1fa6d..fa24bd4 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -19,7 +19,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.5.1 -Release: 2%{?dist} +Release: 3%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -40,6 +40,9 @@ Source1: gitignore Source10: 10-x11-keymap.fdi Source11: fedora-setup-keyboard +# Useful xvfb-run script +Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh + # OpenGL compositing manager feature/optimization patches. Patch100: xorg-x11-server-1.1.0-no-move-damage.patch Patch101: xserver-1.4.99-dont-backfill-bg-none.patch @@ -213,6 +216,8 @@ application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays %package Xvfb Summary: A X Windows System virtual framebuffer X server. Group: User Interface/X +# xvfb-run is GPLv2, rest is MIT +License: MIT and GPLv2 Obsoletes: xorg-x11-Xvfb Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xvfb @@ -346,6 +351,8 @@ cp hw/xfree86/{xorgconf.cpp,Options} %{inst_srcdir}/hw/xfree86 cp hw/xfree86/common/{vesamodes,extramodes} %{inst_srcdir}/hw/xfree86/common cp hw/xfree86/utils/xorgconfig/Cards{,98} %{inst_srcdir}/hw/xfree86/utils/xorgconfig/ +install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xfvb-run + find . -type f | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | xargs tar cf - | (cd %{inst_srcdir} && tar xf -) @@ -476,6 +483,7 @@ rm -rf $RPM_BUILD_ROOT %files Xvfb %defattr(-,root,root,-) %{_bindir}/Xvfb +%{_bindir}/xvfb-run %{_mandir}/man1/Xvfb.1* @@ -501,6 +509,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Sep 30 2008 Tom "spot" Callaway 1.5.1-3 +- add xvfb-run helper script to Xvfb package + * Thu Sep 25 2008 Dave Airlie 1.5.1-2 - fix crash with x11perf on r500 modesetting diff --git a/xvfb-run.sh b/xvfb-run.sh new file mode 100644 index 0000000..8d1e293 --- /dev/null +++ b/xvfb-run.sh @@ -0,0 +1,187 @@ +#!/bin/sh +# --- T2-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# T2 SDE: package/.../xorg-server/xvfb-run.sh +# Copyright (C) 2005 The T2 SDE Project +# Copyright (C) XXXX - 2005 Debian +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- T2-COPYRIGHT-NOTE-END --- + +# $Id$ +# from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run + +# This script starts an instance of Xvfb, the "fake" X server, runs a command +# with that server available, and kills the X server when done. The return +# value of the command becomes the return value of this script. +# +# If anyone is using this to build a Debian package, make sure the package +# Build-Depends on xvfb, xbase-clients, and xfonts-base. + +set -e + +PROGNAME=xvfb-run +SERVERNUM=99 +AUTHFILE= +ERRORFILE=/dev/null +STARTWAIT=3 +XVFBARGS="-screen 0 640x480x8" +LISTENTCP="-nolisten tcp" +XAUTHPROTO=. + +# Query the terminal to establish a default number of columns to use for +# displaying messages to the user. This is used only as a fallback in the event +# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the +# script is running, and this cannot, only being calculated once.) +DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true +if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then + DEFCOLUMNS=80 +fi + +# Display a message, wrapping lines at the terminal width. +message () { + echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} +} + +# Display an error message. +error () { + message "error: $*" >&2 +} + +# Display a usage message. +usage () { + if [ -n "$*" ]; then + message "usage error: $*" + fi + cat <&2 + exit 2 +fi + +if ! which xauth >/dev/null; then + error "xauth command not found" + exit 3 +fi + +# If the user did not specify an X authorization file to use, set up a temporary +# directory to house one. +if [ -z "$AUTHFILE" ]; then + XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$" + if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then + error "temporary directory $XVFB_RUN_TMPDIR already exists" + exit 4 + fi + AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority) +fi + +# Start Xvfb. +MCOOKIE=$(mcookie) +XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \ + >"$ERRORFILE" 2>&1 +XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \ + 2>&1 & +XVFBPID=$! +sleep "$STARTWAIT" + +# Start the command and save its exit status. +set +e +DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 +RETVAL=$? +set -e + +# Kill Xvfb now that the command has exited. +kill $XVFBPID + +# Clean up. +XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1 +if [ -n "$XVFB_RUN_TMPDIR" ]; then + if ! rm -r "$XVFB_RUN_TMPDIR"; then + error "problem while cleaning up temporary directory" + exit 5 + fi +fi + +# Return the executed command's exit status. +exit $RETVAL + +# vim:set ai et sts=4 sw=4 tw=80: