| 1 | #!/bin/sh |
| 2 | # $Id: install-tds,v 3.16 2011/03/14 20:14:00 krisrose Exp $ |
| 3 | # |
| 4 | # sh(1) installation of Xy-pic into a TeX Directory Structure system. |
| 5 | # Copyright (c) 1997 Kristoffer H. Rose <[email protected]> |
| 6 | # |
| 7 | # This file is part of the Xy-pic macro package. |
| 8 | # Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]> |
| 9 | # See the README and INSTALL files for further information. |
| 10 | # |
| 11 | # The Xy-pic package is free software; you can redistribute it and/or modify |
| 12 | # it under the terms of the GNU General Public License as published by the |
| 13 | # Free Software Foundation; either version 2 of the License, or (at your |
| 14 | # option) any later version. |
| 15 | # |
| 16 | # The Xy-pic package is distributed in the hope that it will be useful, but |
| 17 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 18 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 19 | # for more details. |
| 20 | # |
| 21 | # You should have received a copy of the GNU General Public License along |
| 22 | # with this package; if not, see http://www.gnu.org/licenses/. |
| 23 | |
| 24 | # check that we are in the right place (and get version :) |
| 25 | |
| 26 | # greet |
| 27 | echo '' |
| 28 | echo ' Welcome to the Xy-pic TDS-compliant installation script!' |
| 29 | echo ' Copyright (c) 1997-1998 by [email protected]' |
| 30 | echo ' Xy-pic is free software: see the User's Guide for details.' |
| 31 | echo '' |
| 32 | echo ' The author has seriously tried to ensure the portability of' |
| 33 | echo ' this script among all un*x platforms, however, if you experience' |
| 34 | echo ' problems then don't hesitate to contact me.' |
| 35 | echo '' |
| 36 | echo ' See the file INSTALL for details about what this script does.' |
| 37 | |
| 38 | # record the argument as TEXMF |
| 39 | : ${TEXMF:=$1} |
| 40 | |
| 41 | # if no TEXMF specified try to figure it out |
| 42 | : ${TEXMF:=`kpsewhich --expand-var='$TEXMFMAIN' 2>/dev/null`} |
| 43 | : ${TEXMF:=`kpsexpand '$TEXMFMAIN' 2>/dev/null`} |
| 44 | : ${TEXMF:=`kpsewhich --expand-var='$TEXMF' 2>/dev/null`} |
| 45 | : ${TEXMF:=`kpsexpand '$TEXMF' 2>/dev/null`} |
| 46 | |
| 47 | if [ -d "$TEXMF" ] |
| 48 | then |
| 49 | echo '' |
| 50 | echo "TEXMF directory $TEXMF found." |
| 51 | else |
| 52 | echo '' |
| 53 | echo 'ERROR: I could not find the TEXMF directory (tried '"$TEXMF"')!' >&2 |
| 54 | echo 'Usage: ./support/install-tds [TEXMF]' >&2 |
| 55 | echo 'Xy-pic installation aborted.' |
| 56 | exit 2 |
| 57 | fi |
| 58 | |
| 59 | # get confirmation |
| 60 | echo '' |
| 61 | echo ' This script will install Xy-pic under the indicated TEXMF tree.' |
| 62 | echo ' We assume that it is the root of a standard TeX Directory Structure.' |
| 63 | echo '' |
| 64 | echo ' Also we asume that the commands find, grep, mkdir, and cp, conform' |
| 65 | echo ' to their POSIX specification and can be found in the standard path.' |
| 66 | echo '' |
| 67 | echo 'Type <enter> to continue (anything else to stop - this is your last chance):' |
| 68 | read reply |
| 69 | if [ -z "$reply" ]; |
| 70 | then |
| 71 | echo '' |
| 72 | echo 'Thanks: proceeding with the installation.' |
| 73 | else |
| 74 | echo 'Xy-pic installation aborted.' |
| 75 | exit 1 |
| 76 | fi |
| 77 | |
| 78 | # warn user about obsolete files |
| 79 | echo '' |
| 80 | echo 'Checking for obsolete files.' |
| 81 | if [ -d "$TEXMF/dvips/xypic" ] |
| 82 | then |
| 83 | |
| 84 | files=`find "$TEXMF/dvips" -name "xy*.map" -print 2>/dev/null` |
| 85 | if [ -n "$files" ] |
| 86 | then |
| 87 | echo 'WARNING: xy*.map files exist:' |
| 88 | echo $files |
| 89 | fi |
| 90 | |
| 91 | files=`find "$TEXMF/dvips" -name psfonts.map -print 2>/dev/null` |
| 92 | files=`grep -svl '^xy' $files /dev/null` |
| 93 | if [ -n "$files" ] |
| 94 | then |
| 95 | echo 'WARNING: psfonts.map xy*-font mappings exist in:' |
| 96 | echo "$files" |
| 97 | fi |
| 98 | |
| 99 | files=`find "$TEXMF/fonts/type1" -name "xy*.pf?" -print 2>/dev/null \ |
| 100 | | grep -v "$TEXMF/fonts/type1/public/xypic/xy.*[.]pfb"` |
| 101 | if [ -n "$files" ] |
| 102 | then |
| 103 | echo 'WARNING: xy*.pfa or xy*.pfb files exist:' |
| 104 | echo "$files" |
| 105 | fi |
| 106 | |
| 107 | fi |
| 108 | |
| 109 | # function for installing simple files in a directory |
| 110 | installd () { |
| 111 | text=$1; shift |
| 112 | dir=`eval 'echo ${'$#'}'` # extract last parameter |
| 113 | echo "Installing $text in $dir." |
| 114 | if mkdir -p "$dir"; then cp -f "$@" |
| 115 | else |
| 116 | echo ' WARNING: could not make directory - files not installed.' |
| 117 | fi |
| 118 | } |
| 119 | |
| 120 | # do the actual installation |
| 121 | echo '' |
| 122 | echo 'Installing Xy-pic...' |
| 123 | |
| 124 | installd "1. administrivia" \ |
| 125 | README CATALOG TRAILER INSTALL MANIFEST VERSIONS *COPYING \ |
| 126 | Xy-pic.html Xy-logo.png \ |
| 127 | "$TEXMF/doc/generic/xypic" |
| 128 | installd "2. macros" texinputs/* "$TEXMF/tex/generic/xypic" |
| 129 | installd "3. font metrics" texfonts/*.tfm "$TEXMF/fonts/tfm/public/xypic" |
| 130 | installd "4. font sources" mfinputs/*.mf "$TEXMF/fonts/source/public/xypic" |
| 131 | installd "5. ps type1 fonts" type1/*.pfb "$TEXMF/fonts/type1/public/xypic" |
| 132 | installd "6. ps pfm fonts" pfm/*.pfm "$TEXMF/fonts/pfm/public/xypic" |
| 133 | installd "7. afm metrics" afm/*.afm "$TEXMF/fonts/afm/public/xypic" |
| 134 | installd "8. ps headers" ps/* "$TEXMF/dvips/xypic" |
| 135 | installd "9. ps font maps" map/* "$TEXMF/fonts/map/dvips/xypic" |
| 136 | installd "10. ps font encodings" enc/* "$TEXMF/fonts/enc/dvips/xypic" |
| 137 | installd "11. documentation" doc/xyguide.pdf doc/xyrefer.pdf "$TEXMF/doc/generic/xypic" |
| 138 | |
| 139 | # done |
| 140 | echo "Xy-pic installation done." |
| 141 | exit |
| 142 | |
| 143 | # $Log: install-tds,v $ |
| 144 | # Revision 3.16 2011/03/14 20:14:00 krisrose |
| 145 | # Preparing for release 3.8.6. |
| 146 | # |
| 147 | # Revision 3.15 2010/07/26 11:21:02 krisrose |
| 148 | # 3.8.3 version oopses |
| 149 | # |
| 150 | # Revision 3.14 2010/07/06 22:43:56 krisrose |
| 151 | # Release 3.8.3. |
| 152 | # |
| 153 | # Revision 3.13 2010/06/10 18:45:49 krisrose |
| 154 | # Reference to GPL by URL. |
| 155 | # |
| 156 | # Revision 3.12 2010/06/08 07:28:43 krisrose |
| 157 | # Identify .map file. |
| 158 | # |
| 159 | # Revision 3.11 2010/06/07 04:16:53 krisrose |
| 160 | # Fix forgotten enc files. |
| 161 | # |
| 162 | # Revision 3.10 2010/05/09 22:11:05 krisrose |
| 163 | # Loose /usr/bin prefixes. |
| 164 | # |
| 165 | # Revision 3.9 2010/04/22 14:52:09 krisrose |
| 166 | # Documentation up to date. Install PDF encoding files and XYLU metric files. |
| 167 | # |
| 168 | # Revision 3.8 2010/04/16 06:06:51 krisrose |
| 169 | # Preparing for a new release... |
| 170 | # |
| 171 | # Revision 3.7 1999/02/16 15:12:50 krisrose |
| 172 | # Interim release (Y&Y fonts now free). |
| 173 | # |
| 174 | # New with release 3.5...changed significantly for 3.6. |