Switch from AsciiDoc to Asciidoctor.

Switch the markup text processor for files in the docbook directory from
AsciiDoc to Asciidoctor. Asciidoctor has several useful features (such
as direct PDF output) and is actively developed. It's written in Ruby
but that dependency can be sidestepped with AsciidoctorJ, a
self-contained bundle that only depends on the JRE.

The current toolchain targets require Python, AsciiDoc, DocBook XML,
DocBook XSL, Java, FOP, xsltproc, lynx, and the HTMLHelp compiler:

HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
PDF: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → FOP
HTMLHelp: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → HHC

This change removes the AsciiDoc and FOP requirements and adds either
AsciidoctorJ or Asciidoctor + Ruby:

HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
PDF: Asciidoctor
HTMLHelp: Asciidoctor → DocBook XML → xsltproc + DocBook XSL → HHC

Ideally we could generate all of these using AsciidoctorJ, Java, and
lynx. Unfortunately we're not there yet.

The release notes depend on several macros (ws-buglink, ws-salink,
cve-idlink, sort-and-group). Add Asciidoctor (Ruby) equivalents.

Remove the BUILD_xxx_GUIDES CMake options and add various output targets
automatically. This means that you have to build the various documentation
targets explicitly.

Change-Id: I31930677a656b99b1c6839bb6c33a13db951eb9a
Reviewed-on: https://code.wireshark.org/review/25668
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2017-10-19 15:03:55 -07:00
parent 5a674d05c9
commit 94a0f7c641
35 changed files with 666 additions and 1217 deletions

View File

@ -1037,9 +1037,7 @@ endif()
set(PACKAGELIST ${PACKAGELIST} POD)
if(ENABLE_HTML_GUIDES)
set(PACKAGELIST ${PACKAGELIST} DOXYGEN)
endif()
set(PACKAGELIST ${PACKAGELIST} DOXYGEN)
set(PROGLIST)
@ -1296,7 +1294,7 @@ add_subdirectory( capchild )
add_subdirectory( caputils )
add_subdirectory( codecs )
add_subdirectory( doc )
add_subdirectory( docbook )
add_subdirectory( docbook EXCLUDE_FROM_ALL )
add_subdirectory( epan )
add_subdirectory( randpkt_core )
add_subdirectory( tools/lemon )
@ -3249,7 +3247,6 @@ if (NOT "${SHELLCHECK_EXECUTABLE}" STREQUAL "SHELLCHECK_EXECUTABLE-NOTFOUND")
COMMAND shellcheck --external-sources
tools/fuzz-test.sh
tools/randpkt-test.sh
tools/runa2x.sh
tools/test-captures.sh
tools/valgrind-wireshark.sh
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"

View File

@ -57,11 +57,6 @@ endif()
option(ENABLE_STATIC "Build Wireshark libraries statically" OFF)
option(ENABLE_PLUGINS "Build with plugins" ON)
option(ENABLE_PLUGIN_IFDEMO "Build with plugin interface demo" OFF)
option(ENABLE_HTML_GUIDES "Build HTML User & Developer Guides" OFF)
option(ENABLE_PDF_GUIDES "Build PDF User & Developer Guides" OFF)
if(WIN32)
option(ENABLE_CHM_GUIDES "Build HTML Help User & Developer Guides" OFF)
endif()
option(ENABLE_PCAP_NG_DEFAULT "Enable pcapng as default file format" ON)
option(ENABLE_PORTAUDIO "Build with PortAudio support" ON)

View File

@ -1001,7 +1001,6 @@ shellcheck:
$(SHELLCHECK) --external-sources \
tools/fuzz-test.sh \
tools/randpkt-test.sh \
tools/runa2x.sh \
tools/test-captures.sh \
tools/valgrind-wireshark.sh

View File

