gast-0.1.2/README.ja_JP.UTF-8
[ setup ]
- Change a working directory to an extracted directory, and execte
- each scripts with no argument.
- Symbolic link file are created at same directory.
+ 1) Change a working directory to an extracted directory.
$ cd /home/foo/gast-0.1.2
- $ ./gast
- gast : Create symbolic link 'gcc'
- gast : Create symbolic link 'cc'
- gast : Create symbolic link 'g++'
- $ ./gast_make
- gast_make : Create symbolic link 'make'
- gast_make : Create symbolic link 'gmake'
+ 2) If you need, please add/modify your compiler/make
+ utility name to 'gast.aliases'.
- $ ./gast_rpmbuild
- gast_rpmbuild : Create symbolic link 'rpmbuild'
+ $ vi gast.aliases
+
+ 3) Execute 'gast_symlink' script. this script creates
+ symbolic link file foe each wrapper script.
+ Symbolic link filename are selected from 'gast.aliases'.
+
+ $ ./gast_symlink
+
+ If you want to add new symbolic link, you have to modify
+ 'gast.aliases' file again, and re-execute 'gast_symlink'.
+
+ for exampe)
+ $ ./gast_symlink
+
+ If you want to select script to create symbolic link,
+ please specify script name.
+
+ for exampe)
+ $ ./gast_symlink gast
+
+ 4) If you want to delete symbolic link, execute 'gast_symlink'
+ with '-u' option. All symbolic link files are deleted.
+
+ $ ./gast_symlink -u
+
+ If you want to select script to delete symbolic link,
+ please specify script name.
+
+ for exampe)
+ $ ./gast_symlink -u gast_make
[ NOTICE ]
- gast, gast_make, gast_rpmbuild must be in same directory.
ORIGINAL_NAME="gast"
CWD=`pwd`
SCRIPT_NAME=${0##*/}
-SCRIPT_PATH=${0%/*}
+if [[ "$0" =~ ".+/[^/]+" ]]; then
+ SCRIPT_PATH=${0%/*}
+else
+ SCRIPT_PATH=${0%${SCRIPT_NAME}}
+fi
+# get a directory path (full-path) of this script
+case "${SCRIPT_PATH}" in
+ '.' | '') SCRIPT_PATH="${CWD}" ;;
+ \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
+ '~') SCRIPT_PATH="${HOME}" ;;
+ \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
+ \/*) : ;;
+ *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
+esac
WORK_DIR="/tmp"
;;
esac
done
-
- cd "${SCRIPT_PATH}"
- for cmd in gcc cc g++
- do
- if [ -e "${cmd}" ]; then
- file "${cmd}" 2>/dev/null | egrep 'symbolic link' >/dev/null 2>&1
- if [ "$?" -ne 0 ]; then
- echo "${ORIGINAL_NAME} : '${cmd}' exists as normal file or directory. Could not create symbolic link." >&2
- continue
- fi
- fi
- ln -sf "${ORIGINAL_NAME}" "${cmd}"
- if [ "$?" -eq 0 ]; then
- echo "${ORIGINAL_NAME} : Create symbolic link '${cmd}'" >&2
- else
- echo "${ORIGINAL_NAME} : Couldn't create symbolic link '${cmd}'" >&2
- fi
- done
+ # symbolic link management are moved to 'gast_symlink' script.
exit 0
fi
-# get a directory path (full-path) of this script
-case "${SCRIPT_PATH}" in
- '.') SCRIPT_PATH="${CWD}" ;;
- \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
- '~') SCRIPT_PATH="${HOME}" ;;
- \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
- \/*) : ;;
- *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
-esac
-
# leaves out a script path name from PATH environment variable because of
# executing original compiler binary file in this script.
path_tmp=
ORIGINAL_NAME="gast_make"
CWD=`pwd`
SCRIPT_NAME=${0##*/}
-SCRIPT_PATH=${0%/*}
+if [[ "$0" =~ ".+/[^/]+" ]]; then
+ SCRIPT_PATH=${0%/*}
+else
+ SCRIPT_PATH=${0%${SCRIPT_NAME}}
+fi
+# get a directory path (full-path) of this script
+case "${SCRIPT_PATH}" in
+ '.' | '') SCRIPT_PATH="${CWD}" ;;
+ \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
+ '~') SCRIPT_PATH="${HOME}" ;;
+ \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
+ \/*) : ;;
+ *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
+esac
# check wheter perl can use or not.
HAS_PERL=`which perl 2>/dev/null`
;;
esac
done
-
- cd "${SCRIPT_PATH}"
- for cmd in make gmake
- do
- if [ -e "${cmd}" ]; then
- file "${cmd}" 2>/dev/null | egrep 'symbolic link' >/dev/null 2>&1
- if [ "$?" -ne 0 ]; then
- echo "${ORIGINAL_NAME} : '${cmd}' exists as normal file or directory. Could not create symbolic link." >&2
- continue
- fi
- fi
- ln -sf "${ORIGINAL_NAME}" "${cmd}"
- if [ "$?" -eq 0 ]; then
- echo "${ORIGINAL_NAME} : Create symbolic link '${cmd}'" >&2
- else
- echo "${ORIGINAL_NAME} : Couldn't create symbolic link '${cmd}'" >&2
- fi
- done
+ # symbolic link management are moved to 'gast_symlink' script.
exit 0
fi
-# get a directory path (full-path) of this script
-case "${SCRIPT_PATH}" in
- '.') SCRIPT_PATH="${CWD}" ;;
- \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
- '~') SCRIPT_PATH="${HOME}" ;;
- \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
- \/*) : ;;
- *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
-esac
-
# Get an original make command.
path_save="${PATH}"
path_tmp=
VERSION=0.1.2
ORIGINAL_NAME="gast_rpmbuild"
-SCRIPT_NAME=${0##*/}
-SCRIPT_PATH=${0%/*}
CWD=`pwd`
+SCRIPT_NAME=${0##*/}
+if [[ "$0" =~ ".+/[^/]+" ]]; then
+ SCRIPT_PATH=${0%/*}
+else
+ SCRIPT_PATH=${0%${SCRIPT_NAME}}
+fi
+# get a directory path (full-path) of directory this script
+case "${SCRIPT_PATH}" in
+ '.' | '') SCRIPT_PATH="${CWD}" ;;
+ \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
+ '~') SCRIPT_PATH="${HOME}" ;;
+ \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
+ \/*) : ;;
+ *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
+esac
# When this script is executed as 'gast_rpmbuild', this script creates symbolic link
# file name as 'rpmbuild' and exit.
exit 1
fi
-# get a directory path (full-path) of directory this script
-case "${SCRIPT_PATH}" in
- '.') SCRIPT_PATH="${CWD}" ;;
- \./*) SCRIPT_PATH="${CWD}/${SCRIPT_PATH#*/}" ;;
- '~') SCRIPT_PATH="${HOME}" ;;
- \~/*) SCRIPT_PATH="${HOME}/${SCRIPT_PATH#*/}" ;;
- \/*) : ;;
- *) SCRIPT_PATH="${CWD}/${SCRIPT_PATH}" ;;
-esac
-
# Set this script's directory to PATH environment variable.
# (to be found a gcc wrapper script (=gast) in advance of original compiler binary).
PATH="${SCRIPT_PATH}:${PATH}"