Commit Graph

27 Commits

Author SHA1 Message Date
Gerald Combs b62197c283 CMake+GitLab CI: Reduce verbosity.
For various commands, make sure we show warnings and errors, but not
other extraneous information such as filenames.
2021-12-11 13:57:29 -08:00
João Valverde a3fe5c6162 MSYS2/CMake: Fix asciidoctor invocation
CMake does not use any shell to run execute_process(). When
running asciidoctor we must use the batch file. Put that before
"asciidoctor" (a ruby script) so CMake uses that instead.
2021-11-07 22:07:14 +00:00
Gerald Combs 2c3b13834d CMake: Place all of the documentation in the "Documentation" folder. 2021-10-21 00:21:17 +00:00
Gerald Combs 44bd3a7d79 CMake+Docs: Update our man page targets.
Remove the generate_*_pages targets that were recently introduced,
since they're not really needed. Only add the "manpages" target
if we have Asciidoctor.
2021-10-20 19:29:08 +00:00
Gerald Combs b8a45f3638 CMake+Docs: Generate man pages all at once.
Asciidoctor lets us generate multiple documents at once, so do so for
our man pages. If we're using AsciidoctorJ this minimizes the number
of JVM instances we have to spin up. This reduces the build time on my
Windows VM here quite a bit, and will hopefully do so on the CI builders.

