Remove a bunch of obsolete code.

We no longer have the code to create a bundle, as we rely on CMake
having done so, at least to the extent of populating the bundle with all
the files we've generated.  Get rid of the code that used to support it,
and the command-line options that are no longer necessary now that we no
longer build code bundles.

Don't have explicit lists of CLI or extcap binaries; instead, just look
for all plain files in Wireshark.app/Contents/MacOS that have read and
execute permissions for owner/group/user.  That way, we don't have to
update the script if we add new binaries or new directories of binaries.

Change-Id: I047296a7889bea71165eebde10f34bec6ea96cc5
Reviewed-on: https://code.wireshark.org/review/26032
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-02-22 20:22:19 -08:00
parent 529bb04910
commit 434d1c9759
1 changed files with 7 additions and 116 deletions

View File

@ -1,9 +1,7 @@
#!/bin/bash
#
# USAGE
# osx-app [-s] [-l /path/to/libraries] -bp /path/to/wireshark/bin
# -lp /path/to/wireshark/lib -ep /path/to/wireshark/extcap/binaries
# -pp /path/to/wireshark/plugins -p /path/to/Info.plist
# osx-app [-s] [-l /path/to/libraries]
#
# This script attempts to build an Wireshark.app bundle for macOS, resolving
# dynamic libraries, etc.
@ -37,51 +35,12 @@
# Defaults
strip=false
binary_path="/tmp/inst/bin"
library_path="/tmp/inst/lib"
plugin_path="/tmp/inst/lib/wireshark/plugins"
extcap_path="/tmp/inst/lib/wireshark/extcap"
plist="./Info.plist"
exclude_prefixes="/System/|/Library/|/usr/lib/|/usr/X11/|/opt/X11/|@rpath|@executable_path"
create_bundle=false
# Bundle always has the same name. Version information is stored in
# the Info.plist file which is filled in by the configure script.
bundle="Wireshark.app"
# Name of the Wireshark executable
wireshark_bin_name="wireshark"
#
# Command-line executables
#
cli_binary_list="
capinfos
dftest
dumpcap
editcap
mergecap
randpkt
rawshark
text2pcap
tshark
"
extcap_binaries="
androiddump
ciscodump
randpktdump
sshdump
udpdump
"
for extcap_binary in $extcap_binaries
do
if [ -x "extcap/$extcap_binary" ]; then
extcap_binary_list="$extcap_binary_list extcap/$extcap_binary"
fi
done
# Location for libraries (tools/macos-setup.sh defaults to whatever the
# various support libraries use as their standard installation location,
# which is /usr/local)
@ -98,7 +57,7 @@ echo -e "
Create an app bundle for macOS
USAGE
$0 [-s] [-l /path/to/libraries] -bp /path/to/wireshark/binaries -p /path/to/Info.plist
$0 [-s] [-l /path/to/libraries]
OPTIONS
-h,--help
@ -109,27 +68,11 @@ OPTIONS
Specify the path to the libraries Wireshark depends on
(typically /sw or /opt/local). By default it is
/usr/local.
-bp,--binary-path
Specify the path to the Wireshark binaries. By default it
is /tmp/inst/bin.
-lp,--library-path
Specify the path to the Wireshark libraries. By default it
is /tmp/inst/lib.
-pp,--plugin-path
Specify the path to the Wireshark plugins. By default it
is /tmp/inst/lib/wireshark/plugins.
-ep,--extcap-path
Specify the path to the Wireshark extcap binaries. By
default it is /tmp/inst/lib/wireshark/extcap.
-p,--plist
Specify the path to Info.plist. Info.plist can be found
in the base directory of the source code once configure
has been run.
-sdkroot
Specify the root of the SDK to use.
EXAMPLE
$0 -s -l /opt/local -bp ../../Build/bin -p Info.plist -sdkroot /Developer/SDKs/MacOSX10.5.sdk
$0 -s -l /opt/local -sdkroot /Developer/SDKs/MacOSX10.5.sdk
"
}
@ -144,23 +87,6 @@ do
-l|--libraries)
LIBPREFIX="$2"
shift 1 ;;
-bp|--binary-path)
binary_path="$2"
shift 1 ;;
-lp|--library-path)
library_path="$2"
shift 1 ;;
-pp|--plugin-path)
plugin_path="$2"
shift 1 ;;
-ep|--extcap-path)
extcap_path="$2"
shift 1 ;;
-cb|--create-bundle)
create_bundle=true;;
-p|--plist)
plist="$2"
shift 1 ;;
-h|--help)
help
exit 0 ;;
@ -180,40 +106,11 @@ if [ ! -e "$LIBPREFIX" ]; then
exit 1
fi
if [ "$create_bundle" = "true" ]; then
echo -e "\nCREATE WIRESHARK APP BUNDLE\n"
if [ ! -x "$binary_path/$wireshark_bin_name" ]; then
echo "Couldn't find $binary_path/$wireshark_bin_name (or it's not executable)" >&2
exit 1
fi
for binary in $cli_binary_list ; do
binary=$( basename $binary )
if [ ! -x "$binary_path/$binary" ]; then
echo "Couldn't find $binary (or it's not executable)" >&2
exit 1
fi
done
for binary in $extcap_binary_list ; do
binary=$( basename $binary )
if [ ! -x "$extcap_path/$binary" ]; then
echo "Couldn't find $binary (or it's not executable)" >&2
exit 1
fi
done
if [ ! -f "$plist" ]; then
echo "Need plist file" >&2
exit 1
fi
elif [ ! -d "$bundle" ] ; then
if [ ! -d "$bundle" ] ; then
echo "$bundle not found" >&2
exit 1
fi
qt_frameworks_dir=$( qmake -query QT_INSTALL_LIBS )
if [ ! -d "$qt_frameworks_dir" ] ; then
echo "Can't find the Qt frameworks directory" >&2
@ -237,16 +134,10 @@ resdir=`pwd`
#
# Get a list of all binaries in the bundle.
# Treat all plain files with read and execute permissions for all as
# binaries.
#
bundle_binary_list=
if [ -z "$bundle_binary_list" ]; then
for binary in Wireshark $cli_binary_list ; do
bundle_binary_list="$bundle_binary_list $pkgexec/$binary"
done
for binary in $extcap_binaries ; do
bundle_binary_list="$bundle_binary_list $pkgexec/extcap/$binary"
done
fi
bundle_binary_list=`find $pkgexec -type f -perm -0555 -print`
echo -e "\nFixing up $bundle...\n"