Skip to content
Snippets Groups Projects
Commit 35b55615 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: XDK does not install startup scripts

parent 6aecd6c9
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/usr/bin/env bash
cd `dirname $0` cd `dirname $0`
...@@ -6,6 +6,10 @@ cd `dirname $0` ...@@ -6,6 +6,10 @@ cd `dirname $0`
# Avoid any pre-mature optimization on variable names here. # Avoid any pre-mature optimization on variable names here.
OUT_DIR=`pwd` OUT_DIR=`pwd`
CAT=`which cat`
RM=`which rm`
chmod=`which chmod`
WHICH_ENV=`which env`
PATCH_ELF_EXE=$OUT_DIR/tools/patchelf PATCH_ELF_EXE=$OUT_DIR/tools/patchelf
...@@ -22,18 +26,26 @@ for bin_file in $BINARY_FILES; do ...@@ -22,18 +26,26 @@ for bin_file in $BINARY_FILES; do
fi fi
done done
cat > $OUT_DIR/monteverdi.sh << EOF i_am_xdk=@IS_XDK@
#!/bin/sh
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 LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal export GDAL_DATA=$OUT_DIR/share/gdal
export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
$OUT_DIR/bin/monteverdi "\$@" $OUT_DIR/bin/monteverdi "\$@"
EOF EOF
chmod +x $OUT_DIR/monteverdi.sh
cat > $OUT_DIR/mapla.sh << EOF $CHMOD +x $OUT_DIR/monteverdi.sh
#!/bin/sh
$CAT > $OUT_DIR/mapla.sh << EOF
#!$WHICH_ENV bash
export LC_NUMERIC=C export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal export GDAL_DATA=$OUT_DIR/share/gdal
...@@ -41,10 +53,10 @@ export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv ...@@ -41,10 +53,10 @@ export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
$OUT_DIR/bin/mapla "\$@" $OUT_DIR/bin/mapla "\$@"
EOF EOF
chmod +x $OUT_DIR/mapla.sh $CHMOD +x $OUT_DIR/mapla.sh
cat > $OUT_DIR/otbenv.profile << EOF $CAT > $OUT_DIR/otbenv.profile << EOF
#!/bin/sh #!$WHICH_ENV bash
PATH=\$PATH:$OUT_DIR/bin PATH=\$PATH:$OUT_DIR/bin
GDAL_DATA=$OUT_DIR/share/gdal GDAL_DATA=$OUT_DIR/share/gdal
GEOTIFF_CSV=$OUT_DIR/share/espg_csv GEOTIFF_CSV=$OUT_DIR/share/espg_csv
...@@ -55,18 +67,13 @@ export GDAL_DATA ...@@ -55,18 +67,13 @@ export GDAL_DATA
export GEOTIFF_CSV export GEOTIFF_CSV
EOF EOF
# echo "Creating symbolic links..." echo "Creating symbolic links..."
. ./make_symlinks . ./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 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment