From 9f30bf6e794a7b431217ce91038a4ec0f917dc08 Mon Sep 17 00:00:00 2001 From: Marco Trinelli Date: Tue, 23 Mar 2021 15:55:01 +0100 Subject: [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 Change-Id: Ie92268d2d3a47c47746107ac6f9c34b21949671c --- extras/packethicn/install_macos.sh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 extras/packethicn/install_macos.sh (limited to 'extras/packethicn/install_macos.sh') 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 -- cgit 1.2.3-korg