1166124Srafan#!/bin/sh
2166124Srafan##############################################################################
3166124Srafan# Copyright (c) 2004 Free Software Foundation, Inc.                          #
4166124Srafan#                                                                            #
5166124Srafan# Permission is hereby granted, free of charge, to any person obtaining a    #
6166124Srafan# copy of this software and associated documentation files (the "Software"), #
7166124Srafan# to deal in the Software without restriction, including without limitation  #
8166124Srafan# the rights to use, copy, modify, merge, publish, distribute, distribute    #
9166124Srafan# with modifications, sublicense, and/or sell copies of the Software, and to #
10166124Srafan# permit persons to whom the Software is furnished to do so, subject to the  #
11166124Srafan# following conditions:                                                      #
12166124Srafan#                                                                            #
13166124Srafan# The above copyright notice and this permission notice shall be included in #
14166124Srafan# all copies or substantial portions of the Software.                        #
15166124Srafan#                                                                            #
16166124Srafan# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17166124Srafan# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
18166124Srafan# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
19166124Srafan# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
20166124Srafan# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
21166124Srafan# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
22166124Srafan# DEALINGS IN THE SOFTWARE.                                                  #
23166124Srafan#                                                                            #
24166124Srafan# Except as contained in this notice, the name(s) of the above copyright     #
25166124Srafan# holders shall not be used in advertising or otherwise to promote the sale, #
26166124Srafan# use or other dealings in this Software without prior written               #
27166124Srafan# authorization.                                                             #
28166124Srafan##############################################################################
29166124Srafan#
30166124Srafan# Author: Thomas E. Dickey
31166124Srafan#
32166124Srafan# $Id: gen_edit.sh,v 1.1 2004/07/11 15:01:29 tom Exp $
33166124Srafan# Generate a sed-script for converting the terminfo.src to the form which will
34166124Srafan# be installed.
35166124Srafan#
36166124Srafan# Assumes:
37166124Srafan#	The leaf directory names (lib, tabset, terminfo)
38166124Srafan#
39166124Srafan
40166124Srafan: ${ticdir=@TERMINFO@}
41166124Srafan: ${xterm_new=@WHICH_XTERM@}
42166124Srafan
43166124Srafan# If we're not installing into /usr/share/, we'll have to adjust the location
44166124Srafan# of the tabset files in terminfo.src (which are in a parallel directory).
45166124SrafanTABSET=`echo $ticdir | sed -e 's%/terminfo$%/tabset%'`
46166124Srafanif test "x$TABSET" != "x/usr/share/tabset" ; then
47166124Srafancat <<EOF
48166124Srafans%/usr/share/tabset%$TABSET%g
49166124SrafanEOF
50166124Srafanfi
51166124Srafan
52166124Srafanif test "$xterm_new" != "xterm-new" ; then
53166124Srafancat <<EOF
54166124Srafan/^# This is xterm for ncurses/,/^$/{
55166124Srafan	s/use=xterm-new,/use=$WHICH_XTERM,/
56166124Srafan}
57166124SrafanEOF
58166124Srafanfi
59