]>
code.delx.au - gnu-emacs-elpa/blob - packages/test-simple/install-from-git.sh
2 # This installs all emcs-test-simple and its prerequisites. If you are lucky
3 # you can just run this:
5 # bash ./install-from-git.sh
7 # However we do provide for some customization...
12 # If your "git clone" can't handle the "http" protocol, you might be
13 # able to use the "git" protocol. To do this set the GIT_PROTOCOL
16 # GIT_PROTOCOL=git sh ./install-from-git.sh
18 # 2. configure options (e.g --prefix)
19 # ====================================
21 # If you want to customize configuration parameters, for example,
22 # choose where to install, you can pass configure options to this
23 # script. For example:# can pass configure options.
25 # sh ./install-from-git.sh --prefix=/tmp
27 # 3. TO "sudo" or not to "sudo"?
28 # ==============================
29 # If you are running as root on a *Nix-like box, then there's no problem.
31 # If you are not running as root, "sudo" might be invoked to install
32 # code. On systems that don't have a "sudo" command but need
33 # filesystem permission, then you get by with setting SUDO_CMD to "su root-c"
36 # SUDO_CMD='su root -c' sh ./install-from-git.sh
38 # If you have sufficient filesystem permission (which is often the
39 # case on Windows or cygwin) then you might not need or want sudo. So
40 # here, set SUDO_CMD to a blank:
42 # SUDO_CMD=' ' sh ./install-from-git.sh
45 # To finish here is an invocation using all 3 above options:
46 # GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp
48 GIT_PROTOCOL
=${GIT_PROTOCOL:-http}
51 echo "--- Running command: $@"
54 echo "--- $@ exit status is $?"
58 if (( $
(id
-u) != 0)) ; then
59 if [[ -z "$SUDO_CMD" ]] ; then
61 if which $need_sudo >/dev
/null
2>&1 ; then
64 need_sudo
='su root -c'
75 for program
in git
make $try_cmd ; do
76 if ! which $program >/dev
/null
2>&1 ; then
77 echo "Cant find program $program in $PATH"
82 for pkg
in emacs-test-simple
; do
83 echo '******************************************'
84 echo Trying to
install ${pkg}...
85 echo '******************************************'
86 run_cmd git clone
${GIT_PROTOCOL}://github.com
/rocky
/${pkg}.git
88 run_cmd
$SHELL .
/autogen.sh
&& \
89 run_cmd .
/configure $@
&& \
91 run_cmd
make check
&& \
92 run_cmd
$need_sudo make install