Commit 3ed5fdf4 authored by gerd's avatar gerd

installable


git-svn-id: https://gps.dynxs.de/private/svn/app-plasma/trunk@238 55289a75-7b90-4627-9e07-ffb4263930b2
parent 16f8b15c
# This invoke omake
all:
omake
clean:
omake clean
install:
omake install
......@@ -14,9 +14,9 @@ Last meter software changes:
Installation:
- add configure script - mainly check whether everything is there in
the right version
- allow to install
- clusterconfig: add config file with paths to executables
the right version - DONE
- allow to install - DONE
- clusterconfig: add config file with paths to executables - DONE
Documentation:
......
......@@ -54,6 +54,7 @@ if [ $? -ne 0 ]; then
fi
. "instances/$inst/global.conf"
. "./inst.conf"
na="$(which netplex-admin)"
if [ -z "$na" ]; then
......@@ -66,9 +67,9 @@ for host in $hosts; do
"mkdir -p '$prefix/bin' '$prefix/etc' '$prefix/log' '$prefix/data'"
scp instances/$inst/*.conf instances/$inst/*.hosts instances/$inst/*.sh \
$host:"$prefix/etc"
scp ../sql/namenode.sql $host:"$prefix/etc"
scp $namenode_sql $host:"$prefix/etc"
if [ $only_config -eq 0 ]; then
scp ../src/pfs_daemon/plasmad ../src/pfs_nfs3/nfs3d ../src/pfs_admin/plasma_datanode_init "$na" \
scp $plasmad $nfs3d $plasma_datanode_init $plasma_admin "$na" \
$host:"$prefix/bin"
fi
done
......
......@@ -59,6 +59,7 @@ if [ ! -d "instances/$inst" ]; then
fi
. "instances/$inst/global.conf"
. "./inst.conf"
# Check/translate size:
b="$(echo "$size" | sed -e 's/^[0-9]\+[KMG]\?$//')"
......@@ -110,7 +111,7 @@ nn="-namenode $nn_host:$nn_port -cluster $inst"
# Check $nn:
echo "Testing namenode connectivity:"
if ../src/pfs_admin/plasma_admin list_datanodes $nn >/dev/null;
if $plasma_admin list_datanodes $nn >/dev/null;
then
echo "ok"
else
......
plasmad="../src/pfs_daemon/plasmad"
nfs3d="../src/pfs_nfs3/nfs3d"
plasma_datanode_init="../src/pfs_admin/plasma_datanode_init"
plasma_admin="../src/pfs_admin/plasma_admin"
plasma="../src/plasmaclient/plasma"
namenode_sql="../sql/namenode.sql"
#! /bin/sh
# $Id$
#######################################################################
# Helpers:
# Split $PATH into words:
oldifs="$IFS"
IFS=" :"
spacepath=`echo $PATH`
IFS="$oldifs"
in_path () {
# Does $1 exist in $PATH?
for d in $spacepath; do
if test -x "$d/$1"; then
return 0
fi
done
return 1
}
get_path () {
for d in $spacepath; do
if test -x "$d/$1"; then
echo "$d/$1"
return
fi
done
}
######################################################################
set_defaults () {
bindir=`dirname "$ocamlc"`
sharedir=`dirname $bindir`/share/plasma
}
ocamlc=`get_path ocamlc`
set_defaults
version="0.1"
######################################################################
check_library () {
# $1: the name of the library (findlib)
ocamlfind query "$1" >/dev/null 2>/dev/null
return
}
print_options () {
echo " -bindir $bindir"
echo " -sharedir $sharedir"
}
usage () {
set_defaults
cat <<_EOF_ >&2
usage: ./configure [ options ]
-bindir dir
Install binaries into this directory
-sharedir dir
Install shared files into this directory
Defaults are:
_EOF_
print_options
fldir="$(ocamlfind printconf destdir || echo "n/a")"
cat <<_EOF_ >&2
Ocaml libraries are installed to the findlib location which is:
$fldir
_EOF_
exit 1
}
echo "Welcome to Plasma version $version" >&2
while [ "$#" -gt 0 ]; do
case "$1" in
-bindir)
bindir="$2"; shift; shift ;;
-sharedir)
sharedir="$2"; shift; shift ;;
-version)
echo "$version"
exit 0 ;;
*)
usage ;;
esac
done
######################################################################
# Check ocaml, ocamlfind and libraries
printf "%s" "Checking for Ocaml..."
if in_path ocamlc; then
echo "found"
else
echo "not found"
echo "Get ocaml from http://caml.inria.fr"
exit 1
fi
echo "Checking Ocaml setup..."
if ! in_path ocamlopt; then
echo "The native-code compiler ocamlopt was not found. Compiling to"
echo "bytecode will generally work, but may result in poor performance"
fi
ocaml_version="$(ocamlc -version)"
old_ocaml_version=0
case "$ocaml_version" in
3.1[123456789].*)
true ;;
3.[23456789][01234567890].*)
true ;;
3.10.*)
old_ocaml_version=1 ;;
3.*)
old_ocaml_version=1 ;;
2.*|1.*|0.*)
echo "Your version of ocaml is too old. Get at least 3.11!"
exit 1 ;;
*)
echo "Your version of ocaml could not be recognized" ;;
esac
if [ $old_ocaml_version -gt 0 ]; then
echo "Your version of ocaml is relatively old. This is untested, and you"
echo "may run into problems when building or running Plasma. For avoiding"
echo "problems get version 3.11 or newer"
fi
printf "%s" "Checking for findlib... "
if ocamlfind query stdlib >/dev/null 2>/dev/null; then
echo "found"
else
echo "not found"
echo "Make sure that ocamlfind is in your PATH, or download findlib"
echo "from http://projects.camlcity.org/projects/findlib.html"
exit 1
fi
printf "%s" "Checking for Ocamlnet... "
if check_library netsys; then
echo "found"
else
echo "not found (or very old)"
echo "Sorry, installation is not possible without Ocamlnet."
echo "Get this library from:"
echo "http://projects.camlcity.org/projects/ocamlnet.html"
echo "Minimum required version is: 3.0test3"
exit 1
fi
printf "%s" "Checking Ocamlnet version... "
netsys_version="$(ocamlfind query -format '%v' netsys)"
case "$netsys_version" in
0.*|1.*|2.*)
echo "too old"
exit 1 ;;
3.0test1|3.0test2)
echo "too old"
exit 1 ;;
*)
echo "ok" ;;
esac
printf "%s" "Checking for omake... "
if in_path omake; then
echo "found"
else
echo "not found"
echo "Get omake from http://omake.metaprl.org"
exit 1
fi
printf "%s" "Checking for PostgreSQL client library (libpq)... "
if in_path pg_config; then
echo "pg_config found"
else
echo "pg_config not found"
echo "This may mean you forgot to install libpq or libpq-dev"
exit 1
fi
printf "%s" "Checking PostgreSQL version... "
pg_version="$(pg_config --version)"
pg_too_old=0
case "$pg_version" in
PostgreSQL\ 8.[01].*)
pg_too_old=1 ;;
PostgreSQL\ 7.*)
pg_too_old=1 ;; # Note pg_config exists since pg 7.1
esac
if [ $pg_too_old -gt 0 ]; then
echo "too old"
echo "Get at least PostgreSQL 8.2."
exit 1
else
echo "ok"
fi
######################################################################
# Write omake.conf
echo "BINDIR = $bindir" > omake.conf
echo "SHAREDIR = $sharedir" >> omake.conf
echo "Configuration successful. Start build with"
echo " omake"
echo "Install with"
echo " omake install"
echo
echo "Lots of fun with Plasma!"
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.
########################################################################
# Phony targets are scoped, so you probably want to declare them first.
#
.PHONY: all install clean
########################################################################
# C configuration.
# Delete this section if you are not building C files.
#
################################################
# Configuration. You might want to modify any of these
# configuration variables.
#
# CFLAGS +=
# ASFLAGS +=
# LDFLAGS +=
# INCLUDES +=
################################################
# Uncomment the following section if you want
# to build a C program in the current directory.
#
# CFILES[] =
# file1
# main
#
# MAIN = main
#
# .DEFAULT: $(CProgram $(MAIN), $(CFILES))
################################################
# Uncomment the following section if you want to build a C library
# in the current directory.
#
# LIBFILES[] =
# file1
# file2
#
# LIB = libxxx
#
# .DEFAULT: $(StaticCLibrary $(LIB), $(LIBFILES))
########################################################################
# OCaml configuration.
# Delete this section if you are not building OCaml files.
#
################################################
# Configuration. You may want to modify any of these configuration
# variables.
#
#
# This project requires ocamlfind (default - false).
#
USE_OCAMLFIND = true
OCAMLPACKS[] =
rpc
netplex
netsys
shell
if $(not $(OCAMLFIND_EXISTS))
eprintln(This project requires ocamlfind, but is was not found.)
eprintln(You need to install ocamlfind and run "omake --configure".)
exit 1
#
# Include path
#
# OCAMLINCLUDES +=
#
# Compile native or byte code?
#
# The default values are defined as follows:
#
NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
#BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
BYTE_ENABLED = true
#
# Various options
#
OCAMLFLAGS += -annot
# OCAMLCFLAGS +=
# OCAMLOPTFLAGS +=
# OCAML_LINK_FLAGS +=
# OCAML_BYTE_LINK_FLAGS +=
# OCAML_NATIVE_LINK_FLAGS +=
OCAMLDEP_MODULES_ENABLED = false
if $(not $(defined OCAMLRPCGEN))
OCAMLRPCGEN = ocamlrpcgen
export
public.InterfaceDoc(name, files) =
protected.mlifiles = $(filter-exists $(addsuffix .mli, $(files)))
protected.cmifiles = $(addsuffix .cmi, $(removesuffix $(mlifiles)))
$(name).idoc: $(mlifiles) $(cmifiles)
ocamlfind ocamldoc -dump $(name).idoc -stars \
$(PREFIXED_OCAMLINCLUDES) -package "$(OCAMLPACKS)" \
$(mlifiles)
return $(name).idoc
########################################################################
# Subdirectories.
# You may want to include some subdirectories in this project.
......@@ -146,39 +17,3 @@ public.InterfaceDoc(name, files) =
pfs_daemon \
pfs_nfs3 \
mr_framework
################################################
# Generated files
#
# Workaround for the fact that ocamldep does not pay attention to .mll
# and .mly files.
#
# OCamlGeneratedFiles(parser.ml lexer.ml)
################################################
# Build an OCaml library
#
# FILES[] =
# file1
# file2
#
# LIB = main
#
# .DEFAULT: $(OCamlLibrary $(LIB), $(FILES))
################################################
# Build an OCaml program
#
# FILES[] =
# file1
# file2
#
# PROGRAM =
# OCAML_LIBS +=
# OCAML_CLIBS +=
# OCAML_OTHER_LIBS +=
# OCAML_LIB_FLAGS +=
#
# .DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment