2 # $XTermId: minstall.sh,v 1.20 2010/03/03 23:44:49 tom Exp $
3 # -----------------------------------------------------------------------------
4 # this file is part of xterm
6 # Copyright 2001-2009,2010 by Thomas E. Dickey
10 # Permission is hereby granted, free of charge, to any person obtaining a
11 # copy of this software and associated documentation files (the
12 # "Software"), to deal in the Software without restriction, including
13 # without limitation the rights to use, copy, modify, merge, publish,
14 # distribute, sublicense, and/or sell copies of the Software, and to
15 # permit persons to whom the Software is furnished to do so, subject to
16 # the following conditions:
18 # The above copyright notice and this permission notice shall be included
19 # in all copies or substantial portions of the Software.
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
25 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 # Except as contained in this notice, the name(s) of the above copyright
30 # holders shall not be used in advertising or otherwise to promote the
31 # sale, use or other dealings in this Software without prior written
33 # -----------------------------------------------------------------------------
35 # Install manpages, substituting a reasonable section value since XFree86 4.x
36 # and derived imakes do not use constants...
39 # $1 = program to invoke as "install"
40 # $2 = manpage to install
41 # $3 = final installed-path
42 # $4 = app-defaults directory
47 LANGUAGE=C; export LANGUAGE
48 LC_ALL=C; export LC_ALL
49 LC_CTYPE=C; export LC_CTYPE
50 XTERM_LOCALE=C export XTERM_LOCALE
52 # avoid interference by the "man" command.
53 for p in /bin /usr/bin
55 if test -f $p/cat ; then
56 MANPAGER=cat; export MANPAGER
57 PAGER=cat; export PAGER
68 suffix=`echo "$END_FILE" | sed -e 's%^.*\.%%'`
73 # utmp and wtmp have different pathnames on different systems, but there
74 # are only a few common choices. Note that they may not necessarily appear
75 # in the same directories. Prefer utmpx/wtmpx to utmp/wtmp, since that's
76 # the way the configure script is designed.
79 for name in /etc /var/adm /var/run /var/log
81 if test -f $name/utmpx ; then
85 elif test -f $name/utmp ; then
90 UTMP_PATH=$UTMP_PATH/$UTMP_NAME
94 for name in /etc /var/adm /var/run /var/log
96 if test -f $name/wtmpx ; then
100 elif test -f $name/wtmp ; then
105 WTMP_PATH=$WTMP_PATH/$WTMP_NAME
107 # "X" is usually in the miscellaneous section, along with "undocumented".
108 # Use that to guess an appropriate section.
109 X_MANSECT=`man X 2>&1 | tr '\012' '\020' | sed -e 's/^[^0123456789]*\([^) ][^) ]*\).*/\1/'`
110 test -z "$X_MANSECT" && X_MANSECT=$suffix
112 sed -e 's%__vendorversion__%"X Window System"%' \
113 -e s%__apploaddir__%$APPS_DIR% \
114 -e s%__mansuffix__%$MY_MANSECT%g \
115 -e s%__miscmansuffix__%$X_MANSECT%g \
116 -e s%fIutmp'\\%fI'$UTMP_NAME'\\%g' \
117 -e s%/etc/utmp%$UTMP_PATH%g \
118 -e s%fIwtmp'\\%fI'$WTMP_NAME'\\%g' \
119 -e s%/etc/wtmp%$WTMP_PATH%g \
122 echo "$MINSTALL $OLD_FILE $END_FILE"
123 eval "$MINSTALL $NEW_FILE $END_FILE"