[flags] Introduced LUA flag, for packages that need the lua's generic configuration
[opensde-nopast.git] / bin / sde-install
blob152bf85b0a19ce85d504194247cbe3f3acedc162
1 #!/bin/sh
2 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # Filename: bin/sde-install
6 # Copyright (C) 2006 - 2008 The OpenSDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- SDE-COPYRIGHT-NOTE-END ---
16 #Description: Install the `sde` wrapper on $HOME/bin/
18 set -e
20 [ -n "$SDEROOT" ] ||
21 export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
23 . $SDEROOT/lib/libsde.in
25 install_usage() {
26 cat <<EOT
27 Usage: sde install
28 Installs a symlink of the sde wrapper at \$HOME/bin/,
29 which is supposed to be on \$PATH
30 EOT
33 # what action was requested?
34 if [ $# -ne 0 ]; then
35 install_usage
36 elif [ -L "$HOME/bin/sde" ]; then
37 if [ "$( readlink -f $HOME/bin/sde )" = "$SDEROOT/bin/sde" ]; then
38 echo_warning "the same sde wrapper is already installed, skip."
39 else
40 echo_warning "sde wrapper already installed [$( readlink -f $HOME/bin/sde )]"
41 ln -sf "$SDEROOT/bin/sde" "$HOME/bin/sde"
42 echo_info "sde wrapper reinstalled at $HOME/bin/"
44 elif [ -e "$HOME/bin/sde" ]; then
45 echo_abort 1 "Something is already at '$HOME/bin/sde', this is not supported."
46 else
47 mkdir -p "$HOME/bin/"
48 ln -s "$SDEROOT/bin/sde" "$HOME/bin/sde"
49 echo_info "sde wrapper installed at $HOME/bin/"