aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-12-11 16:26:51 -0800
committerGerald Combs <gerald@wireshark.org>2019-09-25 16:26:31 +0000
commitac4f3c0f4ddad04f0be16513357b3f03d6e565ab (patch)
tree9b15779caa9ef8839e43b4d3b4beba939f828115 /CMakeLists.txt
parent1f779bf9c99a75e5ee0dfa709194235175fb809e (diff)
macOS: Make Wireshark.app drag-installable.
Create ChmodBPF installer and uninstaller packages using pkgbuild and productbuild. Place them in Wireshark.app/Resources/Extras. Add a path_helper installer and uninstaller which respectively add and remove /etc/*paths.d/Wireshark. Remove the PackageMaker and utility-launcher assets and build targets. Show a message in the main welcome screen if we don't have capture permissions. Add an link which launches the ChmodBPF installer. Add a "macOS Extras" item to About → Folders. Migrate "Read me first" from RTF to Asciidoctor, which lets us add links and looks like our other documentation. Rename dmg_set_style.scpt to arrange_dmg.applescript and make it plain text. Always run it in osx-dmg.sh. Bug: 6991 Bug: 12593 Bug: 11399 Ping-Bug: 16074 Change-Id: I7b6aa89aae2be522b4141b0d44e8142dec749e90 Reviewed-on: https://code.wireshark.org/review/31047 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt148
1 files changed, 123 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index faa463d0c6..5ee6e53a7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1193,6 +1193,8 @@ endif()
# Windows version updates
ws_find_package(WINSPARKLE ENABLE_WINSPARKLE HAVE_SOFTWARE_UPDATE)
+find_package( Asciidoctor 1.5 )
+
find_package(POD REQUIRED)
find_package(DOXYGEN)
@@ -1552,10 +1554,9 @@ set(CFG_OUT_FILES
image/wiretap.rc
image/wireshark.exe.manifest
packaging/macosx/Info.plist
+ packaging/macosx/arrange_dmg.applescript
packaging/macosx/osx-app.sh
packaging/macosx/osx-dmg.sh
- packaging/macosx/Read_me_first.rtf
- packaging/macosx/Wireshark_package.pmdoc/index.xml
packaging/source/git-export-release.sh
wireshark.pc
)
@@ -2764,6 +2765,109 @@ if (MAXMINDDB_FOUND)
endif()
if(ENABLE_APPLICATION_BUNDLE)
+ set (install_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/install.ChmodBPF.pkg")
+ add_custom_command(OUTPUT "${install_chmodbpf_component_pkg}"
+ COMMAND pkgbuild
+ --identifier org.wireshark.ChmodBPF.pkg
+ --version 1.1
+ --root "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root"
+ --scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts"
+ ${install_chmodbpf_component_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF"
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts/postinstall"
+ )
+ set (install_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Install ChmodBPF.pkg")
+ add_custom_command(OUTPUT "${install_chmodbpf_pkg}"
+ COMMAND productbuild
+ --identifier org.wireshark.install.ChmodBPF.product
+ --version 1.1
+ --distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
+ --package-path "${CMAKE_BINARY_DIR}"
+ ${install_chmodbpf_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
+ ${install_chmodbpf_component_pkg}
+ )
+
+ set (uninstall_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/uninstall.ChmodBPF.pkg")
+ add_custom_command(OUTPUT "${uninstall_chmodbpf_component_pkg}"
+ COMMAND pkgbuild
+ --identifier org.wireshark.uninstall.ChmodBPF.pkg
+ --version 1.1
+ --nopayload
+ --scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts"
+ ${uninstall_chmodbpf_component_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts/postinstall"
+ )
+ set (uninstall_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Uninstall ChmodBPF.pkg")
+ add_custom_command(OUTPUT "${uninstall_chmodbpf_pkg}"
+ COMMAND productbuild
+ --identifier org.wireshark.uninstall.ChmodBPF.product
+ --version 1.1
+ --distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
+ --package-path "${CMAKE_BINARY_DIR}"
+ ${uninstall_chmodbpf_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
+ ${uninstall_chmodbpf_component_pkg}
+ )
+
+ add_custom_target(chmodbpf DEPENDS ${install_chmodbpf_pkg} ${uninstall_chmodbpf_pkg})
+
+ set (install_path_helper_component_pkg "${CMAKE_BINARY_DIR}/install.path_helper.pkg")
+ add_custom_command(OUTPUT "${install_path_helper_component_pkg}"
+ COMMAND pkgbuild
+ --identifier org.wireshark.path_helper.pkg
+ --version 1.0
+ --root "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc"
+ --install-location /private/etc
+ ${install_path_helper_component_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/paths.d/Wireshark"
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/manpaths.d/Wireshark"
+ )
+ set (install_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Add Wireshark to the system path.pkg")
+ add_custom_command(OUTPUT "${install_path_helper_pkg}"
+ COMMAND productbuild
+ --identifier org.wireshark.install.path_helper.product
+ --version 1.0
+ --distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
+ --package-path "${CMAKE_BINARY_DIR}"
+ ${install_path_helper_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
+ ${install_path_helper_component_pkg}
+ )
+
+ set (uninstall_path_helper_component_pkg "${CMAKE_BINARY_DIR}/uninstall.path_helper.pkg")
+ add_custom_command(OUTPUT "${uninstall_path_helper_component_pkg}"
+ COMMAND pkgbuild
+ --identifier org.wireshark.uninstall.path_helper.pkg
+ --version 1.0
+ --nopayload
+ --scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts"
+ ${uninstall_path_helper_component_pkg}
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts/postinstall"
+ )
+ set (uninstall_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Remove Wireshark from the system path.pkg")
+ add_custom_command(OUTPUT "${uninstall_path_helper_pkg}"
+ COMMAND productbuild
+ --identifier org.wireshark.uninstall.path_helper.product
+ --version 1.0
+ --distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml"
+ --package-path "${CMAKE_BINARY_DIR}"
+ ${uninstall_path_helper_pkg}
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml
+ ${uninstall_path_helper_component_pkg}
+ )
+
+ add_custom_target(path_helper DEPENDS ${install_path_helper_pkg} ${uninstall_path_helper_pkg})
+
add_custom_target(app_bundle)
set_target_properties(app_bundle PROPERTIES FOLDER "Copy Tasks")
add_custom_command(TARGET app_bundle
@@ -2771,37 +2875,31 @@ if(ENABLE_APPLICATION_BUNDLE)
COMMAND "${CMAKE_BINARY_DIR}/packaging/macosx/osx-app.sh"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run"
)
- add_dependencies(app_bundle ${PROGLIST})
+ add_dependencies(app_bundle ${PROGLIST} chmodbpf path_helper)
add_custom_target(dmg_package_prep DEPENDS app_bundle)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
- COMMAND ${CMAKE_COMMAND} -E echo APPLWshk > ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
- )
+ if( ASCIIDOCTOR_FOUND )
+ ADD_CUSTOM_COMMAND(
+ OUTPUT
+ packaging/macosx/Read_me_first.html
+ COMMAND ${ASCIIDOCTOR_EXECUTABLE}
+ --backend html
+ --out-file packaging/macosx/Read_me_first.html
+ --attribute include-dir=${CMAKE_SOURCE_DIR}/docbook
+ --attribute min-macos-version=${MIN_MACOS_VERSION}
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
+ )
+ add_custom_target(read_me_first_html DEPENDS packaging/macosx/Read_me_first.html )
+ add_dependencies(dmg_package_prep read_me_first_html)
+ endif()
ADD_CUSTOM_TARGET( dmg_package
- 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/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_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
# Unlike nsis_package_prep + nsis_package, we can add a direct