2 ##############################################################################
3 # Copyright (c) 1998,2000 Free Software Foundation, Inc. #
5 # Permission is hereby granted, free of charge, to any person obtaining a #
6 # copy of this software and associated documentation files (the "Software"), #
7 # to deal in the Software without restriction, including without limitation #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the #
11 # following conditions: #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software. #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
22 # DEALINGS IN THE SOFTWARE. #
24 # Except as contained in this notice, the name(s) of the above copyright #
25 # holders shall not be used in advertising or otherwise to promote the sale, #
26 # use or other dealings in this Software without prior written #
28 ##############################################################################
30 # Author: Thomas E. Dickey 1996,2000
32 # $Id: run_tic.in,v 1.10 2000/10/09 22:57:35 tom Exp $
33 # This script is used to install terminfo.src using tic. We use a script
34 # because the path checking is too awkward to do in a makefile.
37 # The leaf directory names (lib, tabset, terminfo)
39 echo '** Building terminfo database, please wait...'
41 # The script is designed to be run from the misc/Makefile as
44 : ${suffix=@PROG_EXT@}
45 : ${DESTDIR=@DESTDIR@}
47 : ${exec_prefix=@exec_prefix@}
49 : ${top_srcdir=@top_srcdir@}
51 : ${datadir=@datadir@}
52 : ${ticdir=@TERMINFO@}
53 : ${source=@TERMINFO_SRC@}
56 test -z "${DESTDIR}" && DESTDIR=
58 # Allow tic to run either from the install-path, or from the build-directory
60 :*) PATH=../progs:${DESTDIR}$bindir$PATH ;;
61 *) PATH=../progs:${DESTDIR}$bindir:$PATH ;;
66 # set another env var that doesn't get reset when `shlib' runs, so `shlib' uses
67 # the PATH we just set.
71 PROG_BIN_DIR=${DESTDIR}$bindir
74 TERMINFO=${DESTDIR}$ticdir ; export TERMINFO
77 # Construct the name of the old (obsolete) pathname, e.g., /usr/lib/terminfo.
78 TICDIR=`echo $TERMINFO | sed -e 's@/share/@/lib/@'`
80 # Remove the old terminfo stuff; we don't care if it existed before, and it
81 # would generate a lot of confusing error messages if we tried to overwrite it.
82 # We explicitly remove its contents rather than the directory itself, in case
83 # the directory is actually a symbolic link.
84 ( cd $TERMINFO && rm -fr ? 2>/dev/null )
86 # If we're not installing into /usr/share/, we'll have to adjust the location
87 # of the tabset files in terminfo.src (which are in a parallel directory).
88 TABSET=`echo $ticdir | sed -e 's@/terminfo$@/tabset@'`
89 if test "x$TABSET" != "x/usr/share/tabset" ; then
90 echo '** adjusting tabset paths'
92 sed -e s:/usr/share/tabset:$TABSET:g $source >$TMP
93 trap "rm -f $TMP" 0 1 2 5 15
98 Running tic to install $TERMINFO ...
100 You may see messages regarding unknown capabilities, e.g., AX.
101 These are extended terminal capabilities which can be compiled
104 Read the INSTALL document before doing this - it can cause
105 problems for older ncurses applications.
108 if ( $srcdir/shlib tic$suffix -s -o $TERMINFO $source )
110 echo '** built new '$TERMINFO
112 echo '? tic could not build '$TERMINFO
116 # Make a symbolic link to provide compatibility with applications that expect
117 # to find terminfo under /usr/lib. That is, we'll _try_ to do that. Not
118 # all systems support symbolic links, and those that do provide a variety
119 # of options for 'test'.
120 if test "$TICDIR" != "$TERMINFO" ; then
121 ( rm -f $TICDIR 2>/dev/null )
122 if ( cd $TICDIR 2>/dev/null )
126 if test $TICDIR != $TERMINFO ; then
127 # Well, we tried. Some systems lie to us, so the
128 # installer will have to double-check.
129 echo "Verify if $TICDIR and $TERMINFO are the same."
130 echo "The new terminfo is in $TERMINFO; the other should be a link to it."
131 echo "Otherwise, remove $TICDIR and link it to $TERMINFO."
135 # Construct a symbolic link that only assumes $ticdir has the
136 # same $prefix as the other installed directories.
137 RELATIVE=`echo $ticdir|sed -e 's:^'$prefix'/::'`
138 if test "$RELATIVE" != "$ticdir" ; then
139 RELATIVE=../`echo $ticdir|sed -e 's:^'$prefix'/::' -e 's:^/::'`
141 if ( @LN_S@ $RELATIVE $TICDIR )
143 echo '** linked '$TICDIR' for compatibility'