summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2009-11-11 16:20:37 +0000
committerJörg Mayer <jmayer@loplof.de>2009-11-11 16:20:37 +0000
commit564500f8738fdddbd3ea9dc2ea33c646e1b28618 (patch)
tree11da04f898a09052431f93cc9148c712facc9d0d
parent632b0aef98d8968fa21e59002afb8fb8b6d9ac3f (diff)
downloadwireshark-564500f8738fdddbd3ea9dc2ea33c646e1b28618.tar.gz
- Generate manpages and html version of manpages
- Detect pod2man/pod2html to do that - Install manpages and html version thereof svn path=/trunk/; revision=30934
-rw-r--r--CMakeLists.txt116
-rw-r--r--cmake/modules/CMakeInstallDirs.cmake4
-rw-r--r--cmake/modules/FindPOD.cmake85
-rw-r--r--epan/CMakeLists.txt1
-rw-r--r--gtk/CMakeLists.txt3
5 files changed, 187 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77712d2883..bf92cab070 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -270,7 +270,7 @@ find_package(YAPP)
if(HAVE_LIBPYTHON)
set(HAVE_PYTHON 1)
- set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${VERSION}")
+ set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
endif()
if(HAVE_LIBLUA)
set(HAVE_LUA_H 1)
@@ -502,27 +502,24 @@ set(INSTALL_DIRS
set(INSTALL_FILES
${CMAKE_BINARY_DIR}/AUTHORS-SHORT
COPYING
-# capinfos.html
+ ${CMAKE_BINARY_DIR}/capinfos.html
cfilters
colorfilters
-# console.lua
dfilters
-# dtd_gen.lua
-# dumpcap.html
-# editcap.html
-# idl2wrs.html
-# init.lua
-# ipmap.html
+ ${CMAKE_BINARY_DIR}/dumpcap.html
+ ${CMAKE_BINARY_DIR}/editcap.html
+ ${CMAKE_BINARY_DIR}/idl2wrs.html
+ ipmap.html
manuf
-# mergecap.html
-# rawshark.html
+ ${CMAKE_BINARY_DIR}/mergecap.html
+ ${CMAKE_BINARY_DIR}/rawshark.html
services
smi_modules
-# text2pcap.html
-# tshark.html
-# wireshark-filter.html
-# wireshark.html
-# ws.css
+ ${CMAKE_BINARY_DIR}/text2pcap.html
+ ${CMAKE_BINARY_DIR}/tshark.html
+ ${CMAKE_BINARY_DIR}/wireshark-filter.html
+ ${CMAKE_BINARY_DIR}/wireshark.html
+ docbook/ws.css
)
set(LIBEPAN_LIBS
@@ -761,11 +758,82 @@ ADD_CUSTOM_COMMAND(
${CMAKE_SOURCE_DIR}/AUTHORS
)
+ADD_CUSTOM_COMMAND(
+ OUTPUT AUTHORS-SHORT-FORMAT
+ wireshark.pod
+ COMMAND ${PERL}
+ ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
+ ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
+ < AUTHORS-SHORT
+ > AUTHORS-SHORT-FORMAT
+ COMMAND cat
+ ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
+ AUTHORS-SHORT-FORMAT
+ > wireshark.pod
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
+ ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
+ AUTHORS-SHORT
+ ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
+)
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT wireshark-filter.pod
+ COMMAND tshark
+ -G fields |
+ ${PERL}
+ ${CMAKE_SOURCE_DIR}/doc/dfilter2pod.pl
+ ${CMAKE_SOURCE_DIR}/doc/wireshark-filter.pod.template
+ > wireshark-filter.pod
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/dfilter2pod.pl
+ ${CMAKE_SOURCE_DIR}/doc/wireshark-filter.pod.template
+ tshark
+)
+
+find_package(POD)
+
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dumpcap 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/editcap 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/text2pcap 1 )
+pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/tshark 1 )
+pod2manhtml( wireshark 1 )
+pod2manhtml( wireshark-filter 4 )
+
add_custom_target(
auxiliary ALL
DEPENDS
AUTHORS-SHORT
- # todo: Add manpages and onlinedocs and generate them
+ capinfos.html
+ dumpcap.html
+ editcap.html
+ idl2wrs.html
+ mergecap.html
+ rawshark.html
+ text2pcap.html
+ tshark.html
+ wireshark.html
+ wireshark-filter.html
+)
+
+set(MAN1_FILES
+ ${CMAKE_BINARY_DIR}/capinfos.1
+ ${CMAKE_BINARY_DIR}/dumpcap.1
+ ${CMAKE_BINARY_DIR}/editcap.1
+ ${CMAKE_BINARY_DIR}/idl2wrs.1
+ ${CMAKE_BINARY_DIR}/mergecap.1
+ ${CMAKE_BINARY_DIR}/rawshark.1
+ ${CMAKE_BINARY_DIR}/text2pcap.1
+ ${CMAKE_BINARY_DIR}/tshark.1
+ ${CMAKE_BINARY_DIR}/wireshark.1
+)
+
+set(MAN4_FILES
+ ${CMAKE_BINARY_DIR}/wireshark-filter.4
)
set(CLEAN_FILES
@@ -797,6 +865,20 @@ install(
)
install(
+ FILES
+ ${MAN1_FILES}
+ DESTINATION
+ ${CMAKE_INSTALL_MANDIR}/man1
+)
+
+install(
+ FILES
+ ${MAN4_FILES}
+ DESTINATION
+ ${CMAKE_INSTALL_MANDIR}/man4
+)
+
+install(
DIRECTORY
${INSTALL_DIRS}
DIRECTORY_PERMISSIONS
diff --git a/cmake/modules/CMakeInstallDirs.cmake b/cmake/modules/CMakeInstallDirs.cmake
index d503662666..dba19217c2 100644
--- a/cmake/modules/CMakeInstallDirs.cmake
+++ b/cmake/modules/CMakeInstallDirs.cmake
@@ -55,7 +55,7 @@ SET(CMAKE_INSTALL_DATADIR_DOC "read-only architecture-independent data [PR
SET(CMAKE_INSTALL_SYSCONFDIR_DOC "read-only single-machine data [PREFIX/etc]")
SET(CMAKE_INSTALL_LOCALSTATEDIR_DOC "modifiable single-machine data [PREFIX/var]")
SET(CMAKE_INSTALL_LIBDIR_DOC "object code libraries [PREFIX/lib]")
-SET(CMAKE_INSTALL_MANDIR_DOC "man documentation [PREFIX/man]")
+SET(CMAKE_INSTALL_MANDIR_DOC "man documentation [PREFIX/share/man]")
#Special case for /etc and /var when prefix is /usr
IF(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
@@ -76,7 +76,7 @@ SET(CMAKE_INSTALL_LOCALSTATEDIR "var"
CACHE PATH ${CMAKE_INSTALL_LOCALSTATEDIR_DOC})
SET(CMAKE_INSTALL_LIBDIR "lib"
CACHE PATH ${CMAKE_INSTALL_LIBDIR_DOC})
-SET(CMAKE_INSTALL_MANDIR "man"
+SET(CMAKE_INSTALL_MANDIR "share/man"
CACHE PATH ${CMAKE_INSTALL_MANDIR_DOC})
diff --git a/cmake/modules/FindPOD.cmake b/cmake/modules/FindPOD.cmake
new file mode 100644
index 0000000000..2c09ce72b1
--- /dev/null
+++ b/cmake/modules/FindPOD.cmake
@@ -0,0 +1,85 @@
+#
+# $Id$
+#
+# - Find unix commands from cygwin
+# This module looks for some usual Unix commands.
+#
+
+INCLUDE(FindCygwin)
+
+FIND_PROGRAM(POD2MAN_EXECUTABLE
+ NAMES
+ pod2man
+ PATHS
+ ${CYGWIN_INSTALL_PATH}/bin
+ /bin
+ /usr/bin
+ /usr/local/bin
+ /sbin
+)
+
+MARK_AS_ADVANCED(POD2MAN_EXECUTABLE)
+
+# search pod2man
+MACRO(FIND_POD2MAN)
+ IF(NOT POD2MAN_EXECUTABLE)
+ FIND_PROGRAM(POD2MAN_EXECUTABLE pod2man)
+ IF (NOT POD2MAN_EXECUTABLE)
+ MESSAGE(FATAL_ERROR "pod2man not found - aborting")
+ ENDIF (NOT POD2MAN_EXECUTABLE)
+ ENDIF(NOT POD2MAN_EXECUTABLE)
+ENDMACRO(FIND_POD2MAN)
+
+FIND_PROGRAM(POD2HTML_EXECUTABLE
+ NAMES
+ pod2html
+ PATHS
+ ${CYGWIN_INSTALL_PATH}/bin
+ /bin
+ /usr/bin
+ /usr/local/bin
+ /sbin
+)
+
+MARK_AS_ADVANCED(POD2HTML_EXECUTABLE)
+
+# search pod2html
+MACRO(FIND_POD2HTML)
+ IF(NOT POD2HTML_EXECUTABLE)
+ FIND_PROGRAM(POD2HTML_EXECUTABLE pod2html)
+ IF (NOT POD2HTML_EXECUTABLE)
+ MESSAGE(FATAL_ERROR "pod2html not found - aborting")
+ ENDIF (NOT POD2HTML_EXECUTABLE)
+ ENDIF(NOT POD2HTML_EXECUTABLE)
+ENDMACRO(FIND_POD2HTML)
+
+# run pod2man and pod2html
+MACRO(pod2manhtml _sourcefile _manext)
+ GET_FILENAME_COMPONENT(_basefile ${_sourcefile} NAME)
+ set(_outman ${_basefile}.${_manext})
+ set(_outhtml ${_basefile}.html)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT
+ ${_outman}
+ ${_outhtml}
+ COMMAND
+ ${POD2MAN_EXECUTABLE}
+ --section=${_manext}
+ --center="The Wireshark Network Analyzer"
+ --release=${CPACK_PACKAGE_VERSION}
+ ${_sourcefile}.pod
+ > ${_outman}
+ COMMAND
+ ${POD2HTML_EXECUTABLE}
+ --title="${_basefile} - The Wireshark Network Analyzer ${CPACK_PACKAGE_VERSION}"
+ --css=${CMAKE_SOURCE_DIR}/docbook/ws.css
+ --noindex
+ ${_sourcefile}.pod
+ > ${_outhtml}
+ DEPENDS
+ ${_sourcefile}.pod
+ ${CMAKE_SOURCE_DIR}/docbook/ws.css
+
+ )
+ENDMACRO(pod2manhtml)
+
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 03956bfb1e..686c40f743 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -1058,6 +1058,7 @@ set(DISSECTOR_SUPPORT_SRC
set(LIBWIRESHARK_ASM_FILES
asm_utils.c
+# todo
# !IFDEF NASM
# asm_utils_win32_x86.obj: asm_utils_win32_x86.asm
# $(NASM) -f $(WIRESHARK_TARGET_PLATFORM) -o $@ $?
diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt
index 33844b76b0..ad93800b46 100644
--- a/gtk/CMakeLists.txt
+++ b/gtk/CMakeLists.txt
@@ -197,9 +197,6 @@ set(WIRESHARK_TAP_SRC
wsp_stat.c
)
-# todo
-# about_dlg.c main_welcome.c: ../image/wssplash.xpm ../image/wssplash-dev.xpm
-
set(CLEAN_FILES
${WIRESHARK_GTK_SRC}
${WIRESHARK_TAP_SRC}