Browse files

[enhance] install: moving some indstall scripts to appropriate direct…

…ories
  • Loading branch information...
1 parent 06441bf commit 78a502766a395f3e1ecd3d5140337fa0e4162b65 @Aqua-Ye Aqua-Ye committed Jul 6, 2012
View
6 Makefile
@@ -48,7 +48,7 @@ runtime-libs: $(MYOCAMLBUILD)
$(BUILD_DIR)/bin/opa: $(MYOCAMLBUILD)
$(OCAMLBUILD) opa-both-packages.stamp $(target-tool-opa-bin)
@$(copy-tool-opa-bin)
- @tools/install.sh --quiet --dir $(realpath $(BUILD_DIR)) --ocaml-prefix $(OCAMLLIB)/../..
+ @tools/utils/install.sh --quiet --dir $(realpath $(BUILD_DIR)) --ocaml-prefix $(OCAMLLIB)/../../..
.PHONY: opa
opa: $(BUILD_DIR)/bin/opa
@@ -191,7 +191,7 @@ install-bin:
@printf "Installing into $(INSTALL_DIR)/bin\r"
@mkdir -p $(INSTALL_DIR)/bin
@$(if $(wildcard $(BUILD_DIR)/bin/*),$(INSTALL) -r $(BUILD_DIR)/bin/* $(INSTALL_DIR)/bin)
- @tools/install.sh --quiet --dir $(INSTALL_DIR) --ocamllib $(OCAMLLIB) --ocamlopt $(OCAMLOPT)
+ @tools/utils/install.sh --quiet --dir $(INSTALL_DIR) --ocamllib $(OCAMLLIB) --ocamlopt $(OCAMLOPT)
@printf "Installation to $(INSTALL_DIR)/bin done.\n"
install-lib:
@@ -228,7 +228,7 @@ uninstall:
rm -rf $(INSTALL_DIR)/share/doc/opa
@[ ! -d $(INSTALL_DIR)/share ] || [ -n "`ls -A $(INSTALL_DIR)/share`" ] || rmdir $(INSTALL_DIR)/share
$(foreach file,$(wildcard $(BUILD_DIR)/bin/*),rm -f $(INSTALL_DIR)/bin/$(notdir $(file));)
- @tools/install.sh --uninstall --dir $(INSTALL_DIR)
+ @tools/utils/install.sh --uninstall --dir $(INSTALL_DIR)
@[ ! -d $(INSTALL_DIR)/bin ] || [ -n "`ls -A $(INSTALL_DIR)/bin`" ] || rmdir $(INSTALL_DIR)/bin
@printf "Uninstall done.\n"
View
4 tools/install_release.sh → tools/build/install_release.sh
@@ -242,8 +242,8 @@ if [ $NODOC = "false" ] && [ -z "$IS_WINDOWS" ]; then
cp -r $OPABOOK/* $INSTALLDIR/share/doc/opa/book
fi
-$SRCDIR/utils/install.sh --uninstall --dir $INSTALLDIR
-install -m 0755 -v $SRCDIR/utils/install.sh $INSTALLDIR/share/opa
+$SRCDIR/tools/utils/install.sh --uninstall --dir $INSTALLDIR
+install -m 0755 -v $SRCDIR/tools/utils/install.sh $INSTALLDIR/share/opa
mkdir -p $INSTALLDIR/share/opa/emacs
install -m 0644 -v $SRCDIR/utils/emacs/{opa-mode.el,opa-js-mode.el,site-start.el} $INSTALLDIR/share/opa/emacs
mkdir -p $INSTALLDIR/share/opa/vim
View
0 tools/make_package.sh → tools/build/make_package.sh
File renamed without changes.
View
14 tools/install.sh → tools/utils/install.sh
@@ -1,9 +1,11 @@
-#!/bin/sh -eu
+#!/usr/bin/env sh
+
+set -u
+set -e
help() {
- echo "OPA installation script: creates wrapper scripts to call OPA and tools"
- echo "with an environment setting their correct working directories; sets up"
- echo "the www-data user with a ~/mlstate directory"
+ echo "Opa installation script: creates wrapper scripts to call opa and tools"
+ echo "with an environment setting their correct working directories"
echo "Options:"
echo " --dir <dir> the OPA installation prefix to work in"
echo " (by default, the current directory)"
@@ -108,7 +110,7 @@ create_wrapper() {
[ $QUIET = true ] || echo "Creating $wrapper"
mkdir -p $(dirname $wrapper)
{
- echo '#!/bin/sh'
+ echo '#!/usr/bin/env sh'
echo "export MLSTATELIBS=$PREFIX"
if [ $NO_OCAML = false ]; then
echo "export OCAMLLIB=${OCAMLLIB:-$OCAML_PREFIX/lib/ocaml}"
@@ -122,7 +124,7 @@ case "$1" in
shift
if [ -n "$1" ]
then
- OPT="--name $1"
+ OPT="--name $1"
fi
opa-create $OPT
;;

0 comments on commit 78a5027

Please sign in to comment.