X Strike Force X.Org X11 SVN commit: r49 - trunk/debian
Author: dnusinow
Date: 2005-05-08 23:07:05 -0500 (Sun, 08 May 2005)
New Revision: 49
Added:
trunk/debian/xfs.README.Debian
trunk/debian/xfs.init
trunk/debian/xfs.install
trunk/debian/xfs.links
trunk/debian/xfs.postinst.in
trunk/debian/xfs.postrm.in
trunk/debian/xfs.preinst.in
trunk/debian/xfs.prerm.in
Log:
Add xfs packaging docs. Audited and approved by David.
Added: trunk/debian/xfs.README.Debian
===================================================================
--- trunk/debian/xfs.README.Debian 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.README.Debian 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,40 @@
+Debian README for xfs package
+=============================
+
+Newcomers to the X Window System should first read the Debian X FAQ
+(Frequently Asked Questions list): /usr/share/doc/xfree86-common/FAQ.gz.
+You can view this file with your favorite pager program after decompressing
+it. For example:
+ $ zcat /usr/share/doc/xfree86-common/FAQ.gz | pager
+
+Upgraders from Debian GNU/Linux 2.0 or earlier should be aware that the
+/etc/X11/config file is no longer used; its xfs-specific options are now in
+/etc/X11/fs/xfs.options.
+
+The default font catalogue for xfs as shipped with Debian GNU/Linux
+searches the "misc" font directory before searching "cyrillic". Some fonts
+in both of these directories claim the same font alias names (like
+"fixed"). Therefore, the X font server will use whichever font it finds
+first with that alias. To preferentially use Cyrillic fonts instead of the
+Latin ones in misc, simply switch the order in which the paths appear in
+the xfs font catalogue, defined in /etc/X11/fs/config.
+
+Also, be aware that, as of xfs 3.3.3.1-3, the default xfs configuration has
+TCP port listening disabled for security reasons. If you have xfs serving
+fonts to remote hosts via TCP, you will need to re-enable TCP connections;
+you can do this by simply commenting out the "no-listen = tcp" line in
+/etc/X11/fs/config.
+
+To use xfs you must add it to the X server's FontPath, in the "Files" section
+of your XF86Config (or XF86Config-4).
+
+Section "Files"
+ FontPath "unix/:7100"
+EndSection
+
+For information on the /etc/X11/fs/config file, see the xfs(1)
+manual page.
+
+$Id: xfs.README.Debian 1244 2004-04-13 22:02:31Z branden $
+
+vim:set ai et sts=4 sw=4 tw=80:
Added: trunk/debian/xfs.init
===================================================================
--- trunk/debian/xfs.init 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.init 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,132 @@
+#!/bin/sh
+# /etc/init.d/xfs: start or stop the X font server
+
+set -e
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/bin/X11/xfs
+PIDFILE=/var/run/xfs.pid
+UPGRADEFILE=/var/run/xfs.daemon-not-stopped
+SOCKET_DIR=/tmp/.font-unix
+
+test -x $DAEMON || exit 0
+
+do_restorecon () {
+ # Restore file security context (SELinux).
+ if which restorecon >/dev/null 2>&1; then
+ restorecon "$1"
+ fi
+}
+
+set_up_socket_dir () {
+ echo -n "Setting up X font server socket directory $SOCKET_DIR..."
+ if [ -e $SOCKET_DIR ] && ! [ -d $SOCKET_DIR ]; then
+ mv $SOCKET_DIR $SOCKET_DIR.$$
+ fi
+ mkdir -p $SOCKET_DIR
+ chown 0:0 $SOCKET_DIR
+ chmod 1777 $SOCKET_DIR
+ do_restorecon $SOCKET_DIR
+ echo "done."
+}
+
+stillrunning () {
+ if expr "$(cat /proc/$DAEMONPID/cmdline 2>/dev/null)" : "$DAEMON" >/dev/null \
+ 2>&1; then
+ true
+ else
+ # if the daemon does not remove its own pidfile, we will
+ rm -f $PIDFILE $UPGRADEFILE
+ false
+ fi
+}
+
+# If we upgraded the daemon, we can't use the --exec argument to
+# start-stop-daemon since the inode will have changed. The risk here is that
+# in a situation where the daemon died, its pidfile was not cleaned up, and
+# some other process is now running under that pid, start-stop-daemon will send
+# signals to an innocent process. However, this seems like a corner case.
+# C'est la vie!
+if [ -e $UPGRADEFILE ]; then
+ SSD_START_ARGS="--pidfile $PIDFILE --startas $DAEMON"
+ SSD_STOP_ARGS="--pidfile $PIDFILE --name ${DAEMON#**/}"
+else
+ SSD_START_ARGS="--pidfile $PIDFILE --exec $DAEMON"
+ SSD_STOP_ARGS="$SSD_START_ARGS"
+fi
+
+case "$1" in
+ start)
+ set_up_socket_dir
+ echo -n "Starting X font server: xfs"
+ start-stop-daemon --start --quiet $SSD_START_ARGS -- -daemon \
+ || echo -n " already running"
+ echo "."
+ ;;
+
+ restart)
+ /etc/init.d/xfs stop
+ if [ -f $PIDFILE ]; then
+ if stillrunning; then
+ exit 1
+ fi
+ fi
+ /etc/init.d/xfs start
+ ;;
+
+ reload)
+ echo -n "Reloading X font server configuration..."
+ if start-stop-daemon --stop --signal 1 --quiet $SSD_STOP_ARGS; then
+ echo "done."
+ else
+ echo "xfs not running."
+ fi
+ ;;
+
+ force-reload)
+ /etc/init.d/xfs reload
+ ;;
+
+ stop)
+ echo -n "Stopping X font server: xfs"
+ if ! [ -f $PIDFILE ]; then
+ echo " not running ($PIDFILE not found)."
+ exit 0
+ else
+ DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
+ KILLCOUNT=1
+ if ! [ -e $UPGRADEFILE ]; then
+ if start-stop-daemon --stop --quiet $SSD_STOP_ARGS; then
+ # give xfs's signal handler a second to catch its breath
+ sleep 1
+ else
+ echo -n " not running"
+ fi
+ fi
+ while [ $KILLCOUNT -le 5 ]; do
+ if stillrunning; then
+ kill $DAEMONPID
+ else
+ break
+ fi
+ sleep 1
+ KILLCOUNT=$(( $KILLCOUNT + 1 ))
+ done
+ if stillrunning; then
+ echo -n " not responding to TERM signal (pid $DAEMONPID)"
+ else
+ rm -f $UPGRADEFILE
+ fi
+ fi
+ echo "."
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/xfs {start|stop|restart|reload|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=0:
Added: trunk/debian/xfs.install
===================================================================
--- trunk/debian/xfs.install 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.install 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,5 @@
+etc/X11/fs/config
+etc/X11/fs/xfs.options
+usr/X11R6/bin/xfs
+usr/X11R6/man/man1/xfs.1x
+usr/share/man/man5/xfs.options.5
Added: trunk/debian/xfs.links
===================================================================
--- trunk/debian/xfs.links 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.links 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1 @@
+etc/X11/fs usr/X11R6/lib/X11/fs
Added: trunk/debian/xfs.postinst.in
===================================================================
--- trunk/debian/xfs.postinst.in 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.postinst.in 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,70 @@
+#!/bin/sh
+# Debian xfs package post-installation script
+# Copyright 1998--2001, 2004 Branden Robinson.
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.
+
+# $Id: xfs.postinst.in 1593 2004-07-07 08:58:08Z branden $
+
+set -e
+
+# source debconf library
+. /usr/share/debconf/confmodule
+
+THIS_PACKAGE=xfs
+THIS_SCRIPT=postinst
+
+#INCLUDE_SHELL_LIB#
+
+check_symlinks_and_bomb /usr/X11R6/lib/X11/fs
+
+# now safe to finish migrations started in preinst
+if [ -e /usr/X11R6/lib/X11/fs.moved-by-preinst ] && \
+ [ -L /usr/X11R6/lib/X11/fs ]; then
+ rm -r /usr/X11R6/lib/X11/fs.moved-by-preinst
+fi
+if [ -e /etc/X11/xfs.moved-by-preinst ]; then
+ rm /etc/X11/xfs.moved-by-preinst
+fi
+
+# deal with a bug in very old versions of xbase
+for DIR in rc0.d rc1.d rc6.d; do
+ if [ -L "/etc/$DIR/K1xfs" ]; then
+ mv "/etc/$DIR/K1xfs" "/etc/$DIR/K01xfs"
+ fi
+done
+
+# Registering the init scripts or starting the daemon may cause output to
+# stdout, which can confuse debconf.
+db_stop
+
+if [ -e /etc/init.d/xfs ]; then
+ update-rc.d xfs defaults
+fi
+
+# If we are not installing, we may or may not need to restart the daemon, but we
+# always start the daemon on install.
+NOSTART=
+if ! [ -e /var/run/xfs.install ]; then
+ # Don't start the daemon if it wasn't stopped...
+ if [ -e /var/run/xfs.daemon-not-stopped ]; then
+ NOSTART=yes
+ fi
+ # ...or if the options file says not to.
+ if ! fgrep -qsx "restart-on-upgrade" /etc/X11/fs/xfs.options; then
+ NOSTART=yes
+ fi
+fi
+
+[ -n "$NOSTART" ] || invoke-rc.d xfs start || true
+
+#DEBHELPER#
+
+# Remove install flag file. Leave the "daemon not stopped" flag file, if it
+# exists, so that it will be seen by the init script.
+rm -f /var/run/xfs.install
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:
Added: trunk/debian/xfs.postrm.in
===================================================================
--- trunk/debian/xfs.postrm.in 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.postrm.in 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,67 @@
+#!/bin/sh
+# Debian xfs package post-removal script
+# Copyright 1998--2001, 2004 Branden Robinson.
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.
+
+# $Id: xfs.postrm.in 1257 2004-04-14 20:43:02Z branden $
+
+set -e
+
+THIS_PACKAGE=xfs
+THIS_SCRIPT=postrm
+
+#INCLUDE_SHELL_LIB#
+
+if [ "$1" = "abort-install" ] || [ "$1" = "abort-upgrade" ]; then
+ if [ -d /usr/X11R6/lib/X11/fs.moved-by-preinst ] && \
+ [ -L /usr/X11R6/lib/X11/fs ]; then
+ rm /usr/X11R6/lib/X11/fs
+ mv /usr/X11R6/lib/X11/fs.moved-by-preinst /usr/X11R6/lib/X11/fs
+ fi
+ if [ -e /etc/X11/xfs.moved-by-preinst ] && [ -d /etc/X11/fs ] && \
+ ! [ -e /etc/X11/xfs ]; then
+ mv /etc/X11/fs /etc/X11/xfs
+ rm /etc/X11/xfs.moved-by-preinst
+ fi
+
+fi
+
+if [ "$1" = "abort-install" ]; then
+ rm -f /var/run/xfs.install
+fi
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ]; then
+ update-rc.d xfs remove
+ if [ -d /etc/X11/fs ]; then
+ rm -r /etc/X11/fs
+ fi
+fi
+
+if [ "$1" = "abort-upgrade" ]; then
+ # NOTE: The following is copied from the postinst script and isn't necessary
+ # if dpkg executes a package's postinst script with the "configure" argument
+ # after unwinding from a failed upgrade. (See section 6.5 of the Debian
+ # Policy Manual, "Details of unpack phase of installation or upgrade".)
+
+ # Don't start the daemon if it wasn't stopped...
+ if [ -e /var/run/xfs.daemon-not-stopped ]; then
+ NOSTART=yes
+ fi
+ # ...or if the options file says not to.
+ if ! fgrep -qsx "restart-on-upgrade" /etc/X11/fs/xfs.options; then
+ NOSTART=yes
+ fi
+
+ [ -n "$NOSTART" ] || invoke-rc.d xfs start || true
+
+ # Remove flag files.
+ rm -f /var/run/xfs.install /var/run/xfs.daemon-not-stopped
+fi
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:
Added: trunk/debian/xfs.preinst.in
===================================================================
--- trunk/debian/xfs.preinst.in 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.preinst.in 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Debian xfs package pre-installation script
+# Copyright 1998--2001, 2004 Branden Robinson.
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.
+
+# $Id: xfs.preinst.in 1232 2004-04-12 00:18:02Z branden $
+
+set -e
+
+THIS_PACKAGE=xfs
+THIS_SCRIPT=preinst
+
+#INCLUDE_SHELL_LIB#
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ # fs dir moved to /etc/X11 in 4.x
+ if [ -e /usr/X11R6/lib/X11/fs ] && ! [ -L /usr/X11R6/lib/X11/fs ]; then
+ observe "removing obsolete /usr/X11R6/lib/X11/fs directory"
+ mv /usr/X11R6/lib/X11/fs /usr/X11R6/lib/X11/fs.moved-by-preinst
+ fi
+
+ # /etc/X11/xfs dir renamed to /etc/X11/fs in 4.x
+ if [ -d /etc/X11/xfs ] && ! [ -e /etc/X11/fs ]; then
+ observe "moving X font server configuration directory /etc/X11/xfs" \
+ "to /etc/X11/fs"
+ mv /etc/X11/xfs /etc/X11/fs
+ touch /etc/X11/xfs.moved-by-preinst
+ fi
+
+ check_symlinks_and_warn /usr/X11R6/lib/X11/fs
+fi
+
+if [ "$1" = "install" ]; then
+ # Create a flag file that tells the postinst script this is an install, not
+ # an upgrade.
+ : >/var/run/xfs.install
+fi
+
+#DEBHELPER#
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:
Added: trunk/debian/xfs.prerm.in
===================================================================
--- trunk/debian/xfs.prerm.in 2005-05-09 04:05:52 UTC (rev 48)
+++ trunk/debian/xfs.prerm.in 2005-05-09 04:07:05 UTC (rev 49)
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Debian xfs package pre-removal script
+# Copyright 1998--2001, 2004 Branden Robinson.
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.
+
+# $Id: xfs.prerm.in 1232 2004-04-12 00:18:02Z branden $
+
+set -e
+
+THIS_PACKAGE=xfs
+THIS_SCRIPT=prerm
+
+#INCLUDE_SHELL_LIB#
+
+case "$1" in
+ upgrade|failed-upgrade)
+ REMOVING=
+ ;;
+ remove|deconfigure)
+ REMOVING=yes
+ ;;
+esac
+
+STOP=
+# Are we supposed to restart on upgrade? If removing the package, we always
+# stop the daemon.
+if grep -qs ^restart-on-upgrade /etc/X11/fs/xfs.options || \
+ [ -n "$REMOVING" ]; then
+ STOP=yes
+fi
+
+if [ -n "$STOP" ]; then
+ invoke-rc.d xfs stop || true
+else
+ # Create a flag file that tells the postinst and postrm scripts that the
+ # daemon was not stopped.
+ : >/var/run/xfs.daemon-not-stopped
+fi
+
+#DEBHELPER#
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=80:
Reply to: