fiGirişBir tane java projesini Linux'a kurmak için izlenen yol şöyleydi
1. mypackaging.sh çalıştırılır
Bu dosya maven'ı çalıştırır. maven bir tane zip üretir.
mvn -s ... -P ... clean package -D...
1. maven package phase çalışırken "makeself" kullanılarak tüm properties + jar + makeself ile kullanılan startup_script dosyasını içeren bir foo_installer.sh üretilir
2. maven package phase çalışırken "maven-assembly-plugin" kullanılarak bir zip üretilir. Aslında bu adım isteğe bağlı, makeself zaten her şeyi zipliyor gibi de düşünülebilir.
Here is an example, assuming the user has a package image stored in a /home/joe/mysoft, and he wants to generate a self-extracting package named mysoft.sh, which will launch the “setup” script initially stored in /home/joe/mysoft :
makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup
setup.sh içindeki metodlar şöyle
install_component()
{
mkdir -v $DEPLOYMENT_DIR/app/"$1"
cp -v -r ./foo.jar $DEPLOYMENT_DIR/app/"$1"
cp -v -r "$2" $DEPLOYMENT_DIR/app/"$1"
}
perform_installation()
{
install_component AFolder a.properties
install_component AFolder b.properties
...
}
print_usage()
{
echo "..."
}
setup.sh çalışması şöyle
#Check if help is selected
if [ "$1" == '-h' ]
then
print_usage
exit 1
fi
if (($EUID)); then
echo "Non-root user can not run"
exit 1
fi
if [ -d $DEPLOYMENT_DIR ]
then
echo "$DEPLOYMENT_DIR exists"
else
echo "Creating folder " $DEPLOYMENT_DIR
mkdir -p $DEPLOYMENT_DIR
fi
perform_installation