You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/05/20 21:09:55 UTC
[lucy-commits] [11/23] git commit: refs/heads/master - Preliminary installation
script
Preliminary installation script
Might be merged into Makefile later.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/572037a2
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/572037a2
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/572037a2
Branch: refs/heads/master
Commit: 572037a270a858f00caf32f0287c69cae10b3c18
Parents: a00074b
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri May 17 21:00:41 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon May 20 21:01:12 2013 +0200
----------------------------------------------------------------------
c/install.sh | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 76 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/572037a2/c/install.sh
----------------------------------------------------------------------
diff --git a/c/install.sh b/c/install.sh
new file mode 100755
index 0000000..53e11c4
--- /dev/null
+++ b/c/install.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+set -e
+
+version=0.3.0
+major_version=0.3
+
+function usage()
+{
+ echo "Usage: install.sh --prefix path"
+}
+
+while [ -n "${1+set}" ]; do
+ case "$1" in
+ -h|--help|-\?)
+ usage
+ exit
+ ;;
+ --prefix)
+ if [ -z "${2+set}" ]; then
+ echo "--prefix requires an argument."
+ exit 1
+ fi
+ prefix=$2
+ shift 2
+ ;;
+ *)
+ echo "Invalid option: '$1'" 1>&2
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+if [ -z "$prefix" ]; then
+ echo "No prefix specified."
+ usage
+ exit 1
+fi
+
+case $(uname) in
+ Darwin*)
+ lib_file=liblucy.$version.dylib
+ if [ ! -f $lib_file ]; then
+ echo "$lib_file not found. Did you run make?"
+ exit 1
+ fi
+ mkdir -p $prefix/lib
+ cp $lib_file $prefix/lib
+ install_name=$prefix/lib/liblucy.$major_version.dylib
+ ln -sf $lib_file $install_name
+ ln -sf $lib_file $prefix/lib/liblucy.dylib
+ install_name_tool -id $install_name $prefix/lib/$lib_file
+ ;;
+ *)
+ lib_file=liblucy.so.$version
+ if [ ! -f $lib_file ]; then
+ echo "$lib_file not found. Did you run make?"
+ exit 1
+ fi
+ mkdir -p $prefix/lib
+ cp $lib_file $prefix/lib
+ soname=liblucy.so.$major_version
+ ln -sf $lib_file $prefix/lib/$soname
+ ln -sf $soname $prefix/lib/liblucy.so
+ ;;
+esac
+
+mkdir -p $prefix/include
+cp autogen/include/cfish_hostdefs.h $prefix/include
+cp autogen/include/lucy_parcel.h $prefix/include
+cp -R autogen/include/Clownfish $prefix/include
+cp -R autogen/include/Lucy $prefix/include
+cp -R autogen/include/LucyX $prefix/include
+
+cp -R autogen/man $prefix
+