Skip to content

Commit

Permalink
build: sap nw rfc sdk build and installation utilities added
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Nov 7, 2023
1 parent 46bcf4d commit cad1e3a
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docker/sap_nwrfcsdk_utils/paths_fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-FileCopyrightText: 2013 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

#!/bin/bash

ICUV="50"

if [ -z "$SAPNWRFC_HOME" ]; then
echo "SAPNWRFC_HOME env variable not set. Should point to SAP NWRFC SDK library root"
exit 1
fi

# run from sap nwrfc sdk root folder

#
# lib folder fix
#

cd lib
RPATH="$SAPNWRFC_HOME/lib"
for filename in *.dylib; do
# LC_RPATH
install_name_tool -add_rpath $RPATH $filename
# LC_ID_DYLIB
install_name_tool -id @rpath/$filename $filename
done

# LC_LOAD_DYLIB
install_name_tool -change @loader_path/libicuuc.$ICUV.dylib @rpath/libicuuc.$ICUV.dylib libicui18n.$ICUV.dylib
install_name_tool -change @loader_path/libicudata.$ICUV.dylib @rpath/libicudata.$ICUV.dylib libicui18n.$ICUV.dylib
install_name_tool -change @loader_path/libicudata.$ICUV.dylib @rpath/libicudata.$ICUV.dylib libicuuc.$ICUV.dylib
cd ..

#
# bin folder fix
#

BINFILES="rfcexec startrfc"

cd bin
for filename in ${BINFILES}; do
chmod +x $filename
# LC_RPATH
install_name_tool -add_rpath $RPATH $filename
# LC_ID_DYLIB
install_name_tool -id @rpath/$filename $filename
# LC_LOAD_DYLIB
install_name_tool -change @loader_path/libsapnwrfc.dylib @rpath/libsapnwrfc.dylib $filename
install_name_tool -change @loader_path/libsapucum.dylib @rpath/libsapucum.dylib $filename
done
install_name_tool -change @loader_path/libsapucum.dylib @rpath/libsapucum.dylib ./startrfc
cd ..
10 changes: 10 additions & 0 deletions docker/sap_nwrfcsdk_utils/paths_show.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2013 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

#!/bin/bash
ARG1=${1:--D}
for filename in lib/*.dylib; do
otool "$ARG1" $filename
printf "\n"
done
5 changes: 5 additions & 0 deletions docker/sap_nwrfcsdk_utils/version-darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

echo `strings $SAPNWRFC_HOME/lib/libsapnwrfc.dylib | grep "Patch Level"`
5 changes: 5 additions & 0 deletions docker/sap_nwrfcsdk_utils/version-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

echo `strings $SAPNWRFC_HOME/lib/libsapnwrfc.so | grep "Patch Level"`
6 changes: 6 additions & 0 deletions docker/sap_nwrfcsdk_utils/version-windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:: SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
::
:: SPDX-License-Identifier: Apache-2.0

@echo off
findstr Patch $env:SAPNWRFC_HOME\lib\sapnwrfc.dll

0 comments on commit cad1e3a

Please sign in to comment.