Commit 35b55615 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: XDK does not install startup scripts

parent 6aecd6c9
#!/bin/sh
#!/usr/bin/env bash
cd `dirname $0`
......@@ -6,6 +6,10 @@ cd `dirname $0`
# Avoid any pre-mature optimization on variable names here.
OUT_DIR=`pwd`
CAT=`which cat`
RM=`which rm`
chmod=`which chmod`
WHICH_ENV=`which env`
PATCH_ELF_EXE=$OUT_DIR/tools/patchelf
......@@ -22,18 +26,26 @@ for bin_file in $BINARY_FILES; do
fi
done
cat > $OUT_DIR/monteverdi.sh << EOF
#!/bin/sh
i_am_xdk=@IS_XDK@
if [ "$i_am_xdk" = true ] ; then
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/Modules/ITKZLIB.cmake
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKConfig.cmake
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKTargets-release.cmake
else
$CAT > $OUT_DIR/monteverdi.sh << EOF
#!$WHICH_ENV bash
export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal
export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
$OUT_DIR/bin/monteverdi "\$@"
EOF
chmod +x $OUT_DIR/monteverdi.sh
cat > $OUT_DIR/mapla.sh << EOF
#!/bin/sh
$CHMOD +x $OUT_DIR/monteverdi.sh
$CAT > $OUT_DIR/mapla.sh << EOF
#!$WHICH_ENV bash
export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal
......@@ -41,10 +53,10 @@ export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
$OUT_DIR/bin/mapla "\$@"
EOF
chmod +x $OUT_DIR/mapla.sh
$CHMOD +x $OUT_DIR/mapla.sh
cat > $OUT_DIR/otbenv.profile << EOF
#!/bin/sh
$CAT > $OUT_DIR/otbenv.profile << EOF
#!$WHICH_ENV bash
PATH=\$PATH:$OUT_DIR/bin
GDAL_DATA=$OUT_DIR/share/gdal
GEOTIFF_CSV=$OUT_DIR/share/espg_csv
......@@ -55,18 +67,13 @@ export GDAL_DATA
export GEOTIFF_CSV
EOF
# echo "Creating symbolic links..."
echo "Creating symbolic links..."
. ./make_symlinks
if [ -f lib/cmake/ITK-@ITK_VERSION_STRING@/ITKConfig.cmake ]; then
rm -fr $OUT_DIR/bin/*
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/Modules/ITKZLIB.cmake
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKConfig.cmake
sed -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKTargets-release.cmake
fi
rm -fr $OUT_DIR/tools
$RM -fr $OUT_DIR/tools
rm -f $OUT_DIR/pkgsetup
$RM -f $OUT_DIR/pkgsetup
rm -f $OUT_DIR/make_symlinks
$RM -f $OUT_DIR/make_symlinks
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