summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/xypic/support/install-tds
blob: be7e1dd02a0b110348ba38b88ec30d1cd6bc7047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/sh
# $Id: install-tds,v 3.14 2010/07/06 22:43:56 krisrose Exp $
#
# sh(1) installation of Xy-pic into a TeX Directory Structure system.
# Copyright (c) 1997  Kristoffer H. Rose  <krisrose@tug.org>
#
# This file is part of the Xy-pic macro package.
# Copyright (c) 1991-2010  Kristoffer H. Rose  <krisrose@tug.org>
# See the README and INSTALL files for further information.
#
# The Xy-pic package 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; either version 2 of the License, or (at your
# option) any later version.
#
# The Xy-pic package 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 along
# with this package; if not, see http://www.gnu.org/licenses/.

# check that we are in the right place (and get version :)

# greet
echo ''
echo ' Welcome to the Xy-pic TDS-compliant installation script!'
echo ' Copyright (c) 1997-1998 by krisrose@tug.org'
echo ' Xy-pic is free software: see the User's Guide for details.'
echo ''
echo ' The author has seriously tried to ensure the portability of'
echo ' this script among all un*x platforms, however, if you experience'
echo ' problems then don't hesitate to contact me.'
echo ''
echo ' See the file INSTALL for details about what this script does.'

# record the argument as TEXMF
: ${TEXMF:=$1}

# if no TEXMF specified try to figure it out
: ${TEXMF:=`kpsewhich --expand-var='$TEXMFMAIN' 2>/dev/null`}
: ${TEXMF:=`kpsexpand '$TEXMFMAIN' 2>/dev/null`}
: ${TEXMF:=`kpsewhich --expand-var='$TEXMF' 2>/dev/null`}
: ${TEXMF:=`kpsexpand '$TEXMF' 2>/dev/null`}

if [ -d "$TEXMF" ]
then
    echo ''
    echo "TEXMF directory $TEXMF found."
else
    echo ''
    echo 'ERROR: I could not find the TEXMF directory (tried '"$TEXMF"')!' >&2
    echo 'Usage: ./support/install-tds [TEXMF]' >&2
    echo 'Xy-pic installation aborted.'
    exit 2
fi

# get confirmation
echo ''
echo ' This script will install Xy-pic under the indicated TEXMF tree.'
echo ' We assume that it is the root of a standard TeX Directory Structure.'
echo ''
echo ' Also we asume that the commands find, grep, mkdir, and cp, conform'
echo ' to their POSIX specification and can be found in the standard path.'
echo ''
echo 'Type <enter> to continue (anything else to stop - this is your last chance):'
read reply
if [ -z "$reply" ];
then
    echo ''
    echo 'Thanks: proceeding with the installation.'
else
    echo 'Xy-pic installation aborted.'
    exit 1
fi

# warn user about obsolete files
echo ''
echo 'Checking for obsolete files.'
if [ -d "$TEXMF/dvips/xypic" ]
then

    files=`find "$TEXMF/dvips" -name "xy*.map" -print 2>/dev/null`
    if [ -n "$files" ]
    then
	echo 'WARNING: xy*.map files exist:'
	echo $files
    fi

    files=`find "$TEXMF/dvips" -name psfonts.map -print 2>/dev/null`
    files=`grep -svl '^xy' $files /dev/null`
    if [ -n "$files" ]
    then
	echo 'WARNING: psfonts.map xy*-font mappings exist in:'
	echo "$files"
    fi

    files=`find "$TEXMF/fonts/type1" -name "xy*.pf?" -print 2>/dev/null \
	   | grep -v "$TEXMF/fonts/type1/public/xypic/xy.*[.]pfb"`
    if [ -n "$files" ]
    then
	echo 'WARNING: xy*.pfa or xy*.pfb files exist:'
	echo "$files"
    fi

fi

# function for installing simple files in a directory
installd () {
    text=$1; shift
    dir=`eval 'echo ${'$#'}'`	# extract last parameter
    echo "Installing $text in $dir."
    if mkdir -p "$dir"; then cp -f "$@"
    else
	echo ' WARNING: could not make directory - files not installed.'
    fi
}

# do the actual installation
echo ''
echo 'Installing Xy-pic!'

installd "1. administrivia" \
    README CATALOG TRAILER INSTALL MANIFEST VERSIONS *COPYING \
    Xy-pic.html Xy-logo.png \
    "$TEXMF/doc/generic/xypic"
installd "2. macros"             texinputs/*    "$TEXMF/tex/generic/xypic"
installd "3. font metrics"	 texfonts/*.tfm "$TEXMF/fonts/tfm/public/xypic"
installd "4. font sources"	 mfinputs/*.mf  "$TEXMF/fonts/source/public/xypic"
installd "5. ps type1 fonts"     type1/*.pfb    "$TEXMF/fonts/type1/public/xypic"
installd "6. ps pfm fonts"	 pfm/*.pfm      "$TEXMF/fonts/pfm/public/xypic"
installd "7. afm metrics"        afm/*.afm      "$TEXMF/fonts/afm/public/xypic"
installd "8. ps headers" 	 ps/*           "$TEXMF/dvips/xypic"
installd "9. ps font maps" 	 map/*          "$TEXMF/fonts/map/dvips/xypic"
installd "10. ps font encodings" enc/*          "$TEXMF/fonts/enc/dvips/xypic"
installd "11. documentation"     doc/xyguide.pdf doc/xyrefer.pdf "$TEXMF/doc/generic/xypic"

# done
echo "Xy-pic installation done."
exit

# $Log: install-tds,v $
# Revision 3.14  2010/07/06 22:43:56  krisrose
# Release 3.8.3.
#
# Revision 3.13  2010/06/10 18:45:49  krisrose
# Reference to GPL by URL.
#
# Revision 3.12  2010/06/08 07:28:43  krisrose
# Identify .map file.
#
# Revision 3.11  2010/06/07 04:16:53  krisrose
# Fix forgotten enc files.
#
# Revision 3.10  2010/05/09 22:11:05  krisrose
# Loose /usr/bin prefixes.
#
# Revision 3.9  2010/04/22 14:52:09  krisrose
# Documentation up to date. Install PDF encoding files and XYLU metric files.
#
# Revision 3.8  2010/04/16 06:06:51  krisrose
# Preparing for a new release...
#
# Revision 3.7  1999/02/16 15:12:50  krisrose
# Interim release (Y&Y fonts now free).
#
# New with release 3.5...changed significantly for 3.6.