@ -1,262 +0,0 @@
#
# - Find unix commands from cygwin
# This module looks for some usual Unix commands.
#
INCLUDE(FindCygwin)
FIND_PROGRAM(A2X_EXECUTABLE
NAMES
a2x
PATHS
${CYGWIN_INSTALL_PATH}/bin
/bin
/usr/bin
/usr/local/bin
/sbin
)
string( TOLOWER "${CYGWIN_INSTALL_PATH}" l_cyg_path)
string( TOLOWER "${A2X_EXECUTABLE}" l_a2x_ex)
if (NOT "${CYGWIN_INSTALL_PATH}" STREQUAL "" AND "${l_a2x_ex}" MATCHES "${l_cyg_path}")
message(STATUS "Using Cygwin a2x")
# We have most likely found a symlink to a2x.py. This won't work from the Windows shell.
FIND_PROGRAM(CYGPATH_EXECUTABLE
NAMES cygpath
PATHS ${CYGWIN_INSTALL_PATH}/bin
)
MACRO( TO_A2X_COMPATIBLE_PATH _cmake_path _result )
execute_process(
COMMAND ${CYGPATH_EXECUTABLE} -u ${_cmake_path}
OUTPUT_VARIABLE _cygwin_path
)
# cygpath adds a linefeed.
string(STRIP "${_cygwin_path}" _cygwin_path)
set( ${_result} ${_cygwin_path} )
ENDMACRO()
TO_A2X_COMPATIBLE_PATH( ${CMAKE_SOURCE_DIR}/tools/runa2x.sh RUNA2X_CYGWIN_PATH )
# It's difficult or impossible to call /usr/bin/a2x directly from
# Windows because:
# - /usr/bin/a2x, which is a symlink to /usr/bin/a2x.py.
# - We need to set environment variables (LC_ALL, PATH, TZ, PYTHONHOME)
# so we use a wrapper script.
set( RUNA2X ${SH_EXECUTABLE} ${RUNA2X_CYGWIN_PATH} )
else()
# Make sure we don't get language specific quotes
set( RUNA2X LC_ALL=C TZ=UTC ${A2X_EXECUTABLE} )
MACRO( TO_A2X_COMPATIBLE_PATH _cmake_path _result )
set( ${_result} ${_cmake_path} )
ENDMACRO()
endif()
# Handle the QUIETLY and REQUIRED arguments and set ASCIIDOC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASCIIDOC DEFAULT_MSG RUNA2X)
MARK_AS_ADVANCED(RUNA2X)
TO_A2X_COMPATIBLE_PATH( ${CMAKE_CURRENT_BINARY_DIR} _a2x_current_binary_dir )
MACRO( ASCIIDOC2DOCBOOK _asciidocsource _conf_files _src_files _built_deps )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
set( A2X_HTML_OPTS --stylesheet=ws.css )
set( _output_xml ${_source_base_name}.xml )
foreach(_conf_file ${${_conf_files}})
TO_A2X_COMPATIBLE_PATH ( ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} _a2x_conf_file )
set( _conf_opts_list ${_conf_opts_list} --conf-file=${_a2x_conf_file})
endforeach()
string( REPLACE ";" " " _conf_opts "${_conf_opts_list}")
foreach(_conf_file ${${_conf_files}})
set( _conf_deps ${_conf_deps} ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file})
endforeach()
foreach(_src_file ${${_src_files}})
set( _src_deps ${_src_deps} ${CMAKE_CURRENT_SOURCE_DIR}/${_src_file})
endforeach()
TO_A2X_COMPATIBLE_PATH ( ${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource} _a2x_asciidocsource )
if(CMAKE_GENERATOR MATCHES "Visual Studio")
# Workaround to prevent parallel msbuild builds from failing, see function
# get_docbook_xml_depends in FindXSLTPROC.cmake for details. This command
# updates the stamp file when the XML file is updated.
set(_stamp_file "${CMAKE_CURRENT_BINARY_DIR}/${_output_xml}-stamp")
set_property(SOURCE "${_stamp_file}" PROPERTY GENERATED)
set(_command_touch_stamp COMMAND "${CMAKE_COMMAND}" -E touch "${_stamp_file}")
else()
set(_command_touch_stamp "")
endif()
add_custom_command(
OUTPUT
${_output_xml}
# XXX - Output to a specific directory, e.g. wsdg_generated_src
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${RUNA2X}
--verbose
--attribute=build_dir=${_a2x_current_binary_dir}
--attribute=docinfo
--destination-dir=${_a2x_current_binary_dir}
--asciidoc-opts=${_conf_opts}
--no-xmllint
--format=docbook
--fop
${A2X_HTML_OPTS}
${_a2x_asciidocsource}
${_command_touch_stamp}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${_conf_deps}
${_src_deps}
${${_built_deps}}
)
add_custom_target(generate_${_output_xml} DEPENDS ${_output_xml})
set_target_properties(generate_${_output_xml} PROPERTIES FOLDER "Docbook")
unset(_src_deps)
unset(_conf_deps)
unset(_conf_opts_list)
ENDMACRO()
MACRO( ASCIIDOC2HTML _output _asciidocsource _conf_files )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
SET( A2X_HTML_OPTS --stylesheet=ws.css )
SET( _conf_opts_list )
FOREACH( _conf_file ${_conf_files} )
TO_A2X_COMPATIBLE_PATH ( ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} _a2x_conf_file )
SET( _conf_opts_list ${_conf_opts_list} --conf-file=${_a2x_conf_file})
ENDFOREACH()
STRING( REPLACE ";" " " _conf_opts "${_conf_opts_list}" )
SET( _conf_deps )
FOREACH( _conf_file ${_conf_files} )
SET( _conf_deps ${_conf_deps} ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} )
ENDFOREACH()
TO_A2X_COMPATIBLE_PATH ( ${_asciidocsource} _a2x_asciidocsource )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${RUNA2X}
--format=xhtml
--destination-dir=${_a2x_current_binary_dir}
--asciidoc-opts=${_conf_opts}
--fop
${A2X_HTML_OPTS}
${_a2x_asciidocsource}
# Replacing file with itself will fail
# COMMAND ${CMAKE_COMMAND} -E rename
# ${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.html
# ${CMAKE_CURRENT_BINARY_DIR}/${_output}
DEPENDS
${_asciidocsources}
${_conf_deps}
${_otherdependencies}
)
unset(_conf_deps)
unset(_conf_opts_list)
ENDMACRO()
MACRO( ASCIIDOC2TXT _output _asciidocsource _conf_files )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
if( LYNX_EXECUTABLE MATCHES lynx )
set( A2X_TEXT_OPTS --lynx )
else()
set( A2X_TEXT_OPTS )
endif()
SET( A2X_HTML_OPTS --stylesheet=ws.css )
SET( _conf_opts_list )
FOREACH( _conf_file ${_conf_files} )
TO_A2X_COMPATIBLE_PATH ( ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} _a2x_conf_file )
SET( _conf_opts_list ${_conf_opts_list} --conf-file=${_a2x_conf_file})
ENDFOREACH()
STRING( REPLACE ";" " " _conf_opts "${_conf_opts_list}" )
SET( _conf_deps )
FOREACH( _conf_file ${_conf_files} )
SET( _conf_deps ${_conf_deps} ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} )
ENDFOREACH()
TO_A2X_COMPATIBLE_PATH ( ${_asciidocsource} _a2x_asciidocsource )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${RUNA2X}
--format=text
--destination-dir=${_a2x_current_binary_dir}
--asciidoc-opts=${_conf_opts}
--fop
${A2X_TEXT_OPTS}
# XXX This generates a CMake working but correcting it looks
# messy.
--xsltproc-opts '--stringparam generate.toc "article nop" '
${_a2x_asciidocsource}
COMMAND ${CMAKE_COMMAND} -E rename
${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.text
${CMAKE_CURRENT_BINARY_DIR}/${_output}
DEPENDS
${_asciidocsource}
${_conf_deps}
)
unset(_conf_deps)
unset(_conf_opts_list)
ENDMACRO()
# news: release-notes.txt
# ${CMAKE_COMMAND} -E copy_if_different release-notes.txt ../NEWS
MACRO( ASCIIDOC2PDF _output _asciidocsource _conf_files _paper )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
SET( A2X_HTML_OPTS --stylesheet=ws.css )
SET( _conf_opts_list )
FOREACH( _conf_file ${_conf_files} )
TO_A2X_COMPATIBLE_PATH ( ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} _a2x_conf_file )
SET( _conf_opts_list ${_conf_opts_list} --conf-file=${_a2x_conf_file})
ENDFOREACH()
STRING( REPLACE ";" " " _conf_opts "${_conf_opts_list}")
SET( _conf_deps )
FOREACH( _conf_file ${_conf_files} )
SET( _conf_deps ${_conf_deps} ${CMAKE_CURRENT_SOURCE_DIR}/${_conf_file} )
ENDFOREACH()
TO_A2X_COMPATIBLE_PATH ( ${_asciidocsource} _a2x_asciidocsource )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${RUNA2X}
--format=pdf
--destination-dir=${_a2x_current_binary_dir}
--asciidoc-opts=${_conf_opts}
--fop
${A2X_HTML_OPTS}
--xsltproc-opts "--stringparam paper.type ${_paper} --nonet"
--xsl-file=custom_layer_pdf.xsl
${_a2x_asciidocsource}
COMMAND ${CMAKE_COMMAND} -E rename
${CMAKE_CURRENT_BINARY_DIR}/${_source_base_name}.pdf
${CMAKE_CURRENT_BINARY_DIR}/${_output}
DEPENDS
${_asciidocsources}
${_conf_deps}
${_otherdependencies}
)
unset(_conf_deps)
unset(_conf_opts_list)
ENDMACRO()

