+ -type d \
+ -empty \
+ -exec rmdir {} \;
+}
+
+Linux::getRpath () {
+ local exe_file="${1}"
+
+ local exe_dir="$(dirname "${exe_file}")"
+ local path_start="$(printf '%s' "${bundle_dir}" | wc -c)"
+ path_start="$((${path_start} + 1))"
+
+ local exe_subdir="$(echo "${exe_dir}" | cut -c "${path_start}-" | _sed -e 's|//*|/|;s|^/||')"
+
+ local rpath_origin='$ORIGIN'
+
+ if [ "${exe_subdir}" = '' ]
+ then
+ printf '%s/lib\n' "${rpath_origin}"
+ else
+ if [ "${exe_subdir}" = 'lib' ]
+ then
+ printf '%s\n' "${rpath_origin}"
+ else
+ local num_parent_dir="$(echo "${exe_subdir}" | tr '/' '\n' | wc -l)"
+ local rpath_subdir
+ local i=0
+ while [ "${i}" -lt "${num_parent_dir}" ]
+ do
+ rpath_subdir="${rpath_subdir}/.."
+ i="$((${i} + 1))"
+ done
+ printf '%s%s/lib\n' "${rpath_origin}" "${rpath_subdir}"
+ fi
+ fi