# ----------------------------------------------------------------------------
#
# Package	: lemur-indri
# Version	: 5.9
# Source repo	: http://sourceforge.net/projects/lemur
# Tested on	: ubuntu_16.04
# Script License: Apache License, Version 2 or later
# Maintainer	: Atul Sowani <sowania@us.ibm.com>
#
# Disclaimer: This script has been tested in non-root mode on given
# ==========  platform using the mentioned version of the package.
#             It may not work as expected with newer versions of the
#             package and/or distribution. In such case, please
#             contact "Maintainer" of this script.
#
# ----------------------------------------------------------------------------

#!/bin/bash

# Install dependencies.
sudo apt-get update -y
sudo apt-get install -y wget tar automake gcc g++ make zlib1g-dev \
    openjdk-8-jdk openjdk-8-jre

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-ppc64el
export PATH=$PATH:$JAVA_HOME/bin

wget http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
tar -zxf apache-maven-3.3.3-bin.tar.gz
sudo  cp -R apache-maven-3.3.3 /usr/local
sudo ln -s /usr/local/apache-maven-3.3.3/bin/mvn /usr/bin/mvn

# Build code and install.
sudo wget http://sourceforge.net/projects/lemur/files/lemur/indri-5.9/indri-5.9.tar.gz/download
tar -zxvf download && cd indri-5.9
chmod 755 configure
./configure --build=ppc64le-unknown-linux-gnu && sudo make && sudo make install
