Commit 19a43886 authored by Shervin Nourbakhsh's avatar Shervin Nourbakhsh
Browse files

improved install script to make it indipendent on the current directory

first version of an install script

install script
parent 40b7c934
# Compile and Install
## Dependencies
- maven
### Centos 8
``` yum install -y maven```
## Instructions
Download the version:
```
git clone -b v1.1 --depth 1 https://code.ill.fr/cameo/cameo.git
```
Compile the Java sources:
```
cd cameo
mvn clean install
```
Install the jzmq version of the cameo-server:
```
install.sh 1.0.1
```
Compile and install the C++ API sources into a temporary directory e.g. */tmp/cameo-install* :
```
cd cameo-api-cpp
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/cameo-install ..
cmake --build . --target install
```
Get the include and so files from the temporary directory.
Please go to the [Wiki](https://code.ill.fr/cameo/cameo-commons/wikis/home).
# Dependencies
# Running Dependencies
## Centos
......@@ -11,3 +11,4 @@ Please go to the [Wiki](https://code.ill.fr/cameo/cameo-commons/wikis/home).
yum install -y --enablerepo=epel java-latest-openjdk-devel java-latest-openjdk-headless java-latest-openjdk
```
Instructions about installation and compilation can be found [here](INSTALL.md)
#!/bin/sh
#!/bin/bash
if [ $# -lt 1 ]
then
......@@ -7,32 +7,31 @@ then
fi
version=$1
libDir=$2
binDir=$3
if [ "$libDir" = "" ]
then
libDir="/usr/share/java/"
fi
if [ "$binDir" = "" ]
then
binDir="/usr/local/bin/"
fi
mkdir -p "$libDir"
libDir=${2:-/usr/share/java/}
binDir=${3:-/usr/local/bin/}
install_script_dir=`dirname $0`
mkdir -p "$libDir" || {
echo "[ERROR] Maybe you don't have the permission to create the directory" >> /dev/stderr
exit 1
}
mkdir -p "$binDir"
libName="cameo-server-"$version"-full.jar"
targetLibName="../target/$libName"
targetLibName="${install_script_dir}/../target/$libName"
if [ ! -e "$targetLibName" ]
then
echo "The version $1 does not exist."
exit 1
echo "File $targetLibName not found" >> /dev/stderr
echo "The version $1 does not exist." >> /dev/stderr
exit 1
fi
cp "$targetLibName" "$libDir"
cp "$targetLibName" "$libDir" ||{
echo "[ERROR] Maybe you don't have the permission to write in the $libDir directory" >> /dev/stderr
exit 1
}
libNoVersionName="cameo-server.jar"
rm "$libDir/$libNoVersionName"
......
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage: install.sh <version> [lib dir] [bin dir]"
exit 1
fi
version=$1
libDir=${2:-/usr/local/share/java/}
binDir=${3:-/usr/local/bin/}
jzmq="-jzmq"
install_script_dir=`dirname $0`
mkdir -p "$libDir" || {
echo "[ERROR] Maybe you don't have the permission to create the directory" >> /dev/stderr
exit 1
}
mkdir -p "$binDir"
libName=cameo-server${jzmq}-${version}-full.jar
targetLibName=cameo-server$jzmq/target/$libName
if [ ! -e "$targetLibName" ]
then
echo "File $targetLibName not found" >> /dev/stderr
echo "The version $1 does not exist." >> /dev/stderr
exit 1
fi
cp "$targetLibName" "$libDir" ||{
echo "[ERROR] Maybe you don't have the permission to write in the $libDir directory" >> /dev/stderr
exit 1
}
libNoVersionName="cameo-server.jar"
rm "$libDir/$libNoVersionName"
ln -s "$libDir/$libName" "$libDir/$libNoVersionName"
echo "Installed $libName into $libDir"
chmod +r $libDir/$libName
#############################################
fileName="$binDir/cameo-server"
echo "#!/bin/sh" > "$fileName"
echo "java -jar \"$libDir/$libNoVersionName\" \$@" >> "$fileName"
chmod 755 "$fileName"
echo "Installed cameo-server into $binDir"
#############################################
fileName=$binDir/cmo
version=1.0.0
cat > $fileName <<EOF
#!/bin/sh
java -jar "$libDir/cameo-console${jzmq}-${version}-full.jar" \$@
EOF
chmod 755 $fileName
echo "Installed cameo-console into $fileName"
fileName=cameo-console$jzmq-$version-full.jar
cp cameo-console$jzmq/target/$fileName $libDir
chmod +r $libDir/$fileName
echo "Installed $fileName into $libDir"
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