diff options
-rw-r--r-- | CMakeLists.txt | 52 | ||||
-rwxr-xr-x | packaging/macosx/osx-app.sh | 4 | ||||
-rwxr-xr-x | packaging/macosx/osx-dmg.sh.in | 24 |
3 files changed, 72 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aae4cb1752..3f1bd356ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1084,6 +1084,8 @@ set( IN_FILES image/wiretap.rc.in image/wireshark.exe.manifest.in packaging/macosx/Info.plist.in + packaging/macosx/osx-dmg.sh.in + packaging/macosx/Wireshark_package.pmdoc/index.xml.in ${CUSTOM_PLUGIN_IN_FILES} ui/doxygen.cfg.in ui/gtk/doxygen.cfg.in @@ -2298,6 +2300,56 @@ if(ENABLE_APPLICATION_BUNDLE) WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run" ) add_dependencies(app_bundle ${PROGLIST}) + + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo + COMMAND ${CMAKE_COMMAND} -E echo APPLWshk > ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo + ) + + ADD_CUSTOM_TARGET( osx-app + COMMAND ${CMAKE_SOURCE_DIR}/packaging/macosx/osx-app.sh + DEPENDS ${CMAKE_BINARY_DIR}/run/Wireshark.app + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run + ) + + ADD_CUSTOM_TARGET( osx-dmg + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${PROJECT_SOURCE_DIR}/ipmap.html" + $<TARGET_FILE_DIR:wireshark> + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF + ${CMAKE_BINARY_DIR}/run/ChmodBPF + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/packaging/macosx/Resources + ${CMAKE_BINARY_DIR}/run/Resources + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/packaging/macosx/Scripts + ${CMAKE_BINARY_DIR}/run/Scripts + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/packaging/macosx/utility-launcher + ${CMAKE_BINARY_DIR}/run/utility-launcher + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/COPYING + ${CMAKE_BINARY_DIR}/run/COPYING.txt + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark.pkgproj + ${CMAKE_BINARY_DIR}/run/Wireshark.pkgproj + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark_package.pmdoc + ${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_BINARY_DIR}/packaging/macosx/Wireshark_package.pmdoc/index.xml + ${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc/index.xml + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/packaging/macosx/dmg_background.png + ${CMAKE_BINARY_DIR}/run/dmg_background.png + COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh + --source-directory ${CMAKE_SOURCE_DIR}/packaging/macosx + DEPENDS osx-app + # We create Wireshark.app in "run". Do our work there. + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run + ) + endif() pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/androiddump 1 ) diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 2eb964186a..7b77b5df2a 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -153,8 +153,6 @@ do shift 1 done -echo -e "\nCREATE WIRESHARK APP BUNDLE\n" - # Safety tests if [ ! -e "$LIBPREFIX" ]; then echo "Cannot find the directory containing the libraries: $LIBPREFIX" >&2 @@ -162,6 +160,8 @@ if [ ! -e "$LIBPREFIX" ]; then fi if [ "$create_bundle" = "true" ]; then + echo -e "\nCREATE WIRESHARK APP BUNDLE\n" + for binary in $wireshark_bin_name $binary_list ; do if [ ! -x "$binary_path/$binary" ]; then echo "Couldn't find $binary (or it's not executable)" >&2 diff --git a/packaging/macosx/osx-dmg.sh.in b/packaging/macosx/osx-dmg.sh.in index d49b655bdd..e14179f6fb 100755 --- a/packaging/macosx/osx-dmg.sh.in +++ b/packaging/macosx/osx-dmg.sh.in @@ -40,10 +40,13 @@ ds_store_root="root.ds_store" app_bundle="Wireshark.app" rw_name="RWwireshark.dmg" volume_name="Wireshark" +src_dir="." tmp_dir="/tmp/dmg-$$" auto_open_opt= -ws_bin="$app_bundle/Contents/MacOS/Wireshark" + +# Qt defaults readme_name="Read_me_first_qt.rtf" +bundle_bin_name="Wireshark" if [ -f /Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker ] then @@ -70,6 +73,9 @@ then elif [ -f /usr/bin/packagemaker ] then packagemaker=/usr/bin/packagemaker +elif [ -f /usr/local/bin/packagemaker ] +then + packagemaker=/usr/local/bin/packagemaker fi if [ -z "$packagemaker" ] then @@ -99,6 +105,9 @@ OPTIONS Use the Qt flavor. This is the default. -gtk,--gtk-flavor Use the GTK+ flavor. + -S,--source-directory + If this is an out-of-tree build, set this to the path + to the packaging/macosx source directory. " } @@ -115,13 +124,14 @@ do app_bundle="$2" shift 1 ;; -qt|--qt-flavor) - readme_name="Read_me_first_qt.rtf" - ws_bin="$app_bundle/Contents/MacOS/Wireshark" ;; -gtk|--gtk-flavor) readme_name="Read_me_first_gtk.rtf" - ws_bin="$app_bundle/Contents/MacOS/wireshark-bin" + bundle_bin_name="wireshark-bin" ;; + -S|--source-directory) + src_dir="$2" + shift 1 ;; *) echo "Invalid command line option" exit 2 ;; @@ -129,6 +139,7 @@ do shift 1 done + # Safety checks if [ ! -e "$app_bundle" ]; then echo "Cannot find application bundle: $app_bundle" @@ -136,6 +147,7 @@ if [ ! -e "$app_bundle" ]; then fi # Get the architecture +ws_bin="$app_bundle/Contents/MacOS/$bundle_bin_name" case `file $ws_bin` in *Mach-O*64-bit*x86_64*) architecture="Intel 64" @@ -199,7 +211,7 @@ echo -e "Copying files to temp directory" # Copy the installer package cp "$pkg_file" "$tmp_dir"/ || exit 1 # Copy the readme -cp "$readme_name" "$tmp_dir"/"Read me first.rtf" || exit 1 +cp "$src_dir/$readme_name" "$tmp_dir"/"Read me first.rtf" || exit 1 # If the appearance settings are not to be modified we just copy them if [ ${set_ds_store} = "false" ]; then @@ -207,7 +219,7 @@ if [ ${set_ds_store} = "false" ]; then # window size, appearance, etc. Most of this can be set # with Apple script but involves user intervention so we # just keep a copy of the correct settings and use that instead. - cp $ds_store_root "$tmp_dir/.DS_Store" || exit 1 + cp $src_dir/$ds_store_root "$tmp_dir/.DS_Store" || exit 1 auto_open_opt=-noautoopen fi |