lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [13/15] git commit: refs/heads/install-c-library - Preliminary installation script
Date Sat, 18 May 2013 19:23:58 GMT
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/174f42b2
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/174f42b2
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/174f42b2

Branch: refs/heads/install-c-library
Commit: 174f42b2c9a889dcc3fed82ba8ec99ab4e511768
Parents: a70454f
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Fri May 17 21:00:41 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sat May 18 19:27:44 2013 +0200

----------------------------------------------------------------------
 c/install.sh |   76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/174f42b2/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
+


Mime
View raw message