Add a .editorconfig file in cmake/modules.
2021-10-19 22:06:45 +00:00
Gerald Combs 74747c4d2f CMake: Try to make our man page builds faster.
Depend on our generator targets instead of the generated files, which
allows parallel builds outside of Ninja. Don't reserve JRE memory when
building HTML and man page targets. This reduces the "docs" target build
time on my Windows VM here from over two minutes to under one.
2021-10-13 23:10:35 +00:00
Gerald Combs 84ab55cf75 Docs+Packaging: Convert our man pages to Asciidoctor.
Convert doc/*.pod to Asciidoctor. This:

* Means we use the same markup for our man pages, the guides, and
  release notes.
* Lets us add versions to our man pages.
* Gives us more formatting options, e.g. AsciiDoc supports `commands`,
  nested lists and makes it easy to include version information. The
  manpage backend doesn't seem to support tables very well,
  unfortunately.

Convert our CMake configuration to produce *roff and html man pages
using Asciidoctor. Add a "manarg" block macro which makes our synopses
wrap correctly.

Similar to the release notes, guides, and FAQ, if Asciidoctor isn't
found the man pages won't be generated or installed.

Move Asciidoctor to the list of package build dependencies in various
places.

This commit includes the conversion script (pod2adoc.py), which will be
removed later.

Line count sanity check:

Man page         .pod .adoc
androiddump       260  280
asn2deb            93  105
capinfos          401  471
captype            54   55
ciscodump         241  269
dftest             42   42
dpauxmon          153  169
dumpcap           464  534
editcap           528  583
etwdump           136  156
extcap            157  181
idl2deb            91  103
idl2wrs           120  100
mergecap          206  207
mmdbresolve        75   75
randpkt           107  111
randpktdump       158  184
rawshark          558  610
reordercap         76   78
sdjournal         145  157
sshdump           272  302
text2pcap         274  312
tshark           2135 2360
udpdump           133  151
wireshark-filter  486  479
wireshark        2967 3420
2021-10-01 16:42:34 +00:00
Gerald Combs 0b567bb27e Docs: Asciidoctor.js isn't yet suitable for our needs.
Reverse the text added in cdd6f2ec80 and note that we can't yet use
Asciidoctor.js to build our documentation. I'm not sure how I managed to
miss this in my initial tests, but Asciidoctor.js is missing Docbook,
PDF, and EPUB backends, and doesn't support Ruby macros.
2021-09-23 06:40:08 +00:00
Chuck Craft eaa2cf0c21 Cmake: misplaced quote in epub asciidoctor_opts
Follow up to !3988
2021-08-29 11:21:54 +00:00
Gerald Combs 8c4543373a CMake: Use "'" instead of "’" in our guide filenames.
Use an apostrophe instead of RIGHT SINGLE QUOTATION MARK in our PDF and
EPUB filenames. Some programs (notably Okular) can't open filenames with
extended characters, at least on Windows.
2021-08-27 01:18:13 +00:00
Gerald Combs a6e0482a6f Docs: Give the PDF and EPUB guides descriptive filenames.
Use the document title for our PDF and EPUB filenames under the theory
that "Wireshark User’s Guide.pdf" is more obvious than "user-guide.pdf".
2021-08-03 22:18:06 +00:00
Gerald Combs b58edf3cb8 Docs: Add epub targets for the guides.
Add user_guide_epub and developer_guide_epub targets that generate
EPUB versions of the User's Guide and Developer's Guide.
Ping #17494.
2021-07-30 21:05:37 +00:00
Gerald Combs cdd6f2ec80 CMake+docs: Use Asciidoctor.js if it's available.
Add the executables shipped by the Asciidoctor.js project to
FindAsciidoctor.cmake, and update the Developer's Guide to match.
2021-06-23 05:28:55 +00:00
Gerald Combs b7ea495e2e CMake: Increase our AsciidoctrJ JVM memory limits.
One of the builds recently failed with:

         Generating user-guide.pdf
         Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

Change-Id: I542a39880dffcd3d7bbaec1a180c605b3011c2e2
Reviewed-on: https://code.wireshark.org/review/36966
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-29 03:34:56 +00:00
Gerald Combs fcd51deb99 Docbook: Fix an unterminated tag, other updates.
Remove nested example tags from the dissection chapter, including and
unbalanced one. Mark our source blocks with [source,c].

Enable syntax highlighting in the Developer's and User's guides. This
isn't supported in the DocBook backend (which we use to generate the
HTML guides), but it is in the PDF backend.

Add a comment about failing on warnings when we generate our guides.

Change-Id: Ieee29fe75364ca23769aa997f90126e31b72cc8b
Reviewed-on: https://code.wireshark.org/review/36767
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-04-09 22:07:57 +00:00
Pascal Quantin f48a62f4ef CMake: fix some warnings reported by CMake 3.17
Newer version of CMake complains with warnings like the one below:

The package name passed to `find_package_handle_standard_args` (MINIZIP)
does not match the name of the calling package (Minizip).  This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

Change the capitalization of the variables to match the filename.

Change-Id: Ic3c88f33f5a2bfeba3fa3479df60210e67d25ff0
Reviewed-on: https://code.wireshark.org/review/36695
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05 07:56:57 +00:00
Gerald Combs 6094e9d392 CMake: Create a DocBook stamp file for Visual Studio.
Create user-guide.xml-stamp and developer-guide.xml-stamp when building
under Visual Studio. Fixes

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): warning MSB8064: Custom build for item "C:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\CMakeFiles\8721ce5c0a51a8e0d8e35fd55fbe2e6e\user-guide.hhp.rule" succeeded, but specified dependency "c:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\docbook\user-guide.xml-stamp" does not exist. This may cause incremental build to work incorrectly. [C:\buildbot\builders\wireshark-master-32\windows-2019-x86\build\cmbuild\docbook\user_guide_chm.vcxproj]

when building the user_guide_chm target.

Change-Id: Ia224823841b4d3def3436f9f3a48b759694ffb37
Reviewed-on: https://code.wireshark.org/review/35509
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-20 07:26:35 +00:00
Dario Lombardo e4e0488da9 docbook: reduce ruby code duplication by introducing utils module.
Change-Id: I7e436db3cb86f5ebd0f5827c6da630303bc3f538
Reviewed-on: https://code.wireshark.org/review/28400
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-27 17:01:18 +00:00
Gerald Combs 0dcd8cd1a2 Asciidoctor: Remove underscores from macro names.
AsciiDoc allows dashes in macro names but not underscores. Current
versions of AsciiDoctor allow the inverse. Remove underscores to allow
for easier copying and pasting.

Remove asciidoc.conf while we're here. It's no longer used.

Change-Id: I32d8a4ec695b9e17a80ac720ee9faf62dbb362d3
Reviewed-on: https://code.wireshark.org/review/27787
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-24 20:00:56 +00:00
Gerald Combs a8b6c6fbcc Don't look for Asciidoctor PDF unless we find Asciidoctor.
Fix a doc string while we're here.

Change-Id: Ic67e40dc7e8d624a00b97fe40fe162e6f8633cfc
Reviewed-on: https://code.wireshark.org/review/27728
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-23 13:24:12 +00:00
Gerald Combs eed4961387 CMake: Search for asciidoctor-pdf separate from asciidoctor.
Search for asciidoctorj and asciidoctor-pdf and set
ASCIIDOCTOR_PDF_EXECUTABLE if either are found. Only enable the PDF
targets if we find ASCIIDOCTOR_PDF_EXECUTABLE.

Remove env.cmake since it's no longer needed.

Change-Id: Iee82b30eaa67d1ad3fd3a296d9997b0643a0cb4e
Reviewed-on: https://code.wireshark.org/review/27696
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-22 07:34:57 +00:00
AndersBroman 2bc030268c FindAsciidoctor: On SLES 12.2 the executable name is asciidoctor.ruby2.1
Change-Id: I609aae2335ee8171c1d54eb05cf4c184f2dc1eb0
Reviewed-on: https://code.wireshark.org/review/26775
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-07 05:34:32 +00:00
Peter Wu fdef405782 cmake: fix "cmake -E env" compatibility with older CMake
"cmake -E env" was added in CMake 3.1, but we currently support 2.8.12
at minimum. Add a best-effort replacement for older versions. There are
some limitations from CMake (see comments), but these should not affect
the current user (FindAsciidoctor.cmake).

Change-Id: I56c92aa9ad42fb3950dbdfd955d4ff902111e0d7
Fixes: v2.5.1rc0-76-g94a0f7c641 ("Switch from AsciiDoc to Asciidoctor.")
Reviewed-on: https://code.wireshark.org/review/26658
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-27 21:11:37 +00:00
Gerald Combs f52bb2bf27 CMake: Fixup our Chocolatey bin path discovery.
Search for choco.exe directly instead of using PATHS + PATH_SUFFIXES.
Look in %ChocolateyInstall%\bin first. CHOCOLATEY_BIN_PATH is the binary
path. There's no need to append /bin to it.

Change-Id: I732db398bd989bf12222a5cee2c79c0bd4161638
Reviewed-on: https://code.wireshark.org/review/26276
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 19:00:56 +00:00
Gerald Combs 8ebbf99173 Remove Lynx.
Use tools/html2text.py to convert HTML to text.

Remove some now-obsolete documentation.

Change-Id: Ib21a1ab10c789182da5fcc68e98917a00f2fa650
Reviewed-on: https://code.wireshark.org/review/25733
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-12 19:19:11 +00:00
Gerald Combs 86376e8447 Fix ASCIIDOCTORJ_OPTS.
Avoid excessive quoting.

Change-Id: I0dd7593d464851bd34cfc7a5a99a21a2a826dd7a
Reviewed-on: https://code.wireshark.org/review/25732
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-11 19:06:39 +00:00
Gerald Combs 94a0f7c641 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>
2018-02-11 18:22:09 +00:00