Author: dnusinow Date: 2005-12-02 00:13:08 -0500 (Fri, 02 Dec 2005) New Revision: 918
Added: branches/modular/font/util/debian/ branches/modular/font/util/debian/changelog branches/modular/font/util/debian/compat branches/modular/font/util/debian/control branches/modular/font/util/debian/copyright branches/modular/font/util/debian/local/ branches/modular/font/util/debian/local/update-fonts-alias branches/modular/font/util/debian/local/update-fonts-alias.8 branches/modular/font/util/debian/local/update-fonts-dir branches/modular/font/util/debian/local/update-fonts-dir.8 branches/modular/font/util/debian/local/update-fonts-scale branches/modular/font/util/debian/local/update-fonts-scale.8 branches/modular/font/util/debian/rules branches/modular/font/util/debian/xfonts-utils.install Log: * Add xfonts-utils packaging. Also include update-font* stuff from debian/local in the monolithic tree. I'm not sure I want to keep this package as-is, since it seems kind of silly. Suggestions? Added: branches/modular/font/util/debian/changelog =================================================================== --- branches/modular/font/util/debian/changelog 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/changelog 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,5 @@ +xfonts-utils (1:0.99.1-1) UNRELEASED; urgency=low + + * First upload to Debian + + -- David Nusinow <[EMAIL PROTECTED]> Mon, 31 Oct 2005 20:35:29 -0500 Added: branches/modular/font/util/debian/compat =================================================================== --- branches/modular/font/util/debian/compat 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/compat 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1 @@ +4 Added: branches/modular/font/util/debian/control =================================================================== --- branches/modular/font/util/debian/control 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/control 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,14 @@ +Source: xfonts-utils +Section: x11 +Priority: optional +Maintainer: Debian X Strike Force <[email protected]> +Uploaders: David Nusinow <[EMAIL PROTECTED]>, Branden Robinson <[EMAIL PROTECTED]>, Fabio M. Di Nitto <[EMAIL PROTECTED]> +Build-Depends: debhelper (>= 4.0.0), pkg-config +Standards-Version: 3.6.1.0 + +Package: xfonts-utils +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, x11-common +Description: utilities to set up fonts for the X11 + This package contains various items for running any font in X11. As such, + it is pre-depended on by many xfont packages. Added: branches/modular/font/util/debian/copyright =================================================================== --- branches/modular/font/util/debian/copyright 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/copyright 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,30 @@ +Copyright 2002-2004 Red Hat Inc., Durham, North Carolina. + +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation on the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The various update-font utilities are: + + Copyright 1999, 2001, 2002, 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>. Added: branches/modular/font/util/debian/local/update-fonts-alias =================================================================== --- branches/modular/font/util/debian/local/update-fonts-alias 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-alias 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,126 @@ +#!/bin/sh + +# $Id: update-fonts-alias 189 2005-06-11 00:04:27Z branden $ + +# This program compiles fonts.alias files for X font directories; see +# mkfontdir(1x) for a description of the format of fonts.alias files. + +# Copyright 1999, 2001, 2002, 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>. + +PROGNAME=${0##*/} + +# 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 "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} +} + +# Display a warning message. +warn () { + message "warning: $*" >&2 +} + +# Display an error message and exit. +die () { + message "fatal error: $*" >&2 + exit 1 +} + +# Display a usage message. +usage () { + if [ -n "$*" ]; then + message "usage error: $*" + fi + cat <<EOF +Usage: $PROGNAME DIRECTORY ... + $PROGNAME { -h | --help } +This program combines X font alias information from several packages into a +single file that is placed in each specified X font directory DIRECTORY. This +utility is primarily useful to Debian package maintainer scripts. See +update-fonts-alias(8) for more information. +Options: + -h, --help display this usage message and exit +EOF +} + +# Validate arguments. +case "$1" in + -h|--help) + usage + exit 0 + ;; + -*) + usage "unrecognized option" >&2 + exit 2 + ;; +esac + +if [ $# -eq 0 ]; then + usage "one or more font directories must be specified" >&2 + exit 2 +fi + +while [ -n "$1" ]; do + # Try to be clever about the argument; were we given an absolute path? + if expr "$1" : "/.*" >/dev/null 2>&1; then + # Yes; an absolute path to an X font directory was provided. + XDIR=$1 + ETCDIR=/etc/X11/fonts/${XDIR##*/} + if [ "$XDIR" = "$ETCDIR" ]; then + # We were given an /etc directory as an argument. + die "path to X font directory must be used" + else + warn "absolute path $XDIR was provided" + fi + else + # No; a relative path was provided -- assume we were given just the + # basename. + XDIR=/usr/lib/X11/fonts/$1 + ETCDIR=/etc/X11/fonts/$1 + fi + # Confirm that the directories to be operated on exist. + for DIR in "$XDIR" "$ETCDIR"; do + VALID=yes + if ! [ -d "$DIR" ]; then + warn "$DIR does not exist or is not a directory" + VALID= + fi + done + if [ -n "$VALID" ]; then + # Are there any files to process? + if [ "$(echo "$ETCDIR"/*.alias)" != "$ETCDIR/*.alias" ]; then + # Write the new alias file in a temporary location in case we are + # interrupted. + cat >"$XDIR/fonts.alias.update-new" <<EOF +!! fonts.alias -- automatically generated file. DO NOT EDIT. +!! To modify, see update-fonts-alias(8). +EOF + for FILE in "$ETCDIR"/*.alias; do + echo "!! $FILE" >>"$XDIR/fonts.alias.update-new" + cat "$FILE" >>"$XDIR/fonts.alias.update-new" + done + mv "$XDIR/fonts.alias.update-new" "$XDIR/fonts.alias" + else + # There are no files to process; remove any alias file already in + # the font directory. + rm -f "$XDIR/fonts.alias" + # Remove the font directory if it is empty. + rmdir "$XDIR" >/dev/null 2>&1 || true + fi + fi + shift +done + +exit 0 + +# vim:set ai et sts=4 sw=4 tw=80: Added: branches/modular/font/util/debian/local/update-fonts-alias.8 =================================================================== --- branches/modular/font/util/debian/local/update-fonts-alias.8 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-alias.8 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,171 @@ +.\" $Id: update-fonts-alias.8 189 2005-06-11 00:04:27Z branden $ +.\" +.\" Copyright 1999, 2002, 2004 Branden Robinson <[EMAIL PROTECTED]>. +.\" +.\" This 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. +.\" +.\" This is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" for more details. +.\" +.\" You should have received a copy of the GNU General Public License with +.\" the Debian operating system, in /usr/share/common-licenses/GPL; if +.\" not, write to the Free Software Foundation, Inc., 59 Temple Place, +.\" Suite 330, Boston, MA 02111-1307 USA +.\" +.\" We need the URL macro from groff's www macro package, but also want +.\" things to work all right for people who don't have it. So we define +.\" our own URL macro and let the www macro package override it if it's +.\" available. +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH update\-fonts\-alias 8 "2004\-11\-11" "Debian Project" +.SH NAME +update\-fonts\-alias \- compile fonts.alias files +.SH SYNOPSIS +.B update\-fonts\-alias +.I directory ... +.SH DESCRIPTION +.B update\-fonts\-alias +assembles a +.I fonts.alias +file in an X font directory using one or more alias files found in a +subdirectory of +.IR /etc/X11/fonts/ . +It is typically invoked only from the post\-installation and post\-removal +scripts of a +.I package +containing X Window System fonts that provide aliases for their XLFD names, +but may be invoked at any time to reconstruct +.I fonts.alias +files. +For each +.IR directory , +which is simply the last component of its path (such as \(oq75dpi\(cq or +\(oqmisc\(cq), +.B update\-fonts\-alias +will assemble +.IR /usr/lib/X11/fonts/ directory /fonts.alias +from the files found in +.IR /etc/X11/fonts/ directory / package .alias . +.PP +This enables multiple packages to provide aliases for fonts in the same +directory. +No font package actually provides the +.I fonts.alias +file in the X font directory itself, so there is no danger of overwriting +one package's aliases with those of another. +.PP +For instance, the two packages \(oqxfonts\-base\(cq and +\(oqxfonts\-base\-transcoded\(cq may both install fonts into the directory +.IR /usr/lib/X11/fonts/misc . +They each place their +.I fonts.alias +files in +.I /etc/X11/fonts/misc/xfonts\-base.alias +and +.I /etc/X11/fonts/misc/xfonts\-base\-transcoded.alias +(respectively). +.B update\-fonts\-alias +concatenates these two files (as well as any others that match +.IR /etc/X11/fonts/misc/*.alias ) +into +.IR /usr/lib/X11/fonts/misc/fonts.alias . +.PP +The format of +.I fonts.alias +files is described in the +.BR mkfontdir (1x) +manual page. +.PP +An example of how to use +.B update\-fonts\-alias +in package maintainer scripts is provided in the Debian Policy Manual. +.SH OPTIONS +.B \-h\fR, \fB\-\-help +displays a brief usage message and exits. +.SH OPERANDS +.B update\-fonts\-alias +takes one or more X font directory names to operate on as operands. +Only the final path component of the directory name should be specified; +e.g., +.RS +.B update\-fonts\-alias 75dpi +.RE +is correct, while +.RB \(oq "update\-fonts\-alias /usr/X11R6/lib/X11/fonts/75dpi" \(cq +and +.RB \(oq "update\-fonts\-alias /usr/lib/X11/fonts/75dpi" \(cq +are not. +.SH ENVIRONMENT +.TP +.B COLUMNS +indicates the width of the terminal device in character cells. +This value is used for formatting diagnostic messages. +If not set, the terminal is queried using +.BR stty (1) +to determine its width. +If that fails, a value of \(oq80\(cq is assumed. +.SH DIAGNOSTICS +.SS Errors +.TP +.B usage error: one or more font directories must be provided +.B update\-fonts\-alias +was invoked without operands. +Supply one or more X font directory names to operate on. +.TP +.B usage error: unrecognized option +.B update\-fonts\-alias +was invoked with an unrecognized option argument. +Use only the options documented in \(lqOPTIONS\(rq, above. +.TP +.B fatal error: path to X font directory must be used +A directory name was supplied that was not an X font directory name. +Supply X font directory names only. +.SS Warnings +.TP +.BI "warning: absolute path " directory " was provided" +Usage of absolute paths is deprecated. +Use only the final component of the X font directory name for +.IR directory . +.TP +.BI "warning: " directory " does not exist or is not a directory" +The supplied +.I directory +was invalid. +.B update\-fonts\-alias +skipped it. +.SH "EXIT STATUS" +.TP +0 +.B update\-fonts\-alias +ran successfully. +.TP +1 +.B update\-fonts\-alias +experienced a fatal error; see the section on diagnostic messages above. +.TP +2 +.B update\-fonts\-alias +was invoked with invalid arguments. +.SH BUGS +See +.URL "http://bugs.debian.org/xbase\-clients" "the Debian Bug Tracking System" . +If you wish to report a bug in +.BR update\-fonts\-alias , +please see +.I /usr/share/doc/debian/bug\-reporting.txt +or the +.BR reportbug (1) +command. +.SH AUTHOR +.B update\-fonts\-alias +was written by Branden Robinson. +.SH "SEE ALSO" +.BR mkfontdir (1x) +.\" vim:set et tw=80: Added: branches/modular/font/util/debian/local/update-fonts-dir =================================================================== --- branches/modular/font/util/debian/local/update-fonts-dir 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-dir 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,117 @@ +#!/bin/sh + +# $Id: update-fonts-dir 189 2005-06-11 00:04:27Z branden $ + +# This program compiles fonts.dir files for X font directories; see +# mkfontdir(1x) for a description of the format of fonts.dir files. + +# Copyright 1999, 2001, 2002, 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>. + +PROGNAME=${0##*/} +ENCDIR=/usr/X11R6/lib/X11/fonts/encodings +PATH=/usr/bin/X11:$PATH + +# 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 "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} +} + +# Display a warning message. +warn () { + message "warning: $*" >&2 +} + +# Display an error message and exit. +die () { + message "fatal error: $*" >&2 + exit 1 +} + +# Display a usage message. +usage () { + if [ -n "$*" ]; then + message "usage error: $*" + fi + cat <<EOF +Usage: $PROGNAME DIRECTORY ... + $PROGNAME { -h | --help } +This program is a wrapper for mkfontdir(1x) that is primarily useful to Debian +package maintainer scripts. See update-fonts-dir(8) for more information. +Options: + -h, --help display this usage message and exit +EOF +} + +# Validate arguments. +case "$1" in + -h|--help) + usage + exit 0 + ;; + -*) + usage "unrecognized option" >&2 + exit 2 + ;; +esac + +if [ $# -eq 0 ]; then + usage "one or more font directories must be specified" >&2 + exit 2 +fi + +while [ -n "$1" ]; do + # Try to be clever about the argument; were we given an absolute path? + if expr "$1" : "/.*" >/dev/null 2>&1; then + # Yes; an absolute path to an X font directory was provided. + XDIR=$1 + ETCDIR=/etc/X11/fonts/${XDIR##*/} + if [ "$XDIR" = "$ETCDIR" ]; then + # We were given an /etc directory as an argument. + die "path to X font directory must be used" + else + warn "absolute path $XDIR was provided" + fi + else + # No; a relative path was provided -- assume we were given just the + # basename. + XDIR=/usr/lib/X11/fonts/$1 + fi + # Confirm that the directories to be operated on exist. + VALID=yes + if ! [ -d "$XDIR" ]; then + warn "$XDIR does not exist or is not a directory" + VALID= + fi + if [ -n "$VALID" ]; then + # Use encoding directories if they are available. + if [ -d "$ENCDIR" ] && [ -d "$ENCDIR/large" ]; then + mkfontdir -e "$ENCDIR" -e "$ENCDIR/large" "$XDIR" + else + mkfontdir "$XDIR" + fi + # Are there any fonts in the font directory? + if [ "$(head -n 1 "$XDIR/fonts.dir")" = "0" ]; then + # There are no files to process; remove any generated files already + # in the font directory. + rm -f "$XDIR/fonts.dir" "$XDIR/encodings.dir" + # Remove the font dirextory if it is empty. + rmdir "$XDIR" >/dev/null 2>&1 || true + fi + fi + shift +done + +exit 0 + +# vim:set ai et sts=4 sw=4 tw=80: Added: branches/modular/font/util/debian/local/update-fonts-dir.8 =================================================================== --- branches/modular/font/util/debian/local/update-fonts-dir.8 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-dir.8 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,167 @@ +.\" $Id: update-fonts-dir.8 189 2005-06-11 00:04:27Z branden $ +.\" +.\" Copyright 1999, 2002-2004 Branden Robinson <[EMAIL PROTECTED]>. +.\" +.\" This 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. +.\" +.\" This is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" for more details. +.\" +.\" You should have received a copy of the GNU General Public License with +.\" the Debian operating system, in /usr/share/common-licenses/GPL; if +.\" not, write to the Free Software Foundation, Inc., 59 Temple Place, +.\" Suite 330, Boston, MA 02111-1307 USA +.\" +.\" We need the URL macro from groff's www macro package, but also want +.\" things to work all right for people who don't have it. So we define +.\" our own URL macro and let the www macro package override it if it's +.\" available. +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH update\-fonts\-dir 8 "2004\-11\-11" "Debian Project" +.SH NAME +update\-fonts\-dir \- compile fonts.dir files +.SH SYNOPSIS +.B update\-fonts\-dir +.I directory ... +.SH DESCRIPTION +.B update\-fonts\-dir +creates a +.I fonts.dir +file in an X font directory by invoking +.BR mkfontdir (1x) +with the appropriate arguments. +It is typically invoked only from the +post\-installation and post\-removal scripts of a +.I package +containing fonts for the X Window System, but may be invoked at any time to +reconstruct +.I fonts.dir +files. +For each +.IR directory , +which is simply the last component of its path (such as \(oq75dpi\(cq or +\(oqmisc\(cq), +.B update\-fonts\-dir +will generate +.IR /usr/lib/X11/fonts/ directory /fonts.dir +from the +.I fonts.scale +and font files found within it. +.PP +This enables multiple packages to provide names for fonts in the same +directory. +No font package actually provides the +.I fonts.dir +file in the X font directory itself, so there is no danger of overwriting +one package's font names with those of another. +.PP +For instance, the two packages \(oqxfonts\-base\(cq (real) and +\(oqxfonts\-nifty\(cq (hypothetical) may both install fonts into the +directory +.IR /usr/lib/X11/fonts/misc , +and +.B update\-fonts\-dir +will ensure that the +.I fonts.dir +file in that directory contains information about the font files provided +by both packages. +.PP +The format of +.I fonts.dir +files is described in the +.BR mkfontdir (1x) +manual page. +.PP +An example of how to use +.B update\-fonts\-dir +in package maintainer scripts is provided in the Debian Policy Manual. +.SH OPTIONS +.B \-h\fR, \fB\-\-help +displays a brief usage message and exits. +.SH OPERANDS +.B update\-fonts\-dir +takes one or more X font directory names to operate on as operands. +Only the final path component of the directory name should be specified; +e.g., +.RS +.B update\-fonts\-dir 75dpi +.RE +is correct, while +.RB \(oq "update\-fonts\-dir /usr/X11R6/lib/X11/fonts/75dpi" \(cq +and +.RB \(oq "update\-fonts\-dir /usr/lib/X11/fonts/75dpi" \(cq +are not. +.SH ENVIRONMENT +.TP +.B COLUMNS +indicates the width of the terminal device in character cells. +This value is used for formatting diagnostic messages. +If not set, the terminal is queried using +.BR stty (1) +to determine its width. +If that fails, a value of \(oq80\(cq is assumed. +.SH DIAGNOSTICS +.SS Errors +.TP +.B usage error: one or more font directories must be provided +.B update\-fonts\-dir +was invoked without operands. +Supply one or more X font directory names to operate on. +.TP +.B usage error: unrecognized option +.B update\-fonts\-dir +was invoked with an unrecognized option argument. +Use only the options documented in \(lqOPTIONS\(rq, above. +.TP +.B fatal error: path to X font directory must be used +A directory name was supplied that was not an X font directory name. +Supply X font directory names only. +.SS Warnings +.TP +.BI "warning: absolute path " directory " was provided" +Usage of absolute paths is deprecated. +Use only the final component of the X font directory name for +.IR directory . +.TP +.BI "warning: " directory " does not exist or is not a directory" +The supplied +.I directory +was invalid. +.B update\-fonts\-dir +skipped it. +.SH "EXIT STATUS" +.TP +0 +.B update\-fonts\-dir +ran successfully. +.TP +1 +.B update\-fonts\-dir +experienced a fatal error; see the section on diagnostic messages above. +.TP +2 +.B update\-fonts\-dir +was invoked with invalid arguments. +.SH BUGS +See +.URL "http://bugs.debian.org/xbase\-clients" "the Debian Bug Tracking System" . +If you wish to report a bug in +.BR update\-fonts\-dir , +please see +.I /usr/share/doc/debian/bug\-reporting.txt +or the +.BR reportbug (1) +command. +.SH AUTHOR +.B update\-fonts\-dir +was written by Branden Robinson. +.SH "SEE ALSO" +.BR mkfontdir (1x) +.\" vim:set et tw=80: Added: branches/modular/font/util/debian/local/update-fonts-scale =================================================================== --- branches/modular/font/util/debian/local/update-fonts-scale 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-scale 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,151 @@ +#!/bin/sh + +# $Id: update-fonts-scale 189 2005-06-11 00:04:27Z branden $ + +# This program generates fonts.scale files for X font directories; see +# mkfontdir(1x) for a description of the format of fonts.scale files. + +# Copyright 1999-2002, 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>. + +PROGNAME=${0##*/} + +# 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 "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} +} + +# Display a debugging message. +trace () { + if [ -n "$DEBUG" ]; then + message "note: $*" >&2 + fi +} + +# Display a warning message. +warn () { + message "warning: $*" >&2 +} + +# Display an error message and exit. +die () { + message "fatal error: $*" >&2 + exit 1 +} + +# Display a usage message. +usage () { + if [ -n "$*" ]; then + message "usage error: $*" + fi + cat <<EOF +Usage: $PROGNAME DIRECTORY ... + $PROGNAME { -h | --help } +This program combines scalable X font information from several packages into a +single file that is placed in each specified X font directory DIRECTORY. This +utility is primarily useful to Debian package maintainer scripts. See +update-fonts-scale(8) for more information. +Options: + -h, --help display this usage message and exit +EOF +} + +# Validate arguments. +case "$1" in + -h|--help) + usage + exit 0 + ;; + -*) + usage "unrecognized option" >&2 + exit 2 + ;; +esac + +if [ $# -eq 0 ]; then + usage "one or more font directories must be specified" >&2 + exit 2 +fi + +while [ -n "$1" ]; do + # Try to be clever about the argument; were we given an absolute path? + if expr "$1" : "/.*" >/dev/null 2>&1; then + # Yes; an absolute path to an X font directory was provided. + XDIR=$1 + ETCDIR=/etc/X11/fonts/${XDIR##*/} + if [ "$XDIR" = "$ETCDIR" ]; then + # We were given an /etc directory as an argument. + die "path to X font directory must be used" + else + warn "absolute path $XDIR was provided" + fi + else + # No; a relative path was provided -- assume we were given just the + # basename. + XDIR=/usr/lib/X11/fonts/$1 + ETCDIR=/etc/X11/fonts/$1 + fi + # Confirm that the directories to be operated on exist. + for DIR in "$XDIR" "$ETCDIR"; do + VALID=yes + if ! [ -d "$DIR" ]; then + warn "$DIR does not exist or is not a directory" + VALID= + fi + done + if [ -n "$VALID" ]; then + # Are there any files to process? + if [ "$(echo "$ETCDIR"/*.scale)" != "$ETCDIR/*.scale" ]; then + for SCALEFILE in "$ETCDIR"/*.scale; do + # Only write fonts to the .scale file that actually exist, so + # that removed-but-not-purged scalable font packages do not + # register nonexistent fonts; this has the desirable side effect + # that the count at the top of the file is also omitted. + # + # XXX: This technique will be tricked into yielding false + # negatives if the font filename has whitespace in it. + while read FONTFILE FONTNAME; do + if [ -f "$XDIR/$FONTFILE" ]; then + echo "$FONTFILE $FONTNAME" \ + >>"$XDIR/fonts.scale.update-tmp" + else + trace "$SCALEFILE references nonexistent font file" \ + "$FONTFILE; skipping" + fi + done <"$SCALEFILE" + done + if [ -e "$XDIR/fonts.scale.update-tmp" ]; then + # Write the new scale file to a temporary location in case we + # are interrupted. Write the new count to the top of file. Use + # cat and pipe to wc so wc doesn't report the filename. + cat "$XDIR/fonts.scale.update-tmp" | wc -l | tr -d '[:blank:]' \ + >"$XDIR/fonts.scale.update-new" + cat "$XDIR/fonts.scale.update-tmp" \ + >>"$XDIR/fonts.scale.update-new" + mv "$XDIR/fonts.scale.update-new" "$XDIR/fonts.scale" + rm "$XDIR/fonts.scale.update-tmp" + fi + else + # No files to process; remove any fonts.scale file already in the + # font directory. + rm -f "$XDIR/fonts.scale" + # Remove the font directory if it is empty. + rmdir "$XDIR" >/dev/null 2>&1 || true + fi + fi + shift +done + +exit 0 + +# vim:set ai et sts=4 sw=4 tw=80: Added: branches/modular/font/util/debian/local/update-fonts-scale.8 =================================================================== --- branches/modular/font/util/debian/local/update-fonts-scale.8 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/local/update-fonts-scale.8 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,195 @@ +.\" $Id: update-fonts-scale.8 189 2005-06-11 00:04:27Z branden $ +.\" +.\" Copyright 1999, 2002, 2004 Branden Robinson <[EMAIL PROTECTED]>. +.\" +.\" This 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. +.\" +.\" This is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" for more details. +.\" +.\" You should have received a copy of the GNU General Public License with +.\" the Debian operating system, in /usr/share/common-licenses/GPL; if +.\" not, write to the Free Software Foundation, Inc., 59 Temple Place, +.\" Suite 330, Boston, MA 02111-1307 USA +.\" +.\" We need the URL macro from groff's www macro package, but also want +.\" things to work all right for people who don't have it. So we define +.\" our own URL macro and let the www macro package override it if it's +.\" available. +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH update\-fonts\-scale 8 "2004\-11\-12" "Debian Project" +.SH NAME +update\-fonts\-scale \- generate fonts.scale files +.SH SYNOPSIS +.B update\-fonts\-scale +.I directory ... +.SH DESCRIPTION +.B update\-fonts\-scale +assembles a +.I fonts.scale +file in an X font directory using one or more scale files found in a +subdirectory of +.IR /etc/X11/fonts/ . +It is typically invoked only from the post\-installation and post\-removal +scripts of a package containing scalable fonts usable by the X Window +System whose X LFD font names are not in the font files themselves, but may +be invoked at any time to reconstruct +.I fonts.scale +files. +For each +.IR directory , +which is either an absolute path to an X font directory or (preferably) +simply the last component of its path (such as \(oq75dpi\(cq or +\(oqmisc\(cq), +.B update\-fonts\-scale +will assemble +.IR /usr/lib/X11/fonts/ directory /fonts.scale +from the index files found at +.IR /etc/X11/fonts/ directory / package .scale , +where +.I package +is the name of the package installing the fonts. +.PP +This enables multiple packages to provide names for fonts in the same +directory. +No font package actually provides the +.I fonts.scale +file in the X font directory itself, so there is no danger of overwriting +one package's font names with those of another. +.PP +For instance, the two packages \(oqxfonts\-scalable\(cq (real) and +\(oqxfonts\-nifty\(cq (hypothetical) may both install fonts into the +directory +.IR /usr/lib/X11/fonts/Type1 . +They each place their +.I fonts.scale +files in +.I /etc/X11/fonts/Type1/xfonts\-scalable.scale +and +.I /etc/X11/fonts/Type1/xfonts\-nifty.scale +(respectively). +.B update\-fonts\-scale +concatenates these two files (as well as any others that match +.IR /etc/X11/fonts/Type1/*.scale ) +into +.IR /usr/lib/X11/fonts/Type1/fonts.scale . +.PP +The format for +.I fonts.scale +files is given in the +.BR mkfontdir (1x) +manual page. +.PP +An example of how to use +.B update\-fonts\-scale +in package maintainer scripts is provided in the Debian Policy Manual. +.SH OPTIONS +.B \-h\fR, \fB\-\-help +displays a brief usage message and exits. +.SH OPERANDS +.B update\-fonts\-scale +takes one or more X font directory names to operate on as operands. +Only the final path component of the directory name should be specified; +e.g., +.RS +.B update\-fonts\-scale 75dpi +.RE +is correct, while +.RB \(oq "update\-fonts\-scale /usr/X11R6/lib/X11/fonts/75dpi" \(cq +and +.RB \(oq "update\-fonts\-scale /usr/lib/X11/fonts/75dpi" \(cq +are not. +.SH ENVIRONMENT +.TP +.B COLUMNS +indicates the width of the terminal device in character cells. +This value is used for formatting diagnostic messages. +If not set, the terminal is queried using +.BR stty (1) +to determine its width. +If that fails, a value of \(oq80\(cq is assumed. +.TP +.B DEBUG +determines whether low\-level diagnostic messages are issued to standard error +output. +A null (empty) or unset value indicates that they are not, and a non\-null +value indicates that they are. +.SH DIAGNOSTICS +.SS Errors +.TP +.B usage error: one or more font directories must be provided +.B update\-fonts\-scale +was invoked without operands. +Supply one or more X font directory names to operate on. +.TP +.B usage error: unrecognized option +.B update\-fonts\-scale +was invoked with an unrecognized option argument. +Use only the options documented in \(lqOPTIONS\(rq, above. +.TP +.B fatal error: path to X font directory must be used +A directory name was supplied that was not an X font directory name. +Supply X font directory names only. +.SS Warnings +.TP +.BI "warning: absolute path " directory " was provided" +Usage of absolute paths is deprecated. +Use only the final component of the X font directory name for +.IR directory . +.TP +.BI "warning: " directory " does not exist or is not a directory" +The supplied +.I directory +was invalid. +.B update\-fonts\-scale +skipped it. +.SS Notes +Notes are only displayed under special circumstances; see \(lqENVIRONMENT\(rq. +above. +.TP +.BI "note: " index " references nonexistent font file " filename +The index file +.IR /etc/X11/fonts/ directory / package .scale , +refers to a nonexistent font file, +.IR filename . +This is normal when +.I package +has been removed, but not purged from the system. +In other circumstances, it likely indicates an error in +.IR package . +.SH "EXIT STATUS" +.TP +0 +.B update\-fonts\-scale +ran successfully. +.TP +1 +.B update\-fonts\-scale +experienced a fatal error; see the section on diagnostic messages above. +.TP +2 +.B update\-fonts\-scale +was invoked with invalid arguments. +.SH BUGS +See +.URL "http://bugs.debian.org/xbase\-clients" "the Debian Bug Tracking System" . +If you wish to report a bug in +.BR update\-fonts\-scale , +please see +.I /usr/share/doc/debian/bug\-reporting.txt +or the +.BR reportbug (1) +command. +.SH AUTHOR +.B update\-fonts\-scale +was written by Branden Robinson. +.SH "SEE ALSO" +.BR mkfontdir (1x) +.\" vim:set et tw=80: Added: branches/modular/font/util/debian/rules =================================================================== --- branches/modular/font/util/debian/rules 2005-12-02 03:20:31 UTC (rev 917) +++ branches/modular/font/util/debian/rules 2005-12-02 05:13:08 UTC (rev 918) @@ -0,0 +1,93 @@ +#!/usr/bin/make -f +# debian/rules for the Debian libdmx package. +# Copyright © 2004 Scott James Remnant <[EMAIL PROTECTED]> +# Copyright © 2005 Daniel Stone <[EMAIL PROTECTED]> +# Copyright © 2005 David Nusinow <[EMAIL PROTECTED]> + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# set this to the name of the main shlib's binary package +PACKAGE = fontutil + +include debian/xsfbs/xsfbs.mk + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_HOST_GNU_TYPE) +else + confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + + +build: build-stamp +build-stamp: + dh_testdir + + mkdir obj-$(DEB_BUILD_GNU_TYPE) + cd obj-$(DEB_BUILD_GNU_TYPE) && \ + ../configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info $(confflags) \ + CFLAGS="$(CFLAGS)" + cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + rm -f config.cache config.log config.status + rm -f */config.cache */config.log */config.status + rm -f conftest* */conftest* + rm -rf autom4te.cache */autom4te.cache + rm -rf obj-* + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + + dh_installdocs + dh_install --sourcedir=debian/tmp + dh_installchangelogs + dh_link + dh_strip --dbg-package=$(PACKAGE) + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_makeshlibs + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-independent files here. +binary-indep: build install +# Nothing to do + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install Property changes on: branches/modular/font/util/debian/rules ___________________________________________________________________ Name: svn:executable + * Added: branches/modular/font/util/debian/xfonts-utils.install =================================================================== -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

