Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
a9e1a6b8
Commit
a9e1a6b8
authored
2 months ago
by
Tristan Laurent
Browse files
Options
Downloads
Patches
Plain Diff
BUG: fix empty OS variable, fix osgeo finding on rhel-based OS
parent
4729b55a
No related branches found
Branches containing commit
No related tags found
1 merge request
!1054
BUG: fix empty OS variable, fix osgeo finding on rhel-based OS
Pipeline
#16396
failed
2 months ago
Stage: precheck
Stage: prepare
Stage: build
Stage: report
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Packaging/Files/otbenv.profile
+4
-4
4 additions, 4 deletions
Packaging/Files/otbenv.profile
Packaging/Files/post_install.sh.in
+14
-11
14 additions, 11 deletions
Packaging/Files/post_install.sh.in
with
18 additions
and
15 deletions
Packaging/Files/otbenv.profile
+
4
−
4
View file @
a9e1a6b8
...
@@ -42,7 +42,7 @@ OS="$(lsb_release -is)"
...
@@ -42,7 +42,7 @@ OS="$(lsb_release -is)"
# path may differ
# path may differ
if
[
-
n
"${BASH}"
];
then
if
[
-
n
"${BASH}"
];
then
# dirname does not exists on RH-based OS
# dirname does not exists on RH-based OS
if
[
$OS
=
"RedHatEnterprise"
]
||
[
$OS
=
"Fedora"
]
||
[
$OS
=
"RockyLinux"
];
then
if
[
"
$OS
"
=
"RedHatEnterprise"
]
||
[
"
$OS
"
=
"Fedora"
]
||
[
"
$OS
"
=
"RockyLinux"
];
then
OTB_INSTALL_DIR
=
"$(realpath $(dirname "
$
{
BASH_SOURCE
[
0
]}
"))"
OTB_INSTALL_DIR
=
"$(realpath $(dirname "
$
{
BASH_SOURCE
[
0
]}
"))"
elif
[
-
n
"${BASH}"
];
then
elif
[
-
n
"${BASH}"
];
then
OTB_INSTALL_DIR
=
"$( dirname -- "
$
(
readlink
-
f
--
"${BASH_SOURCE[0]}"
;
)
"; )"
OTB_INSTALL_DIR
=
"$( dirname -- "
$
(
readlink
-
f
--
"${BASH_SOURCE[0]}"
;
)
"; )"
...
@@ -51,7 +51,7 @@ else
...
@@ -51,7 +51,7 @@ else
# non-bash shell
# non-bash shell
OTB_INSTALL_DIR
=
"$( dirname -- "
$
(
readlink
-
f
--
"$0"
;
)
"; )"
OTB_INSTALL_DIR
=
"$( dirname -- "
$
(
readlink
-
f
--
"$0"
;
)
"; )"
fi
fi
CMAKE_PREFIX_PATH
=
$OTB_INSTALL_DIR
CMAKE_PREFIX_PATH
=
"
$OTB_INSTALL_DIR
"
export
CMAKE_PREFIX_PATH
export
CMAKE_PREFIX_PATH
# check and set OTB_APPLICATION_PATH
# check and set OTB_APPLICATION_PATH
...
@@ -62,7 +62,7 @@ PATH=$(cat_path "$OTB_INSTALL_DIR/bin" "$PATH")
...
@@ -62,7 +62,7 @@ PATH=$(cat_path "$OTB_INSTALL_DIR/bin" "$PATH")
# export PYTHONPATH to import otbApplication.py
# export PYTHONPATH to import otbApplication.py
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/otb/python"
"
$PYTHONPATH
"
)
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/otb/python"
"
$PYTHONPATH
"
)
if
[
$OS
=
"RedHatEnterprise"
]
||
[
$OS
=
"Fedora"
]
||
[
$OS
=
"RockyLinux"
];
then
if
[
"
$OS
"
=
"RedHatEnterprise"
]
||
[
"
$OS
"
=
"Fedora"
]
||
[
"
$OS
"
=
"RockyLinux"
];
then
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/python3.8/site-packages"
"
$PYTHONPATH
"
)
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/python3.8/site-packages"
"
$PYTHONPATH
"
)
else
else
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/python3/dist-packages"
"
$PYTHONPATH
"
)
PYTHONPATH
=
$
(
cat_path
"
$OTB_INSTALL_DIR
/lib/python3/dist-packages"
"
$PYTHONPATH
"
)
...
@@ -76,7 +76,7 @@ GDAL_DATA="$OTB_INSTALL_DIR/share/gdal"
...
@@ -76,7 +76,7 @@ GDAL_DATA="$OTB_INSTALL_DIR/share/gdal"
PROJ_LIB
=
"
$OTB_INSTALL_DIR
/share/proj"
PROJ_LIB
=
"
$OTB_INSTALL_DIR
/share/proj"
export
GDAL_DRIVER_PATH
=
disable
export
GDAL_DRIVER_PATH
=
"
disable
"
export
LD_LIBRARY_PATH
=
"
$OTB_INSTALL_DIR
/lib:
$LD_LIBRARY_PATH
"
export
LD_LIBRARY_PATH
=
"
$OTB_INSTALL_DIR
/lib:
$LD_LIBRARY_PATH
"
...
...
This diff is collapsed.
Click to expand it.
Packaging/Files/post_install.sh.in
+
14
−
11
View file @
a9e1a6b8
...
@@ -33,25 +33,28 @@ sed -i "s/\/builds\/otb\/xdk/\$OTB_INSTALL_DIR/g" "$OTB_INSTALL_DIR"/bin/gdal-co
...
@@ -33,25 +33,28 @@ sed -i "s/\/builds\/otb\/xdk/\$OTB_INSTALL_DIR/g" "$OTB_INSTALL_DIR"/bin/gdal-co
sed
-i
"s/
\/
builds
\/
otb
\/
xdk/
\$
OTB_INSTALL_DIR/g"
"
$OTB_INSTALL_DIR
"
/bin/curl-config
sed
-i
"s/
\/
builds
\/
otb
\/
xdk/
\$
OTB_INSTALL_DIR/g"
"
$OTB_INSTALL_DIR
"
/bin/curl-config
sh
"
$OTB_INSTALL_DIR
"
/tools/sanitize_rpath.sh
sh
"
$OTB_INSTALL_DIR
"
/tools/sanitize_rpath.sh
pyversion
=
"
$(
python3
-V
2>&1 |
sed
's/.* \([0-9]\).\([0-9]*\).*/\1\2/'
)
"
concat
pyversion
=
"
$(
python3
-V
2>&1 |
sed
's/.* \([0-9]\).\([0-9]*\).*/\1\2/'
)
"
ostype
=
"
$(
lsb_release
-is
)
"
ostype
=
"
$(
lsb_release
-is
)
"
# Recompile OTB Python bindings
# Recompile OTB Python bindings. By default on non RHEL OS, the packaged
if
[
"
$pyversion
"
-ne
"310"
]
&&
[
$ostype
!=
"RedHatEnterprise"
]
;
then
# bindings are compiled for version 3.10
if
[
"
$concatpyversion
"
-ne
"310"
]
&&
[
$ostype
!=
"RedHatEnterprise"
]
;
then
sh
"
$OTB_INSTALL_DIR
"
/recompile_bindings.sh
sh
"
$OTB_INSTALL_DIR
"
/recompile_bindings.sh
fi
fi
# Check python version, if python 3.12 (ubuntu 24 and debian > 12) download and extract the gdal bindings for python 3.12
# Check python version, if python 3.12 (ubuntu 24 and debian > 12) download and extract the gdal bindings for python 3.12
# In case your install is from compiled code, the gdal bindings will be already there in the installation
# In case your install is from compiled code, the gdal bindings will be already there in the installation
python_distpackage_path
=
"
$OTB_INSTALL_DIR
/lib/python3/dist-packages/osgeo/"
# Note that the install path differs from RHEL to debian based OS. To handle it,
gdal_python_found
=
"
$(
find
$python_distpackage_path
-name
"*
$pyversion
-x86_64-linux*"
)
"
# check before the folder name (always prefixed of python3)
osgeo_pkg_path
=
$(
find
"
$OTB_INSTALL_DIR
/lib"
-mindepth
3
-maxdepth
3
-type
d
-name
"osgeo"
)
gdal_python_found
=
"
$(
find
$osgeo_pkg_path
-name
"*
$concatpyversion
-x86_64-linux*"
)
"
if
[
-z
"
$gdal_python_found
"
]
;
then
if
[
-z
"
$gdal_python_found
"
]
;
then
echo
"***** Python
$pyversion
detected, downloading gdal bindings compiled for this Python version *****"
echo
"***** Python
$
concat
pyversion
detected, downloading gdal bindings compiled for this Python version *****"
HTTP_STATUS
=
$(
curl
-s
-o
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$pyversion
.tar.gz
-w
"%{response_code}
\n
"
https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-
$OTB_SHORT_VERSION
-GDAL-bindings-py
$pyversion
.tar.gz
)
HTTP_STATUS
=
$(
curl
-s
-o
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$
concat
pyversion
.tar.gz
-w
"%{response_code}
\n
"
https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-
$OTB_SHORT_VERSION
-GDAL-bindings-py
$
concat
pyversion
.tar.gz
)
if
[
$HTTP_STATUS
-eq
200
]
;
then
if
[
$HTTP_STATUS
-eq
200
]
;
then
tar
-xf
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$pyversion
.tar.gz
-C
$python_distpackage_path
tar
-xf
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$
concat
pyversion
.tar.gz
-C
$python_distpackage_path
rm
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$pyversion
.tar.gz
rm
"
$OTB_INSTALL_DIR
"
/tools/gdal-py
$
concat
pyversion
.tar.gz
echo
"***** GDAL bindings for python
$pyversion
successfully installed *****"
echo
"***** GDAL bindings for python
$
concat
pyversion
successfully installed *****"
else
else
echo
"Can not find GDAL bindings at https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-
$OTB_SHORT_VERSION
-GDAL-bindings-py
$pyversion
.tar.gz"
echo
"Can not find GDAL bindings at https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-
$OTB_SHORT_VERSION
-GDAL-bindings-py
$
concat
pyversion
.tar.gz"
return
-1
return
-1
fi
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment