aboutsummaryrefslogtreecommitdiffstats
path: root/extras/packethicn/install_macos.sh
diff options
context:
space:
mode:
authorMarco Trinelli <marcotrinelli@gmail.com>2021-03-23 15:55:01 +0100
committerMarco Trinelli <marcotrinelli@gmail.com>2021-03-25 16:53:16 +0100
commit9f30bf6e794a7b431217ce91038a4ec0f917dc08 (patch)
tree32d58faf4e61045730e1fedc58153b979ce1e420 /extras/packethicn/install_macos.sh
parenteedc20451418af57a6ffe4c6d41652828f01b9fe (diff)
[HICN-688] Include packethicn in hicn build
Add license headers Add dependencies Fix build for Ubuntu 18.04 Move doc Signed-off-by: Marco Trinelli <marcotrinelli@gmail.com> Change-Id: Ie92268d2d3a47c47746107ac6f9c34b21949671c
Diffstat (limited to 'extras/packethicn/install_macos.sh')
-rwxr-xr-xextras/packethicn/install_macos.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/extras/packethicn/install_macos.sh b/extras/packethicn/install_macos.sh
new file mode 100755
index 000000000..7aa6413ef
--- /dev/null
+++ b/extras/packethicn/install_macos.sh
@@ -0,0 +1,45 @@
+# Copyright (c) 2021 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#!/bin/bash
+
+mkdir -p build
+pushd build
+
+cmake .. || exit 1
+make || exit 1
+
+echo "Installing..."
+sudo make install || exit 1
+popd
+
+BUILD_DIR="build/build-root/lib"
+SO_LIB="packethicn.so"
+
+WS_LIB_PATH_LIST=$(otool -L $BUILD_DIR/$SO_LIB | grep wireshark | awk '{print $1}')
+
+while IFS= read -r PATHL; do
+ LIB=$(echo $PATHL | cut -d / -f 7)
+ install_name_tool -change $PATHL @rpath/$LIB $BUILD_DIR/$SO_LIB
+done <<< "$WS_LIB_PATH_LIST"
+
+WS_GUI_PATH_LIST=$(find /usr/local -name Wireshark.app -print 2>/dev/null)
+if [ $? == 0 ]; then
+ while IFS= read -r PATHL; do
+ EPAN_PATH=$(find ${PATHL}/Contents -name epan)
+ cp $BUILD_DIR/$SO_LIB $EPAN_PATH
+ echo "Installed $BUILD_DIR/$SO_LIB in $EPAN_PATH"
+ done <<< "$WS_GUI_PATH_LIST"
+else
+ echo "Can't find the Wireshark GUI. Please copy $BUILD_DIR/$SO_LIB into the Wireshark plugin folder"
+fi