View File

@ -0,0 +1,146 @@
#
# - Find Asciidoctor
# Sets:
# ASCIIDOCTOR_EXECUTABLE
#
INCLUDE(FindChocolatey)
FIND_PROGRAM(ASCIIDOCTOR_EXECUTABLE
NAMES
asciidoctorj
asciidoctor
PATHS
/bin
/usr/bin
/usr/local/bin
${CHOCOLATEY_BIN_PATH}/bin
DOC "Path to Asciidoctor or AsciidoctorJ"
)
if(ASCIIDOCTOR_EXECUTABLE)
# The AsciidctorJ wrapper script sets -Xmx256m. This isn't enough
# for the User's Guide.
set(_asciidoctorj_opts "-Xmx800m $ENV{ASCIIDOCTORJ_OPTS}")
execute_process( COMMAND ${ASCIIDOCTOR_EXECUTABLE} --version OUTPUT_VARIABLE _ad_full_version )
separate_arguments(_ad_full_version)
list(GET _ad_full_version 1 ASCIIDOCTOR_VERSION)
function(set_asciidoctor_target_properties _target)
set_target_properties(${_target} PROPERTIES
FOLDER "Docbook"
EXCLUDE_FROM_DEFAULT_BUILD True
)
endfunction(set_asciidoctor_target_properties)
set (_asciidoctor_common_args
--attribute build_dir=${CMAKE_CURRENT_BINARY_DIR}
--require ${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-macros/commaize-block.rb
--require ${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-macros/cve_idlink-inline-macro.rb
--require ${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-macros/ws_buglink-inline-macro.rb
--require ${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-macros/ws_salink-inline-macro.rb
)
set(_asciidoctor_common_command ${CMAKE_COMMAND} -E
env TZ=UTC ASCIIDOCTORJ_OPTS="${_asciidoctorj_opts}"
${ASCIIDOCTOR_EXECUTABLE}
${_asciidoctor_common_args}
)
MACRO( ASCIIDOCTOR2DOCBOOK _asciidocsource )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
set( _output_xml ${_source_base_name}.xml )
add_custom_command(
OUTPUT
${_output_xml}
COMMAND ${_asciidoctor_common_command}
--backend docbook
--out-file ${_output_xml}
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
add_custom_target(generate_${_output_xml} DEPENDS ${_output_xml})
set_asciidoctor_target_properties(generate_${_output_xml})
unset(_output_xml)
ENDMACRO()
# Currently single page only.
MACRO( ASCIIDOCTOR2HTML _asciidocsource )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
set( _output_html ${_source_base_name}.html )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output_html}
COMMAND ${_asciidoctor_common_command}
--backend html
--out-file ${_output_html}
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
add_custom_target(generate_${_output_html} DEPENDS ${_output_html})
set_asciidoctor_target_properties(generate_${_output_html})
unset(_output_html)
ENDMACRO()
MACRO( ASCIIDOCTOR2TXT _asciidocsource )
if( LYNX_EXECUTABLE )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
set( _output_html ${_source_base_name}.html )
set( _output_txt ${_source_base_name}.txt )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output_txt}
COMMAND ${LYNX_EXECUTABLE}
-dump
${_output_html}
> ${_output_txt}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${_output_html}
${ARGN}
)
unset(_output_html)
unset(_output_txt)
endif( LYNX_EXECUTABLE )
ENDMACRO()
# news: release-notes.txt
# ${CMAKE_COMMAND} -E copy_if_different release-notes.txt ../NEWS
MACRO( ASCIIDOCTOR2PDF _asciidocsource )
GET_FILENAME_COMPONENT( _source_base_name ${_asciidocsource} NAME_WE )
set( _output_pdf ${_source_base_name}.pdf )
ADD_CUSTOM_COMMAND(
OUTPUT
${_output_pdf}
COMMAND ${_asciidoctor_common_command}
--backend pdf
${_asciidoctor_common_args}
--out-file ${_output_pdf}
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
add_custom_target(generate_${_output_pdf} DEPENDS ${_output_pdf})
set_asciidoctor_target_properties(generate_${_output_pdf})
unset(_output_pdf)
ENDMACRO()
endif(ASCIIDOCTOR_EXECUTABLE)
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( ASCIIDOCTOR
REQUIRED_VARS ASCIIDOCTOR_EXECUTABLE
VERSION_VAR ASCIIDOCTOR_VERSION
)
mark_as_advanced( ASCIIDOCTOR_EXECUTABLE )

View File

@ -1,37 +0,0 @@
#
# - Find unix commands from cygwin
# This module looks for some usual Unix commands.
#
INCLUDE(FindCygwin)
INCLUDE(FindWSWinLibs)
FindWSWinLibs("fop-2.1" "FOP21_HINTS")
FindWSWinLibs("fop-2.0" "FOP20_HINTS")
FindWSWinLibs("fop-1.1" "FOP11_HINTS")
FindWSWinLibs("fop-1.0" "FOP10_HINTS")
FIND_PROGRAM(FOP_EXECUTABLE
NAMES
fop
PATHS
${CYGWIN_INSTALL_PATH}/bin
/bin
/usr/bin
/usr/local/bin
/sbin
HINTS
${FOP21_HINTS}
${FOP20_HINTS}
${FOP11_HINTS}
${FOP10_HINTS}
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FOP DEFAULT_MSG FOP_EXECUTABLE)
IF(${FOP_EXECUTABLE})
SET(FOP_OPTS -Xmx256m)
SET(FOP_EXECUTABLE FOP_OPTS=${FOP_OPTS} JAVA_OPTS=${FOP_OPTS} ${FOP_EXECUTABLE})
ENDIF()
MARK_AS_ADVANCED(FOP_EXECUTABLE)

View File

@ -1,13 +1,15 @@
#
# - Find unix commands from cygwin
# This module looks for lynx (used by asciidoc)
# This module looks for an HTML to plain text converter which accepts
# a "-dump" argument.
#
# Lynx is preferred since it generates URL footnotes.
#
INCLUDE(FindCygwin)
FIND_PROGRAM(LYNX_EXECUTABLE
NAMES
lynx
lynx w3m links
PATHS
${CYGWIN_INSTALL_PATH}/bin
/bin

View File

@ -5,13 +5,6 @@
include(FindCygwin)
if(ENABLE_PDF_GUIDES)
find_package(FOP)
if(${FOP_EXECUTABLE} STREQUAL "FOP_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "fop wasn't found, but is necessary for building PDFs." )
endif()
endif()
find_program(XSLTPROC_EXECUTABLE
NAMES
xsltproc
@ -44,7 +37,6 @@ if (WIN32 AND NOT "${CYGWIN_INSTALL_PATH}" STREQUAL "" AND ${XSLTPROC_EXECUTABLE
NAMES cygpath
PATHS ${CYGWIN_INSTALL_PATH}/bin
)
# XXX Duplicate of TO_A2X_COMPATIBLE_PATH
MACRO( TO_XSLTPROC_COMPATIBLE_PATH _cmake_path _result )
execute_process(
COMMAND ${CYGPATH_EXECUTABLE} -u ${_cmake_path}
@ -103,13 +95,18 @@ MACRO(XML2HTML _target_dep _dir_pfx _mode _dbk_source _gfx_sources)
# We depend on the docbook target to avoid parallel builds.
SET(_dbk_dep ${_target_dep}_docbook)
# We can pass chunker.xxx parameters to customize the chunked output.
# We have to use a custom layer to customize the single-page output.
# Set the output encoding for both to UTF-8. Indent the single-page
# output because we sometimes need to copy and paste the release
# note contents.
IF(${_mode} STREQUAL "chunked")
SET(_basedir ${_dir_pfx}_html_chunked)
SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl")
SET(_modeparams --noout)
SET(_stylesheet "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl")
SET(_modeparams --stringparam chunker.output.encoding UTF-8)
ELSE() # single-page
SET(_basedir ${_dir_pfx}_html)
SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl")
SET(_stylesheet custom_layer_single_html.xsl)
SET(_modeparams --output ${_basedir}/index.html)
ENDIF()
@ -121,11 +118,6 @@ MACRO(XML2HTML _target_dep _dir_pfx _mode _dbk_source _gfx_sources)
set(_gfx_deps ${CMAKE_CURRENT_SOURCE_DIR}/${_tmpgfx})
ENDFOREACH()
# GET_FILENAME_COMPONENT(_GFXDIR ${_gfx} ABSOLUTE)
# GET_FILENAME_COMPONENT(_GFXDIR ${_GFXDIR} PATH)
# GET_FILENAME_COMPONENT(_OUTDIR ${_output} PATH)
# SET(_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/${_OUTDIR})
SET(_gfx_dir ${_dir_pfx}_graphics)
ADD_CUSTOM_COMMAND(
OUTPUT
@ -148,12 +140,13 @@ MACRO(XML2HTML _target_dep _dir_pfx _mode _dbk_source _gfx_sources)
${_common_xsltproc_args}
--stringparam admon.graphics.path ${_gfx_dir}/
${_modeparams}
${_STYLESHEET}
--noout ${_stylesheet}
${_dbk_source}
DEPENDS
${_dbk_xml_deps}
${_dbk_dep}
${_gfx_deps}
custom_layer_single_html.xsl
)
IF(NOT WIN32)
ADD_CUSTOM_COMMAND(
@ -166,41 +159,6 @@ MACRO(XML2HTML _target_dep _dir_pfx _mode _dbk_source _gfx_sources)
ENDIF()
ENDMACRO(XML2HTML)
# Translate XML to FO to PDF
#XML2PDF(
# user-guide-a4.fo or user-guide-us.fo
# WSUG_SOURCE
# custom_layer_pdf.xsl
# A4 or letter
#)
MACRO(XML2PDF _target_dep _output _dbk_source _stylesheet)
# We depend on the docbook target to avoid parallel builds.
SET(_dbk_dep ${_target_dep}_docbook)
file(RELATIVE_PATH _img_relative_path ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
get_docbook_xml_depends(_dbk_xml_deps "${_dbk_source}")
ADD_CUSTOM_COMMAND(
OUTPUT
${_output}
${_output}.fo
COMMAND ${XSLTPROC_EXECUTABLE}
--path "${_xsltproc_path}"
--stringparam img.src.path ${_img_relative_path}/
--stringparam use.id.as.filename 1
--stringparam admon.graphics.path ${_img_relative_path}/common_graphics/
--nonet
--output ${_output}.fo
${_stylesheet}
${_dbk_source}
COMMAND ${FOP_EXECUTABLE}
${_output}.fo
${_output}
DEPENDS
${_dbk_xml_deps}
${_dbk_dep}
${_stylesheet}
)
ENDMACRO(XML2PDF)
# Translate XML to HHP
#XML2HHP(
# wsug or wsdg

View File

@ -444,6 +444,15 @@ AC_ARG_ENABLE(guides,
# Check for programs used when building DocBook documentation.
#
have_wsug=yes
AC_PATH_PROGS(ASCIIDOCTOR, [asciidoctorj asciidoctor])
AC_CHECK_PROGS(HAVE_ASCIIDOCTOR, [asciidoctorj asciidoctor], "yes", "no")
AM_CONDITIONAL(HAVE_ASCIIDOCTOR, test x$HAVE_ASCIIDOCTOR = xyes)
AS_IF([test ! -x "$ASCIIDOCTOR"],
[
AS_IF([test "x$want_wsug" = xyes],
[AC_MSG_ERROR([Asciidoctor not found. This is required to build the release notes and guides])])
have_wsug=no
])
AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
AS_IF([test ! -x "$XSLTPROC"],
[
@ -451,33 +460,20 @@ AS_IF([test ! -x "$XSLTPROC"],
[AC_MSG_ERROR([xlstproc not found but required to build the Wireshark User's Guide])])
have_wsug=no
])
AC_PATH_PROG(A2X, a2x, a2x)
AS_IF([test ! -x "$A2X"],
[
AS_IF([test "x$want_wsug" = xyes],
[AC_MSG_ERROR([a2x not found but required to build the Wireshark User's Guide])])
have_wsug=no
])
AC_PATH_PROG(FOP, fop, fop)
AM_CONDITIONAL(BUILD_USER_GUIDE, [test "x$have_wsug" = xyes -a "x$want_wsug" != xno])
# HTML to text processor
# HTML to text processor. Executable must support "-dump".
AC_MSG_CHECKING([for an HTML to text processor])
AS_IF([w3m -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=w3m],
[lynx -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=lynx],
[have_a2x_text=no])
AC_MSG_RESULT([$have_a2x_text])
AM_CONDITIONAL(HAVE_A2X_TEXT, [test "x$have_a2x_text" != xno])
AS_IF([test $have_a2x_text = lynx], [A2X_LYNX="--lynx"])
AC_SUBST(A2X_LYNX)
AC_PATH_PROGS(LYNX, [lynx w3m links])
AC_CHECK_PROGS(HAVE_LYNX, [lynx w3m links], "yes", "no")
AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
# RPM
AC_CHECK_PROGS(RPMBUILD, [rpmbuild], [rpmbuild])
# Shellcheck
AC_CHECK_PROGS(SHELLCHECK, shellcheck, shellcheck)
AC_CHECK_PROG(SHELLCHECK, shellcheck)
#
# Check compiler vendor. For GCC this will be 'gnu' and for Clang 'clang'.

2
debian/control vendored
View File

@ -20,7 +20,7 @@ Build-Depends: libgtk-3-dev, lsb-release,
libgnutls-dev,
libgcrypt-dev, portaudio19-dev, libkrb5-dev, liblua5.2-dev, libsmi2-dev,
libgeoip-dev, dpkg-dev (>= 1.16.1~),
libnl-genl-3-dev [linux-any], libnl-route-3-dev [linux-any], asciidoc,
libnl-genl-3-dev [linux-any], libnl-route-3-dev [linux-any], asciidoctor,
cmake (>= 2.8.8), w3m, libsbc-dev, libnghttp2-dev, libssh-gcrypt-dev,
liblz4-dev, libsnappy-dev, libspandsp-dev, libxml2-dev
Build-Conflicts: libsnmp4.2-dev, libsnmp-dev

3
debian/rules vendored
View File

@ -27,13 +27,14 @@ export docdir = /usr/share/doc/wireshark-doc
dh $@ --with python2 --buildsystem cmake --with quilt --parallel
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_xxx2deb=ON -DENABLE_HTML_GUIDES=ON -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
dh_auto_configure -- -DBUILD_xxx2deb=ON -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DBUILD_wireshark_gtk=ON \
# -DENABLE_QT5=OFF
override_dh_auto_build:
$(MAKE) -C $(CURDIR)/obj-* asn1
dh_auto_build
$(MAKE) -C $(CURDIR)/obj-* user_guide_html developer_guide_html
# fix links in documentation
sed -i "s|$(CURDIR)/docbook|..|" obj-*/docbook/ws*g_html_chunked/*.html

View File

@ -7,29 +7,30 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
find_package( LYNX )
if(ENABLE_HTML_GUIDES OR ENABLE_PDF_GUIDES OR ENABLE_CHM_GUIDES)
find_package( ASCIIDOC REQUIRED )
find_package( XSLTPROC REQUIRED )
else()
# This is an optional add of the packages
find_package( ASCIIDOC )
find_package( XSLTPROC )
endif()
# To do:
# - Rename *.asciidoc to *.adoc
# - Make the build targets top-level on Windows, similar to the NSIS,
# WiX, and PortableApps targets?
if(ENABLE_CHM_GUIDES)
find_package( HTMLHelp REQUIRED )
find_package( LYNX )
find_package( Asciidoctor 1.5 )
find_package( XSLTPROC )
function(set_docbook_target_properties _target)
set_target_properties(${_target} PROPERTIES
FOLDER "Docbook"
EXCLUDE_FROM_DEFAULT_BUILD True
)
endfunction(set_docbook_target_properties)
if(WIN32)
find_package( HTMLHelp )
if(HTML_HELP_COMPILER)
# We do not need the HTML Help headers and library, just the
# compiler. To avoid confusion, report the package as found.
# https://gitlab.kitware.com/cmake/cmake/issues/15886
set(HTMLHelp_FOUND 1)
else()
message(FATAL_ERROR "HTML Help Compiler is not installed (required for ENABLE_CHM_GUIDES)")
endif()
endif()
if(WIN32)
macro( HHP2CHM _hhpsource )
get_filename_component( _source_base_name ${_hhpsource} NAME_WE )
@ -117,6 +118,7 @@ add_custom_command(
add_custom_target(update_tools_help
DEPENDS ${WSUG_TOOLS_PHONY_DEPS}
)
set_docbook_target_properties(update_tools_help)
set(WSUG_FILES
wsug_src/WSUG_app_files.asciidoc
@ -371,36 +373,35 @@ ADD_CUSTOM_COMMAND(
set( WSDG_BUILT_DEPS ws.css wsluarm )
set( ASCIIDOC_CONF_FILES
asciidoc.conf
asciidoctor-asciidoc.conf
attributes.asciidoc
# XXX Add macros
)
if(ENABLE_HTML_GUIDES OR ENABLE_PDF_GUIDES OR ENABLE_CHM_GUIDES)
if(ASCIIDOCTOR_EXECUTABLE)
# Generate the DocBook sources of user and developer guides
ASCIIDOC2DOCBOOK(user-guide.asciidoc ASCIIDOC_CONF_FILES WSUG_SOURCE WSUG_BUILT_DEPS)
ASCIIDOCTOR2DOCBOOK(user-guide.asciidoc ${ASCIIDOC_CONF_FILES} ${WSUG_SOURCE} ${WSUG_BUILT_DEPS})
add_custom_target(user_guide_docbook DEPENDS generate_user-guide.xml)
set_target_properties(user_guide_docbook PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(user_guide_docbook)
ASCIIDOC2DOCBOOK(developer-guide.asciidoc ASCIIDOC_CONF_FILES WSDG_SOURCE WSDG_BUILT_DEPS)
ASCIIDOCTOR2DOCBOOK(developer-guide.asciidoc ${ASCIIDOC_CONF_FILES} ${WSDG_SOURCE} ${WSDG_BUILT_DEPS})
add_custom_target(developer_guide_docbook DEPENDS generate_developer-guide.xml)
set_target_properties(developer_guide_docbook PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(developer_guide_docbook)
# Top-level guide targets.
add_custom_target(user_guides DEPENDS user_guide_docbook)
set_target_properties(user_guides PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(user_guides)
add_custom_target(developer_guides DEPENDS developer_guide_docbook)
set_target_properties(developer_guides PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(developer_guides)
add_custom_target(all_guides ALL DEPENDS user_guides developer_guides )
set_target_properties(all_guides PROPERTIES FOLDER "Docbook")
add_custom_target(all_guides DEPENDS user_guides developer_guides )
set_docbook_target_properties(all_guides)
endif()
# User's Guide chain.
if(ENABLE_HTML_GUIDES)
if(ASCIIDOCTOR_EXECUTABLE AND XSLTPROC_EXECUTABLE)
XML2HTML(
user_guide
wsug
@ -422,31 +423,23 @@ if(ENABLE_HTML_GUIDES)
wsug_html/index.html
wsug_html_chunked/index.html
)
set_target_properties(user_guide_html PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(user_guide_html)
add_dependencies(user_guides user_guide_html)
endif()
if(ENABLE_PDF_GUIDES)
# To do:
# - Generate PDFs using AsciiDoctor.
XML2PDF(
user_guide
user-guide.pdf
user-guide.xml
custom_layer_pdf.xsl
)
if(ASCIIDOCTOR_EXECUTABLE)
ASCIIDOCTOR2PDF(user-guide.asciidoc ${WSUG_SOURCE} ${WSUG_BUILT_DEPS})
add_custom_target(
user_guide_pdf
DEPENDS
user-guide.pdf
)
set_target_properties(user_guide_pdf PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(user_guide_pdf)
add_dependencies(user_guides user_guide_pdf)
endif()
if(ENABLE_CHM_GUIDES)
if(WIN32 AND ASCIIDOCTOR_EXECUTABLE)
XML2HHP(user_guide wsug user-guide.xml)
HHP2CHM(user-guide.hhp)
add_custom_target(
@ -454,12 +447,12 @@ if(ENABLE_CHM_GUIDES)
DEPENDS
user-guide.chm
)
set_target_properties(user_guide_chm PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(user_guide_chm)
add_dependencies(user_guides user_guide_chm)
endif()
# Developer's Guide chain.
if(ENABLE_HTML_GUIDES)
if(ASCIIDOCTOR_EXECUTABLE AND XSLTPROC_EXECUTABLE)
XML2HTML(
developer_guide
wsdg
@ -481,28 +474,23 @@ if(ENABLE_HTML_GUIDES)
wsdg_html/index.html
wsdg_html_chunked/index.html
)
set_target_properties(developer_guide_html PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(developer_guide_html)
add_dependencies(developer_guides developer_guide_html)
endif()
if(ENABLE_PDF_GUIDES)
XML2PDF(
developer_guide
developer-guide.pdf
developer-guide.xml
custom_layer_pdf.xsl
)
if(ASCIIDOCTOR_EXECUTABLE)
ASCIIDOCTOR2PDF(developer-guide.asciidoc ${WSDG_SOURCE} ${WSDG_BUILT_DEPS})
add_custom_target(
developer_guide_pdf
DEPENDS
developer-guide.pdf
)
set_target_properties(developer_guide_pdf PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(developer_guide_pdf)
add_dependencies(developer_guides developer_guide_pdf)
endif()
if(ENABLE_CHM_GUIDES)
if(WIN32 AND ASCIIDOCTOR_EXECUTABLE)
XML2HHP(developer_guide wsdg developer-guide.xml)
HHP2CHM(developer-guide.hhp)
add_custom_target(
@ -510,22 +498,23 @@ if(ENABLE_CHM_GUIDES)
DEPENDS
developer-guide.chm
)
set_target_properties(developer_guide_chm PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(developer_guide_chm)
add_dependencies(developer_guides developer_guide_chm)
endif()
# release_notes: release-notes.html release-notes.txt
add_custom_target( release_notes_html DEPENDS ws.css release-notes.html )
set_target_properties(release_notes_html PROPERTIES FOLDER "Docbook")
add_custom_target( release_notes_html DEPENDS release-notes.html )
set_docbook_target_properties(release_notes_html)
add_custom_target( release_notes_txt DEPENDS release-notes.txt )
set_target_properties(release_notes_txt PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(release_notes_txt)
# Force serial execution so that separate a2x instances don't trip on each other
add_dependencies ( release_notes_txt release_notes_html )
# Force serial execution so that separate asciidoctor instances don't
# trip on each other
# add_dependencies ( release_notes_txt release_notes_html )
add_custom_target( release_notes )
set_target_properties(release_notes PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(release_notes)
add_dependencies ( release_notes release_notes_txt release_notes_html )
add_custom_target(
@ -536,20 +525,11 @@ add_custom_target(
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/release-notes.txt
)
set_target_properties(news PROPERTIES FOLDER "Docbook")
set_docbook_target_properties(news)
if( ASCIIDOC_FOUND )
ASCIIDOC2HTML(
release-notes.html
release-notes.asciidoc
"${ASCIIDOC_CONF_FILES}"
)
ASCIIDOC2TXT(
release-notes.txt
release-notes.asciidoc
"${ASCIIDOC_CONF_FILES}"
)
if( ASCIIDOCTOR_FOUND )
ASCIIDOCTOR2HTML( release-notes.asciidoc )
ASCIIDOCTOR2TXT( release-notes.asciidoc )
endif()
#

View File

@ -1,19 +1,9 @@
#
# Make the "Wireshark User Guide" and "Wireshark Developer Guide"
# in several formats.
# See the Readme.txt file for instructions.
# See the README.adoc file for instructions.
#
# formatting objects processor
# Additional options to fop.
# This needs to contain at least the argument '-Xmx256m'
# fop executable is found in configure.ac.
FOP_OPTS=-Xmx256m
# Asciidoc converter
A2X_HTML_OPTS="--stylesheet=ws.css"
A2X_TEXT_OPTS=
############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
WSUG_FILES = \
@ -239,7 +229,7 @@ WSUG_DIST = \
user-guide.asciidoc \
attributes.asciidoc \
custom_layer_chm.xsl \
custom_layer_pdf.xsl \
custom_layer_single_html.xsl \
$(WSUG_FILES) \
$(WSUG_TOOLS_HELP_FILES) \
$(WSUG_GRAPHICS) \
@ -253,7 +243,7 @@ WSDG_DIST = \
developer-guide.asciidoc \
attributes.asciidoc \
custom_layer_chm.xsl \
custom_layer_pdf.xsl \
custom_layer_single_html.xsl \
$(WSDG_FILES) \
$(WSDG_GRAPHICS) \
$(COMMON_FILES) \
@ -262,10 +252,7 @@ WSDG_DIST = \
WSDG_SOURCE = $(WSDG_GENERATED_SOURCE) $(WSDG_DIST)
RELEASE_NOTES_SOURCE = \
release-notes.asciidoc \
attributes.asciidoc \
asciidoc.conf \
asciidoctor-asciidoc.conf
release-notes.asciidoc
CLEANFILES = \
*.chm \
@ -335,61 +322,62 @@ COMMON_XSLTPROC_ARGS = \
WSUG_XSLTPROC_ARGS = \
--stringparam admon.graphics.path wsug_graphics/
WSUG_PDF_XSLTPROC_ARGS = \
--stringparam img.src.path $(srcdir)/ \
--stringparam admon.graphics.path $(srcdir)/common_graphics/
WSDG_XSLTPROC_ARGS = \
--stringparam admon.graphics.path wsdg_graphics/
WSDG_PDF_XSLTPROC_ARGS = \
--stringparam img.src.path $(srcdir)/ \
--stringparam admon.graphics.path $(srcdir)/common_graphics/
SINGLE_XSLTPROC_ARGS = \
--nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
--nonet custom_layer_single_html.xsl
CHUNKED_XSLTPROC_ARGS = \
--stringparam chunker.output.encoding UTF-8 \
--nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
HTMLHELP_XSLTPROC_ARGS = \
--nonet custom_layer_chm.xsl
# --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl
# Automatically generate .pdf files from .fo files
# Suse needs FOP_OPTS, Debian needs JAVA_OPTS
.fo.pdf:
FOP_OPTS=$(FOP_OPTS) JAVA_OPTS=$(FOP_OPTS) $(FOP) $< $@
ASCIIDOCTOR_COMMON_ARGS = \
--require $(srcdir)/asciidoctor-macros/commaize-block.rb \
--require $(srcdir)/asciidoctor-macros/cve_idlink-inline-macro.rb \
--require $(srcdir)/asciidoctor-macros/ws_buglink-inline-macro.rb \
--require $(srcdir)/asciidoctor-macros/ws_salink-inline-macro.rb
ASCIIDOCTOR_COMMON_COMMAND = TZ=UTC ASCIIDOCTORJ_OPTS="-Xmx800m ${ASCIIDOCTORJ_OPTS}" \
$(ASCIIDOCTOR) \
$(ASCIIDOCTOR_COMMON_ARGS)
.asciidoc.pdf:
$(ASCIIDOCTOR_COMMON_COMMAND) --backend pdf --out-file $@ $<
.asciidoc.xml:
$(ASCIIDOCTOR_COMMON_COMMAND) --backend docbook --out-file $@ $<
docbook_all_local_targets =
if BUILD_USER_GUIDE
docbook_all_local_targets += wsug_html_chunked
endif
all-local: $(docbook_all_local_targets)
all-html: wsug wsdg release-notes
all-html: wsug wsdg release_notes
all-pdf: wsug-pdf wsdg-pdf
all-pdf: wsug_pdf wsdg_pdf
# Wireshark User Guide
wsug: wsug_html_chunked wsug_html
wsug-pdf: wsug user-guide.pdf
wsug_pdf: wsug user-guide.pdf
user-guide.xml: user-guide.asciidoc $(WSUG_FILES) $(WSUG_TOOLS_HELP_FILES)
$(A2X) --verbose \
--attribute=docinfo \
--asciidoc-opts="--conf-file=$(srcdir)/asciidoc.conf --conf-file=$(srcdir)/asciidoctor-asciidoc.conf" \
--no-xmllint \
--format=docbook \
--destination-dir=$(builddir) \
$<
user-guide.xml: user-guide.asciidoc $(WSUG_FILES)
user-guide.pdf: user-guide.asciidoc $(WSUG_FILES)
endif
# create html single page file
if BUILD_USER_GUIDE
wsug_html: wsug_html/index.html
endif
wsug_html/index.html: $(WSUG_SOURCE)
wsug_html/index.html: user-guide.xml
@ echo --- WSUG - HTML SINGLE PAGE ---
mkdir -p wsug_html/wsug_graphics/toolbar
cp $(srcdir)/wsug_graphics/*.* wsug_html/wsug_graphics
@ -401,9 +389,11 @@ wsug_html/index.html: $(WSUG_SOURCE)
-chmod -R og+rX wsug_html
# create html chunked page files
if BUILD_USER_GUIDE
wsug_html_chunked: wsug_html_chunked/index.html
endif
wsug_html_chunked/index.html: $(WSUG_SOURCE)
wsug_html_chunked/index.html: user-guide.xml
@ echo --- WSUG - HTML CHUNKED ---
mkdir -p wsug_html_chunked/wsug_graphics/toolbar
cp $(srcdir)/wsug_graphics/*.* wsug_html_chunked/wsug_graphics
@ -414,14 +404,6 @@ wsug_html_chunked/index.html: $(WSUG_SOURCE)
$(WSUG_XSLTPROC_ARGS) $(CHUNKED_XSLTPROC_ARGS) $<
-chmod -R og+rX wsug_html_chunked
# create pdf file (through XSL-FO), portrait pages on PA4 (210 x 280 mm) "paper"
# you will get lots of errors, but that's ok
user-guide.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
@ echo --- WSUG - PDF PA4 PAPER ---
$(XSLTPROC) \
$(COMMON_XSLTPROC_ARGS) $(WSUG_PDF_XSLTPROC_ARGS) \
--nonet $(srcdir)/custom_layer_pdf.xsl $< > $@
wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
mkdir -p wsluarm_src
$(PERL) $(srcdir)/make-wsluarm.pl $(WSLUA_MODULES)
@ -431,22 +413,20 @@ wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
# Wireshark Developer Guide
wsdg: wsdg_html_chunked wsdg_html
wsdg-pdf: wsdg developer-guide.pdf
if BUILD_USER_GUIDE
wsdg_pdf: developer-guide.pdf
endif
developer-guide.xml: developer-guide.asciidoc $(WSDG_FILES) wsluarm
$(A2X) --verbose \
--attribute=docinfo \
--attribute=build_dir=$(abs_builddir) \
--asciidoc-opts="--conf-file=$(srcdir)/asciidoc.conf --conf-file=$(srcdir)/asciidoctor-asciidoc.conf" \
--no-xmllint \
--format=docbook \
--destination-dir=$(builddir) \
$<
developer-guide.pdf: developer-guide.asciidoc $(WSDG_FILES) wsluarm
# create html single page file
if BUILD_USER_GUIDE
wsdg_html: wsdg_html/index.html
endif
wsdg_html/index.html: $(WSDG_SOURCE)
wsdg_html/index.html: developer-guide.xml
@ echo --- WSDG - HTML SINGLE PAGE ---
mkdir -p wsdg_html/wsdg_graphics/toolbar
cp $(srcdir)/wsdg_graphics/*.* wsdg_html/wsdg_graphics
@ -459,9 +439,11 @@ wsdg_html/index.html: $(WSDG_SOURCE)
-chmod -R og+rX wsdg_html
# create html chunked page files
wsdg_html_chunked: wsdg_html_chunked/index.html
if BUILD_USER_GUIDE
wsdg_html_chunked: developer-guide.xml wsdg_html_chunked/index.html
endif
wsdg_html_chunked/index.html: $(WSDG_SOURCE)
wsdg_html_chunked/index.html: developer-guide.xml
@ echo --- WSDG - HTML CHUNKED ---
mkdir -p wsdg_html_chunked/wsdg_graphics/toolbar
cp $(srcdir)/wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics
@ -473,37 +455,30 @@ wsdg_html_chunked/index.html: $(WSDG_SOURCE)
$(WSDG_XSLTPROC_ARGS) $(CHUNKED_XSLTPROC_ARGS) $<
-chmod -R og+rX wsdg_html_chunked
# create pdf file (through XSL-FO), portrait pages on PA4 (210 x 280 mm) "paper"
# you will get lot's of errors, but that's ok
developer-guide.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
@ echo --- WSDG - PDF PA4 PAPER ---
$(XSLTPROC) \
$(COMMON_XSLTPROC_ARGS) $(WSDG_PDF_XSLTPROC_ARGS) \
--path .:wsluarm_src:$(srcdir) \
--nonet $(srcdir)/custom_layer_pdf.xsl $< > $@
# Release notes
if HAVE_A2X_TEXT
release-notes: release-notes.html release-notes.txt
else
release-notes: release-notes.html
if HAVE_ASCIIDOCTOR
release_note_deps = release-notes.html
if HAVE_LYNX
release_note_deps += release-notes.txt
endif
endif
release_notes: $(release_note_deps)
# create html single page file
release-notes.html: $(RELEASE_NOTES_SOURCE)
@ echo --- RELEASE NOTES - HTML ---
$(A2X) --format=xhtml $(A2X_HTML_OPTS) \
--destination-dir=$(builddir) \
$(ASCIIDOCTOR_COMMON_COMMAND) \
--backend html \
--out-file $(builddir)/release-notes.html \
$(srcdir)/release-notes.asciidoc