From 5d3ffe9b57cbd073b2ad3742f8be9768c324bb62 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 20 Feb 2022 16:19:22 -0800 Subject: [PATCH] More Logshark to Logwolf renaming. --- CMakeLists.txt | 83 ++++++++++--------- CMakeOptions.txt | 4 +- cmake/modules/WiresharkPlugin.cmake | 8 ++ ...harkInfo.plist.in => LogwolfInfo.plist.in} | 6 +- 4 files changed, 57 insertions(+), 44 deletions(-) rename packaging/macosx/{LogsharkInfo.plist.in => LogwolfInfo.plist.in} (89%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e07a5336f..1aeaa9319b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1179,7 +1179,7 @@ ws_find_package(AIRPCAP ENABLE_AIRPCAP HAVE_AIRPCAP) ws_find_package(Systemd BUILD_sdjournal HAVE_SYSTEMD) # Build one of the Qt GUIs? -if(BUILD_wireshark OR BUILD_logshark) +if(BUILD_wireshark OR BUILD_logwolf) if(USE_qt6) set(qtver "6") if(DEFINED ENV{WIRESHARK_QT6_PREFIX_PATH}) @@ -1340,7 +1340,7 @@ find_package( Asciidoctor 1.5 ) find_package(DOXYGEN) # The SpeexDSP resampler is required iff building wireshark or sharkd. -if(BUILD_wireshark OR BUILD_logshark OR BUILD_sharkd) +if(BUILD_wireshark OR BUILD_logwolf OR BUILD_sharkd) # We don't provide a binary package for SpeexDSP in our repository. # If using the repository don't bother searching for a system SpeexDSP # installation and just use the bundled resampler code instead. @@ -1583,7 +1583,7 @@ if(BUILD_wireshark AND QT_FOUND) add_subdirectory( ui/qt ) endif() -if(BUILD_logshark AND QT_FOUND) +if(BUILD_logwolf AND QT_FOUND) add_subdirectory( ui/qt_logwolf ) endif() @@ -1616,8 +1616,9 @@ if(ENABLE_PLUGINS) plugins/codecs/l16_mono ${CUSTOM_PLUGIN_SRC_DIR} ) + set(LOGWOLF_PLUGIN_SRC_DIRS) if(SINSP_FOUND) - list(APPEND PLUGIN_SRC_DIRS + list(APPEND LOGWOLF_PLUGIN_SRC_DIRS plugins/epan/falco_bridge ) endif() @@ -1658,6 +1659,7 @@ if(ENABLE_PLUGINS) else() set(PLUGIN_SRC_DIRS ) + set(LOGWOLF_PLUGIN_SRC_DIRS ) endif() if(ENABLE_APPLICATION_BUNDLE) @@ -1668,19 +1670,22 @@ if(ENABLE_APPLICATION_BUNDLE) set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}") endif() if(CMAKE_CFG_INTDIR STREQUAL ".") - set(_logshark_plugin_dir "${CMAKE_BINARY_DIR}/run/Logshark.app/Contents/PlugIns/logwolf/${PLUGIN_PATH_ID}") + set(_logwolf_plugin_dir "${CMAKE_BINARY_DIR}/run/Logwolf.app/Contents/PlugIns/logwolf/${PLUGIN_PATH_ID}") else() # Xcode - set(_logshark_plugin_dir "${CMAKE_BINARY_DIR}/run/$/Logshark.app/Contents/PlugIns/logwolf/${PLUGIN_PATH_ID}") + set(_logwolf_plugin_dir "${CMAKE_BINARY_DIR}/run/$/Logwolf.app/Contents/PlugIns/logwolf/${PLUGIN_PATH_ID}") endif() elseif(WIN32 AND NOT CMAKE_CFG_INTDIR STREQUAL ".") set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$/${PLUGIN_VERSION_DIR}") + set(_logwolf_plugin_dir ${_plugin_dir}) else() set(_plugin_dir "${DATAFILE_DIR}/${PLUGIN_VERSION_DIR}") + set(_logwolf_plugin_dir ${_plugin_dir}) endif() set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.") +set (LOGWOLF_PLUGIN_DIR ${_logwolf_plugin_dir} CACHE INTERNAL "Build time Logwolf plugin location.") -foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS}) +foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS} ${LOGWOLF_PLUGIN_SRC_DIRS}) add_subdirectory( ${_plugin_src_dir} ) endforeach() @@ -1720,12 +1725,12 @@ set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CFG_OUT_FILES doxygen.cfg - packaging/macosx/WiresharkInfo.plist - packaging/macosx/LogsharkInfo.plist + packaging/macosx/LogwolfInfo.plist packaging/macosx/osx-app.sh packaging/macosx/osx-dmg.sh packaging/macosx/wireshark-app.dmgbuild packaging/macosx/wireshark-dsym.dmgbuild + packaging/macosx/WiresharkInfo.plist packaging/source/git-export-release.sh resources/dumpcap.rc resources/libwireshark.rc @@ -2443,20 +2448,20 @@ if(BUILD_wireshark AND QT_FOUND) set_executable_resources(wireshark "Wireshark" UNIQUE_RC) endif() -if(BUILD_logshark AND QT_FOUND) - set(LOGSHARK_SRC +if(BUILD_logwolf AND QT_FOUND) + set(LOGWOLF_SRC file.c fileset.c ${PLATFORM_UI_SRC} ) - set(logshark_FILES + set(logwolf_FILES $ $ $ - ${LOGSHARK_SRC} + ${LOGWOLF_SRC} ${PLATFORM_UI_RC_FILES} ) - set_executable_resources(logshark "Logshark" UNIQUE_RC) + set_executable_resources(logwolf "Logwolf" UNIQUE_RC) endif() if(ENABLE_APPLICATION_BUNDLE) @@ -2633,8 +2638,8 @@ if(BUILD_wireshark AND QT_FOUND) endif(QT_WINDEPLOYQT_EXECUTABLE) endif() -if(BUILD_logshark AND QT_FOUND) - set(logshark_LIBS +if(BUILD_logwolf AND QT_FOUND) + set(logwolf_LIBS ui capchild caputils @@ -2655,12 +2660,12 @@ if(BUILD_logshark AND QT_FOUND) ${MINIZIP_LIBRARIES} ) - add_executable(logshark WIN32 MACOSX_BUNDLE ${logshark_FILES} ${EXTRA_BUNDLE_FILES}) + add_executable(logwolf WIN32 MACOSX_BUNDLE ${logwolf_FILES} ${EXTRA_BUNDLE_FILES}) if(WIN32 AND NOT BUILD_wireshark) - set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT logshark) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT logwolf) endif() - set(PROGLIST ${PROGLIST} logshark) - set_target_properties(logshark PROPERTIES + set(PROGLIST ${PROGLIST} logwolf) + set_target_properties(logwolf PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}" FOLDER "Executables" INSTALL_RPATH "${EXECUTABLE_INSTALL_RPATH}" @@ -2669,44 +2674,44 @@ if(BUILD_logshark AND QT_FOUND) AUTORCC ON ) if(MSVC) - set_target_properties(logshark PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}") + set_target_properties(logwolf PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}") endif() if(ENABLE_APPLICATION_BUNDLE OR WIN32) - set_target_properties(logshark PROPERTIES OUTPUT_NAME Logshark) + set_target_properties(logwolf PROPERTIES OUTPUT_NAME Logwolf) endif() if(ENABLE_APPLICATION_BUNDLE) if(ASCIIDOCTOR_FOUND) # Make sure to generate files referenced by # BUNDLE_RESOURCE_SHARE_MAN1_FILES - add_dependencies(logshark manpages) + add_dependencies(logwolf manpages) endif() set_target_properties( - logshark PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/packaging/macosx/LogsharkInfo.plist + logwolf PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/packaging/macosx/LogwolfInfo.plist ) if(CMAKE_CFG_INTDIR STREQUAL ".") # Add a wrapper script which opens the bundle. This adds # convenience but makes debugging more difficult. # It is not created if using Xcode - # XXX Running run/Logshark.app/Contents/MacOS/Logshark works + # XXX Running run/Logwolf.app/Contents/MacOS/Logwolf works # fine for me (Gerald) here on Mojave. Can we just make this a # symlink? - file(REMOVE ${CMAKE_BINARY_DIR}/run/logshark) - file(WRITE ${CMAKE_BINARY_DIR}/run/logshark "#!/bin/sh\n") - file(APPEND ${CMAKE_BINARY_DIR}/run/logshark "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n") - file(APPEND ${CMAKE_BINARY_DIR}/run/logshark "# Wrapper script which should work around the issue described at\n") - file(APPEND ${CMAKE_BINARY_DIR}/run/logshark "# https://stackoverflow.com/questions/25318524/what-exactly-should-i-pass-to-nsapp-activateignoringotherapps-to-get-my-appl\n") - file(APPEND ${CMAKE_BINARY_DIR}/run/logshark "exec ${CMAKE_BINARY_DIR}/run/Logshark.app/Contents/MacOS/Logshark \"\$\@\"\n") - execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/logshark) + file(REMOVE ${CMAKE_BINARY_DIR}/run/logwolf) + file(WRITE ${CMAKE_BINARY_DIR}/run/logwolf "#!/bin/sh\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/logwolf "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/logwolf "# Wrapper script which should work around the issue described at\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/logwolf "# https://stackoverflow.com/questions/25318524/what-exactly-should-i-pass-to-nsapp-activateignoringotherapps-to-get-my-appl\n") + file(APPEND ${CMAKE_BINARY_DIR}/run/logwolf "exec ${CMAKE_BINARY_DIR}/run/Logwolf.app/Contents/MacOS/Logwolf \"\$\@\"\n") + execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/logwolf) endif() endif() - target_link_libraries(logshark ${logshark_LIBS}) - target_include_directories(logshark SYSTEM PRIVATE ${SPARKLE_INCLUDE_DIRS}) + target_link_libraries(logwolf ${logwolf_LIBS}) + target_include_directories(logwolf SYSTEM PRIVATE ${SPARKLE_INCLUDE_DIRS}) install( - TARGETS logshark + TARGETS logwolf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} ) @@ -2723,14 +2728,14 @@ if(BUILD_logshark AND QT_FOUND) --no-compiler-runtime --verbose 0 $<$:--pdb> - "$" + "$" ) - add_dependencies(copy_ls_qt_dlls logshark) + add_dependencies(copy_ls_qt_dlls logwolf) install(CODE "execute_process(COMMAND \"${QT_WINDEPLOYQT_EXECUTABLE}\" --no-compiler-runtime - \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/Logshark.exe\")" + \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/Logwolf.exe\")" ) endif(QT_WINDEPLOYQT_EXECUTABLE) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index d62c649ce5..e077965440 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -1,8 +1,8 @@ # Build options for use by CMake option(BUILD_wireshark "Build Wireshark" ON) -option(BUILD_logshark "Build Logshark" OFF) -if(BUILD_wireshark OR BUILD_logshark) +option(BUILD_logwolf "Build Logwolf" OFF) +if(BUILD_wireshark OR BUILD_logwolf) option(USE_qt6 "Use Qt6 instead of Qt5 - WIP, GUI developers only!" OFF) endif() option(BUILD_tshark "Build tshark" ON) diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake index dc5926807a..8b942004aa 100644 --- a/cmake/modules/WiresharkPlugin.cmake +++ b/cmake/modules/WiresharkPlugin.cmake @@ -53,6 +53,14 @@ macro(ADD_PLUGIN_LIBRARY _plugin _subfolder) add_dependencies(plugins ${_plugin}) endmacro() +macro(ADD_LOGWOLF_PLUGIN_LIBRARY _plugin _subfolder) + ADD_PLUGIN_LIBRARY(${_plugin} ${_subfolder}) + + set_target_properties(${_plugin} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${LOGWOLF_PLUGIN_DIR}/${_subfolder} + ) +endmacro() + macro(INSTALL_PLUGIN _plugin _subfolder) install(TARGETS ${_plugin} LIBRARY DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR}/${_subfolder} NAMELINK_SKIP diff --git a/packaging/macosx/LogsharkInfo.plist.in b/packaging/macosx/LogwolfInfo.plist.in similarity index 89% rename from packaging/macosx/LogsharkInfo.plist.in rename to packaging/macosx/LogwolfInfo.plist.in index 94c694db34..622340becf 100644 --- a/packaging/macosx/LogsharkInfo.plist.in +++ b/packaging/macosx/LogwolfInfo.plist.in @@ -5,13 +5,13 @@ CFBundleDevelopmentRegion English CFBundleExecutable - Logshark + Logwolf CFBundleGetInfoString @VERSION@, Copyright 1998-2022 Wireshark Development Team CFBundleIconFile Wireshark.icns CFBundleIdentifier - org.wireshark.Logshark + org.wireshark.Logwolf CFBundleDocumentTypes @@ -53,7 +53,7 @@ SUFeedURL - https://www.wireshark.org/update/0/Logshark/@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml + https://www.wireshark.org/update/0/Logwolf/@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml SUEnableAutomaticChecks SUPublicEDKey