]>
code.delx.au - gnu-emacs-elpa/blob - packages/load-relative/install-from-git.sh
3 # This installs all realgud and its prerequisites. If you are lucky
4 # you can just run this:
6 # bash ./install-from-git.sh
8 # However we do provide for some customization...
13 # If your "git clone" can't handle the "http" protocol, you might be
14 # able to use the "git" protocol. To do this set the GIT_PROTOCOL
17 # GIT_PROTOCOL=git sh ./install-from-git.sh
19 # 2. configure options (e.g --prefix)
20 # ====================================
22 # If you want to customize configuration parameters, for example,
23 # choose where to install, you can pass configure options to this
24 # script. For example:# can pass configure options.
26 # sh ./install-from-git.sh --prefix=/tmp
28 # 3. TO "sudo" or not to "sudo"?
29 # ==============================
30 # If you are running as root on a *Nix-like box, then there's no problem.
32 # If you are not running as root, "sudo" might be invoked to install
33 # code. On systems that don't have a "sudo" command but need
34 # filesystem permission, then you get by with setting SUDO_CMD to "su root-c"
37 # SUDO_CMD='su root -c' sh ./install-from-git.sh
39 # If you have sufficient filesystem permission (which is often the
40 # case on Windows or cygwin) then you might not need or want sudo. So
41 # here, set SUDO_CMD to a blank:
43 # SUDO_CMD=' ' sh ./install-from-git.sh
46 # To finish here is an invocation using all 3 above options:
47 # GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp
49 GIT_PROTOCOL
=${GIT_PROTOCOL:-http}
51 # Run and echo a command
53 echo "--- Running command: $@"
56 echo "--- $@ exit status is $?"
60 # environment variable SUDO_CMD could be "sudo" or "su root -c" or " "
63 if (( $
(id
-u) != 0)) ; then
64 if [[ -z "$SUDO_CMD" ]] ; then
66 if which $need_sudo >/dev
/null
2>&1 ; then
69 need_sudo
='su root -c'
80 for program
in git
make $need_sudo ; do
81 if ! which $program >/dev
/null
2>&1 ; then
82 echo "Cant find program $program in $PATH"
87 for pkg
in emacs-
{test-simple
,load-relative
} ; do
88 echo '******************************************'
89 echo Trying to
install ${pkg}...
90 echo '******************************************'
91 run_cmd git clone
${GIT_PROTOCOL}://github.com
/rocky
/${pkg}.git
93 run_cmd
$SHELL .
/autogen.sh
&& \
94 run_cmd .
/configure $@
&& \
96 run_cmd
make check
&& \
97 run_cmd
$need_sudo make install