diff --git a/CMakeLists.txt b/CMakeLists.txt index f354b999f1..f9ae5d57ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1729,8 +1729,42 @@ set(INSTALL_FILES smi_modules wka docbook/ws.css + ${CMAKE_BINARY_DIR}/doc/AUTHORS-SHORT + ${CMAKE_BINARY_DIR}/doc/androiddump.html + ${CMAKE_BINARY_DIR}/doc/udpdump.html + ${CMAKE_BINARY_DIR}/doc/capinfos.html + ${CMAKE_BINARY_DIR}/doc/captype.html + ${CMAKE_BINARY_DIR}/doc/ciscodump.html + ${CMAKE_BINARY_DIR}/doc/dftest.html + ${CMAKE_BINARY_DIR}/doc/dumpcap.html + ${CMAKE_BINARY_DIR}/doc/editcap.html + ${CMAKE_BINARY_DIR}/doc/extcap.html + ${CMAKE_BINARY_DIR}/doc/mergecap.html + ${CMAKE_BINARY_DIR}/doc/randpkt.html + ${CMAKE_BINARY_DIR}/doc/randpktdump.html + ${CMAKE_BINARY_DIR}/doc/rawshark.html + ${CMAKE_BINARY_DIR}/doc/reordercap.html + ${CMAKE_BINARY_DIR}/doc/sshdump.html + ${CMAKE_BINARY_DIR}/doc/text2pcap.html + ${CMAKE_BINARY_DIR}/doc/tshark.html + ${CMAKE_BINARY_DIR}/doc/wireshark.html + ${CMAKE_BINARY_DIR}/doc/wireshark-filter.html ) +if(MAXMINDDB_FOUND) + list(APPEND INSTALL_FILES ${CMAKE_BINARY_DIR}/doc/mmdbresolve.html) +endif() + +if (BUILD_corbaidl2wrs) + list(APPEND INSTALL_FILES ${CMAKE_BINARY_DIR}/doc/idl2wrs.html) +endif() +if (BUILD_xxx2deb) + list(APPEND INSTALL_FILES + ${CMAKE_BINARY_DIR}/doc/asn2deb.html + ${CMAKE_BINARY_DIR}/doc/idl2deb.html + ) +endif() + if(WIN32) set(TEXTIFY_FILES COPYING NEWS README.windows) set(TEXTIFY_MD_FILES README.md) @@ -1972,6 +2006,7 @@ foreach(_install_file ${INSTALL_FILES}) "${_install_file_src}" "${_output_file}" DEPENDS + docs "${_install_file}" ) list(APPEND copy_data_files_depends "${_output_file}") @@ -2000,6 +2035,7 @@ if(LUA_FOUND AND ENABLE_LUA) ) endforeach() endif(LUA_FOUND AND ENABLE_LUA) +# doc/*.html handled elsewhere. # Glob patterns relative to the source directory that should be copied to # ${DATAFILE_DIR} (including directory prefixes) diff --git a/cmake/modules/CopyStaging.cmake b/cmake/modules/CopyStaging.cmake deleted file mode 100644 index 85f736d634..0000000000 --- a/cmake/modules/CopyStaging.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# -# Add a custom target to copy support files to our staging directory. -# -# add_staging_target(Name -# [DEST dir] -# [DEPENDS target1 [target2 ...]] -# FILES file1 [file2 ...]) -# - -function(add_staging_target TARGET_NAME) - cmake_parse_arguments(_ARG "" "DEST" "DEPENDS;FILES" ${ARGN}) - - foreach(_input_file ${_ARG_FILES}) - get_filename_component(_file_basename "${_input_file}" NAME) - if(_ARG_DEST) - set(_dest_dir "${_ARG_DEST}") - else() - set(_dest_dir "${CMAKE_BINARY_DIR}/run") - endif() - set(_output_file "${_dest_dir}/${_file_basename}") - add_custom_command(OUTPUT "${_output_file}" - COMMAND ${CMAKE_COMMAND} -E make_directory - "${_dest_dir}" - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${_input_file}" - "${_output_file}" - DEPENDS - "${_input_file}" - ) - list(APPEND _files_depends "${_output_file}") - endforeach() - - add_custom_target(${TARGET_NAME} ALL DEPENDS ${_files_depends}) - if(_ARG_DEPENDS) - add_dependencies(${TARGET_NAME} ${_ARG_DEPENDS}) - endif() -endfunction() diff --git a/debian/libwsutil0.symbols b/debian/libwsutil0.symbols index 4efa5e2f46..ccbf06bd46 100644 --- a/debian/libwsutil0.symbols +++ b/debian/libwsutil0.symbols @@ -56,7 +56,7 @@ libwsutil.so.0 libwsutil0 #MINVER# crypt_des_ecb@Base 2.3.0 crypto_scalarmult_curve25519@Base 2.9.0 crypto_scalarmult_curve25519_base@Base 2.9.0 - help_file_url@Base 3.1.1 + data_file_url@Base 2.3.0 decrypt_xtea_ecb@Base 2.5.0 decrypt_xtea_le_ecb@Base 2.5.0 delete_persconffile_profile@Base 1.12.0~rc1 @@ -79,7 +79,6 @@ libwsutil.so.0 libwsutil0 #MINVER# get_datafile_dir@Base 1.12.0~rc1 get_datafile_path@Base 1.12.0~rc1 get_dirname@Base 1.12.0~rc1 - get_docfile_dir@Base 3.1.1 get_extcap_dir@Base 1.99.0 get_global_profiles_dir@Base 1.12.0~rc1 get_os_version_info@Base 1.99.0 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f6866c8066..429deaa4f0 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -7,8 +7,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -include(CopyStaging) - add_custom_command( OUTPUT AUTHORS-SHORT COMMAND ${PERL_EXECUTABLE} @@ -213,23 +211,6 @@ add_custom_target( ) set_target_properties(docs PROPERTIES FOLDER "Docs") -if(ENABLE_APPLICATION_BUNDLE) - set(DOC_STAGING_DIR "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/Wireshark.app/Contents/Resources/share/doc/wireshark") -else() - set(DOC_STAGING_DIR "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/doc") -endif() - -add_staging_target(docs_copy_staging - DEST "${DOC_STAGING_DIR}" - DEPENDS docs - FILES ${HTML_INSTALL_FILES} -) - -add_staging_target(authors_copy_staging - DEST "${DATAFILE_DIR}" - FILES ${CMAKE_CURRENT_BINARY_DIR}/AUTHORS-SHORT -) - install( FILES ${MAN1_INSTALL_FILES} @@ -251,13 +232,6 @@ install( ${CMAKE_INSTALL_DOCDIR} ) -install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/AUTHORS-SHORT - DESTINATION - ${CMAKE_INSTALL_DATADIR} -) - # # Editor modelines - https://www.wireshark.org/tools/modelines.html # diff --git a/extcap/androiddump.c b/extcap/androiddump.c index ba464b694e..3832da27b3 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2528,7 +2528,7 @@ int main(int argc, char *argv[]) { extcap_conf = g_new0(extcap_parameters, 1); - help_url = help_file_url("androiddump.html"); + help_url = data_file_url("androiddump.html"); extcap_base_set_util_info(extcap_conf, argv[0], ANDROIDDUMP_VERSION_MAJOR, ANDROIDDUMP_VERSION_MINOR, ANDROIDDUMP_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c index 88148b6595..681d1e1a5d 100644 --- a/extcap/ciscodump.c +++ b/extcap/ciscodump.c @@ -547,7 +547,7 @@ int main(int argc, char *argv[]) g_free(err_msg); } - help_url = help_file_url("ciscodump.html"); + help_url = data_file_url("ciscodump.html"); extcap_base_set_util_info(extcap_conf, argv[0], CISCODUMP_VERSION_MAJOR, CISCODUMP_VERSION_MINOR, CISCODUMP_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/extcap/randpktdump.c b/extcap/randpktdump.c index e489053a6e..659e829be9 100644 --- a/extcap/randpktdump.c +++ b/extcap/randpktdump.c @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) g_free(err_msg); } - help_url = help_file_url("randpktdump.html"); + help_url = data_file_url("randpktdump.html"); extcap_base_set_util_info(extcap_conf, argv[0], RANDPKTDUMP_VERSION_MAJOR, RANDPKTDUMP_VERSION_MINOR, RANDPKTDUMP_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/extcap/sdjournal.c b/extcap/sdjournal.c index 357078c06c..b2a2d5d9e5 100644 --- a/extcap/sdjournal.c +++ b/extcap/sdjournal.c @@ -355,7 +355,7 @@ int main(int argc, char **argv) g_free(init_progfile_dir_error); } - help_url = help_file_url("sdjournal.html"); + help_url = data_file_url("sdjournal.html"); extcap_base_set_util_info(extcap_conf, argv[0], SDJOURNAL_VERSION_MAJOR, SDJOURNAL_VERSION_MINOR, SDJOURNAL_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/extcap/sshdump.c b/extcap/sshdump.c index 70ceb0f27d..84326c1ee2 100644 --- a/extcap/sshdump.c +++ b/extcap/sshdump.c @@ -369,7 +369,7 @@ int main(int argc, char *argv[]) g_free(err_msg); } - help_url = help_file_url("sshdump.html"); + help_url = data_file_url("sshdump.html"); extcap_base_set_util_info(extcap_conf, argv[0], SSHDUMP_VERSION_MAJOR, SSHDUMP_VERSION_MINOR, SSHDUMP_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/extcap/udpdump.c b/extcap/udpdump.c index aa0812541e..bfc725f1f2 100644 --- a/extcap/udpdump.c +++ b/extcap/udpdump.c @@ -380,7 +380,7 @@ int main(int argc, char *argv[]) g_free(err_msg); } - help_url = help_file_url("udpdump.html"); + help_url = data_file_url("udpdump.html"); extcap_base_set_util_info(extcap_conf, argv[0], UDPDUMP_VERSION_MAJOR, UDPDUMP_VERSION_MINOR, UDPDUMP_VERSION_RELEASE, help_url); g_free(help_url); diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index 1646adf52b..1c92387735 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -497,11 +497,11 @@ File "${STAGING_DIR}\wka" File "${STAGING_DIR}\services" File "${STAGING_DIR}\pdml2html.xsl" File "${STAGING_DIR}\ws.css" -File "${STAGING_DIR}\doc\wireshark.html" -File "${STAGING_DIR}\doc\wireshark-filter.html" +File "${STAGING_DIR}\wireshark.html" +File "${STAGING_DIR}\wireshark-filter.html" File "${STAGING_DIR}\dumpcap.exe" -File "${STAGING_DIR}\doc\dumpcap.html" -File "${STAGING_DIR}\doc\extcap.html" +File "${STAGING_DIR}\dumpcap.html" +File "${STAGING_DIR}\extcap.html" File "${STAGING_DIR}\ipmap.html" ; C-runtime redistributable @@ -974,7 +974,7 @@ Section "TShark" SecTShark ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\tshark.exe" -File "${STAGING_DIR}\doc\tshark.html" +File "${STAGING_DIR}\tshark.html" SectionEnd SectionGroup "Plugins & Extensions" SecPluginsGroup @@ -1064,63 +1064,63 @@ Section "Editcap" SecEditcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\editcap.exe" -File "${STAGING_DIR}\doc\editcap.html" +File "${STAGING_DIR}\editcap.html" SectionEnd Section "Text2Pcap" SecText2Pcap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\text2pcap.exe" -File "${STAGING_DIR}\doc\text2pcap.html" +File "${STAGING_DIR}\text2pcap.html" SectionEnd Section "Mergecap" SecMergecap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\mergecap.exe" -File "${STAGING_DIR}\doc\mergecap.html" +File "${STAGING_DIR}\mergecap.html" SectionEnd Section "Reordercap" SecReordercap ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\reordercap.exe" -File "${STAGING_DIR}\doc\reordercap.html" +File "${STAGING_DIR}\reordercap.html" SectionEnd Section "DFTest" SecDFTest ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\dftest.exe" -File "${STAGING_DIR}\doc\dftest.html" +File "${STAGING_DIR}\dftest.html" SectionEnd Section "Capinfos" SecCapinfos ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\capinfos.exe" -File "${STAGING_DIR}\doc\capinfos.html" +File "${STAGING_DIR}\capinfos.html" SectionEnd Section "Rawshark" SecRawshark ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\rawshark.exe" -File "${STAGING_DIR}\doc\rawshark.html" +File "${STAGING_DIR}\rawshark.html" SectionEnd Section /o "Randpkt" SecRandpkt ;------------------------------------------- SetOutPath $INSTDIR File "${STAGING_DIR}\randpkt.exe" -File "${STAGING_DIR}\doc\randpkt.html" +File "${STAGING_DIR}\randpkt.html" SectionEnd !ifdef MMDBRESOLVE_EXE Section "MMDBResolve" SecMMDBResolve ;------------------------------------------- SetOutPath $INSTDIR -File "${STAGING_DIR}\doc\mmdbresolve.html" +File "${STAGING_DIR}\mmdbresolve.html" SetOutPath $INSTDIR File "${STAGING_DIR}\mmdbresolve.exe" SectionEnd @@ -1129,7 +1129,7 @@ SectionEnd Section /o "Androiddump" SecAndroiddumpinfos ;------------------------------------------- SetOutPath $INSTDIR -File "${STAGING_DIR}\doc\androiddump.html" +File "${STAGING_DIR}\androiddump.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\androiddump.exe" SectionEnd @@ -1137,8 +1137,8 @@ SectionEnd Section /o "SSHdump" SecSSHdumpinfos ;------------------------------------------- SetOutPath $INSTDIR -File "${STAGING_DIR}\doc\sshdump.html" -File "${STAGING_DIR}\doc\ciscodump.html" +File "${STAGING_DIR}\sshdump.html" +File "${STAGING_DIR}\ciscodump.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\sshdump.exe" File "${STAGING_DIR}\extcap\ciscodump.exe" @@ -1147,7 +1147,7 @@ SectionEnd Section /o "UDPdump" SecUDPdumpinfos ;------------------------------------------- SetOutPath $INSTDIR -File "${STAGING_DIR}\doc\udpdump.html" +File "${STAGING_DIR}\udpdump.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\udpdump.exe" SectionEnd @@ -1155,7 +1155,7 @@ SectionEnd Section /o "Randpktdump" SecRandpktdumpinfos ;------------------------------------------- SetOutPath $INSTDIR -File "${STAGING_DIR}\doc\randpktdump.html" +File "${STAGING_DIR}\randpktdump.html" SetOutPath $INSTDIR\extcap File "${STAGING_DIR}\extcap\randpktdump.exe" SectionEnd diff --git a/packaging/wix/ComponentGroups.wxi b/packaging/wix/ComponentGroups.wxi index 70e87b32fb..5468978bfd 100644 --- a/packaging/wix/ComponentGroups.wxi +++ b/packaging/wix/ComponentGroups.wxi @@ -58,19 +58,19 @@ - + - + - + - + @@ -228,7 +228,7 @@ - + @@ -274,7 +274,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -328,7 +328,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -382,7 +382,7 @@ - + @@ -400,7 +400,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -460,7 +460,7 @@ - + @@ -480,7 +480,7 @@ - + @@ -500,7 +500,7 @@ - + @@ -520,7 +520,7 @@ - + diff --git a/ui/help_url.c b/ui/help_url.c index 65cb6ffa8f..d8aee0ffb6 100644 --- a/ui/help_url.c +++ b/ui/help_url.c @@ -130,34 +130,34 @@ topic_action_url(topic_action_e action) switch(action) { /* local manual pages */ case(LOCALPAGE_MAN_WIRESHARK): - url = help_file_url("wireshark.html"); + url = data_file_url("wireshark.html"); break; case(LOCALPAGE_MAN_WIRESHARK_FILTER): - url = help_file_url("wireshark-filter.html"); + url = data_file_url("wireshark-filter.html"); break; case(LOCALPAGE_MAN_CAPINFOS): - url = help_file_url("capinfos.html"); + url = data_file_url("capinfos.html"); break; case(LOCALPAGE_MAN_DUMPCAP): - url = help_file_url("dumpcap.html"); + url = data_file_url("dumpcap.html"); break; case(LOCALPAGE_MAN_EDITCAP): - url = help_file_url("editcap.html"); + url = data_file_url("editcap.html"); break; case(LOCALPAGE_MAN_MERGECAP): - url = help_file_url("mergecap.html"); + url = data_file_url("mergecap.html"); break; case(LOCALPAGE_MAN_RAWSHARK): - url = help_file_url("rawshark.html"); + url = data_file_url("rawshark.html"); break; case(LOCALPAGE_MAN_REORDERCAP): - url = help_file_url("reordercap.html"); + url = data_file_url("reordercap.html"); break; case(LOCALPAGE_MAN_TEXT2PCAP): - url = help_file_url("text2pcap.html"); + url = data_file_url("text2pcap.html"); break; case(LOCALPAGE_MAN_TSHARK): - url = help_file_url("tshark.html"); + url = data_file_url("tshark.html"); break; /* local help pages (User's Guide) */ @@ -228,7 +228,7 @@ topic_action_url(topic_action_e action) url = user_guide_url("ChAdvExpert.html"); break; case(HELP_EXTCAP_OPTIONS_DIALOG): - url = help_file_url("extcap.html"); + url = data_file_url("extcap.html"); break; case(HELP_STATS_SUMMARY_DIALOG): url = user_guide_url("ChStatSummary.html"); diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index af6084268d..c7d017cf7b 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -10,7 +10,6 @@ add_definitions(-DPLUGIN_DIR=\"${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}\") add_definitions(-DEXTCAP_DIR=\"${CMAKE_INSTALL_PREFIX}/${EXTCAP_INSTALL_LIBDIR}\") add_definitions(-DDATA_DIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}\") -add_definitions(-DDOC_DIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}\") set(WSUTIL_PUBLIC_HEADERS adler32.h diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 97ec8a7ef7..3526ac1fbb 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -57,7 +57,6 @@ char *persconffile_dir = NULL; char *datafile_dir = NULL; char *persdatafile_dir = NULL; char *persconfprofile = NULL; -char *docfile_dir = NULL; static gboolean do_store_persconffiles = FALSE; static GHashTable *profile_files = NULL; @@ -1884,32 +1883,6 @@ get_datafile_path(const char *filename) } } -static void init_docfile_dir(void) -{ - if (running_in_build_directory_flag) { - docfile_dir = g_build_filename(get_progfile_dir(), "doc", NULL); - return; - } -#ifdef _WIN32 - docfile_dir = g_strdup(get_progfile_dir()); -#else -#ifdef __APPLE__ - if (appbundle_dir != NULL) { - docfile_dir = g_build_filename(appbundle_dir, "Contents/Resources/share/doc/wireshark", (gchar *)NULL); - return; - } -#endif - docfile_dir = g_strdup(DOC_DIR); -#endif -} - -const char *get_docfile_dir(void) -{ - if (!docfile_dir) - init_docfile_dir(); - return docfile_dir; -} - /* * Return an error message for UNIX-style errno indications on open or * create operations. @@ -2288,7 +2261,7 @@ done: } gchar * -help_file_url(const gchar *filename) +data_file_url(const gchar *filename) { gchar *file_path; gchar *uri; @@ -2297,7 +2270,7 @@ help_file_url(const gchar *filename) if(g_path_is_absolute(filename)) { file_path = g_strdup(filename); } else { - file_path = g_build_filename(get_docfile_dir(), filename, NULL); + file_path = g_strdup_printf("%s/%s", get_datafile_dir(), filename); } /* XXX - check, if the file is really existing, otherwise display a simple_dialog about the problem */ @@ -2333,8 +2306,6 @@ free_progdirs(void) #endif g_free(extcap_dir); extcap_dir = NULL; - g_free(docfile_dir); - docfile_dir = NULL; } /* diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index e34a3616e6..b204fe5932 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -65,11 +65,6 @@ WS_DLL_PUBLIC const char *get_plugins_pers_dir_with_version(void); */ WS_DLL_PUBLIC const char *get_extcap_dir(void); -/* - * Get the directory in which document files are stored. - */ -WS_DLL_PUBLIC const char *get_docfile_dir(void); - /* * Get the flag indicating whether we're running from a build * directory. @@ -326,15 +321,15 @@ WS_DLL_PUBLIC gboolean copy_file_binary_mode(const char *from_filename, /* - * Given a help filename return a filesystem URL. Relative paths are prefixed with - * the directory path. + * Given a filename return a filesystem URL. Relative paths are prefixed with + * the datafile directory path. * * @param filename A file name or path. Relative paths will be prefixed with - * the directory path. + * the data file directory path. * @return A filesystem URL for the file or NULL on failure. A non-NULL return * value must be freed with g_free(). */ -WS_DLL_PUBLIC gchar* help_file_url(const gchar *filename); +WS_DLL_PUBLIC gchar* data_file_url(const gchar *filename); /* * Free the internal structtures