diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2009-06-21 12:47:48 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2009-06-21 12:47:48 +0000 |
commit | c47eeae22b4edcebb6b58a5ef1a67b139473d203 (patch) | |
tree | 779fd228d4c61751c9f15f4c07cbe25078beff98 /doc | |
parent | 05a3dca2bc492be7443afc52fbff2bb9c182e705 (diff) | |
download | wireshark-c47eeae22b4edcebb6b58a5ef1a67b139473d203.tar.gz |
Move the generated documentation (man pages, AUTHORS-SHORT-FORMAT, and
AUTHORS-SHORT) into doc/. This cleans up the top-level Makefile.am (no more
need to have rules for each man page in both files) and solves the
parallel-build problem described in:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3494
svn path=/trunk/; revision=28784
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.am | 220 | ||||
-rw-r--r-- | doc/Makefile.nmake | 21 | ||||
-rwxr-xr-x | doc/make-authors-format.pl | 89 | ||||
-rwxr-xr-x | doc/make-authors-short.pl | 31 | ||||
-rwxr-xr-x | doc/perlnoutf.pl | 16 |
5 files changed, 296 insertions, 81 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 3a518d3e1a..47cac7eb01 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -24,173 +24,240 @@ # We include dependencies on ../config.h in order to # capture when $(VERSION) changes. -wireshark-tmp.pod: $(srcdir)/wireshark.pod $(top_builddir)/AUTHORS-SHORT-FORMAT - cat $(srcdir)/wireshark.pod $(top_builddir)/AUTHORS-SHORT-FORMAT > wireshark-tmp.pod +# +# This is a hideous hack. +# +# Automake needs to know into which sections to install various man +# pages; if the names in "man_MANS" have suffixes, it can infer the +# sections from the name (e.g., "hello.1" goes in section 1), but if +# they don't have suffixes, it can't tell what sections to put them, and +# it just gives up and doesn't create any rules to install them (and it +# gives up silently, so you have no clue what's wrong). +# +# Therefore, we can't just set "man_MANS" to a list of variables to be +# filled in by the configure script, as those variables don't have man +# page section numbers. +# +# It turns out (although this is not documented anywhere I could find +# in the automake Info file) that if you define, instead, variables with +# names like "man{section}_MANS", automake will infer that the names in +# those variables are the names of man pages to be installed in section +# "{section}". +# +# So, as all our man pages go in section 1, we define "man1_MANS" to +# contain all the man page. +# +# *However*, if "man_MANS" isn't defined at all, automake concludes that +# there are no man pages, the fact that, say, "man1_MANS" is defined +# nonwithstanding! (I suspect this is the result of a mistaken attempt +# to get people to fix their automake files not to use "MANS"; if "MANS" +# is defined, it prints a warning and sets the exit status, but doesn't +# exit, and then it just gives up if "man_MANS" isn't defined, +# presumably on the theory that the only reason it wouldn't be defined +# is because the automake file uses the obsolete "MANS" variable instead +# of the shiny new "man_MANS" variable.) +# +# So we also define "man_MANS", but don't define it as anything; +# automake will arrange that the Makefile define it as the union of all +# the "man{section}_MANS" variables. +# +man1_MANS = \ + @wireshark_man@ \ + @tshark_man@ \ + @text2pcap_man@ \ + @mergecap_man@ \ + @capinfos_man@ \ + @editcap_man@ \ + @dumpcap_man@ \ + @idl2wrs_man@ \ + @rawshark_man@ +man4_MANS = @wiresharkfilter_man@ +man_MANS = + +pkgdata_DATA = AUTHORS-SHORT $(top_srcdir)/docbook/ws.css wireshark.html \ + tshark.html wireshark-filter.html capinfos.html editcap.html \ + idl2wrs.html mergecap.html text2pcap.html dumpcap.html rawshark.html + +# +# Build the short version of the authors file for the about dialog +# +AUTHORS-SHORT: $(top_srcdir)/AUTHORS $(srcdir)/make-authors-short.pl + $(PERL) $(srcdir)/perlnoutf.pl $(srcdir)/make-authors-short.pl < $(top_srcdir)/AUTHORS > AUTHORS-SHORT + +# +# Build the short version of the authors file with formatting codes for the +# man page +# +AUTHORS-SHORT-FORMAT: AUTHORS-SHORT $(srcdir)/make-authors-format.pl + $(PERL) $(srcdir)/perlnoutf.pl $(srcdir)/make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT -../ws.css: ../docbook/ws.css - cp ../docbook/ws.css ../ +wireshark-tmp.pod: $(srcdir)/wireshark.pod AUTHORS-SHORT-FORMAT + cat $(srcdir)/wireshark.pod AUTHORS-SHORT-FORMAT > wireshark-tmp.pod -../wireshark.1: wireshark-tmp.pod ../config.h +wireshark.1: wireshark-tmp.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - wireshark-tmp.pod | sed 's/WIRESHARK-TMP/WIRESHARK/' > ../wireshark.1 + wireshark-tmp.pod | sed 's/WIRESHARK-TMP/WIRESHARK/' > wireshark.1 -../wireshark.html: wireshark-tmp.pod ../config.h ../ws.css +wireshark.html: wireshark-tmp.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - wireshark-tmp.pod > ../wireshark.html + wireshark-tmp.pod > wireshark.html -../tshark.1: tshark.pod ../config.h +tshark.1: tshark.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/tshark.pod > ../tshark.1 + $(srcdir)/tshark.pod > tshark.1 -../tshark.html: tshark.pod ../config.h ../ws.css +tshark.html: tshark.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="tshark - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/tshark.pod > ../tshark.html + $(srcdir)/tshark.pod > tshark.html -../wireshark-filter.4: wireshark-filter.pod ../config.h +wireshark-filter.4: wireshark-filter.pod ../config.h $(POD2MAN) \ --section=4 \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - wireshark-filter.pod > ../wireshark-filter.4 + wireshark-filter.pod > wireshark-filter.4 -../wireshark-filter.html: wireshark-filter.pod ../config.h ../ws.css +wireshark-filter.html: wireshark-filter.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="wireshark-filter - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - wireshark-filter.pod > ../wireshark-filter.html + wireshark-filter.pod > wireshark-filter.html wireshark-filter.pod: wireshark-filter.pod.template ../tshark - WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ../tshark -G fields | $(PERL) $(srcdir)/dfilter2pod.pl $(srcdir)/wireshark-filter.pod.template > wireshark-filter.pod + WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ../tshark -G fields | \ + $(PERL) $(srcdir)/dfilter2pod.pl $(srcdir)/wireshark-filter.pod.template > wireshark-filter.pod -../capinfos.1: capinfos.pod ../config.h +capinfos.1: capinfos.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/capinfos.pod > ../capinfos.1 + $(srcdir)/capinfos.pod > capinfos.1 -../capinfos.html: capinfos.pod ../config.h ../ws.css +capinfos.html: capinfos.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="capinfos - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/capinfos.pod > ../capinfos.html + $(srcdir)/capinfos.pod > capinfos.html -../editcap.1: editcap.pod ../config.h +editcap.1: editcap.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/editcap.pod > ../editcap.1 + $(srcdir)/editcap.pod > editcap.1 -../editcap.html: editcap.pod ../config.h ../ws.css +editcap.html: editcap.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="editcap - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/editcap.pod > ../editcap.html + $(srcdir)/editcap.pod > editcap.html -../idl2wrs.1: idl2wrs.pod ../config.h +idl2wrs.1: idl2wrs.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/idl2wrs.pod > ../idl2wrs.1 + $(srcdir)/idl2wrs.pod > idl2wrs.1 -../idl2wrs.html: idl2wrs.pod ../config.h ../ws.css +idl2wrs.html: idl2wrs.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="idl2wrs - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/idl2wrs.pod > ../idl2wrs.html + $(srcdir)/idl2wrs.pod > idl2wrs.html -../mergecap.1: mergecap.pod ../config.h +mergecap.1: mergecap.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/mergecap.pod > ../mergecap.1 + $(srcdir)/mergecap.pod > mergecap.1 -../mergecap.html: mergecap.pod ../config.h ../ws.css +mergecap.html: mergecap.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="mergecap - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/mergecap.pod > ../mergecap.html + $(srcdir)/mergecap.pod > mergecap.html -../text2pcap.1: text2pcap.pod ../config.h +text2pcap.1: text2pcap.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/text2pcap.pod > ../text2pcap.1 + $(srcdir)/text2pcap.pod > text2pcap.1 -../text2pcap.html: text2pcap.pod ../config.h ../ws.css +text2pcap.html: text2pcap.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="text2pcap - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/text2pcap.pod > ../text2pcap.html + $(srcdir)/text2pcap.pod > text2pcap.html -../dumpcap.1: dumpcap.pod ../config.h +dumpcap.1: dumpcap.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/dumpcap.pod > ../dumpcap.1 + $(srcdir)/dumpcap.pod > dumpcap.1 -../dumpcap.html: dumpcap.pod ../config.h ../ws.css +dumpcap.html: dumpcap.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="dumpcap - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/dumpcap.pod > ../dumpcap.html + $(srcdir)/dumpcap.pod > dumpcap.html -../rawshark.1: rawshark.pod ../config.h +rawshark.1: rawshark.pod ../config.h $(POD2MAN) \ --center="The Wireshark Network Analyzer" \ --release=$(VERSION) \ - $(srcdir)/rawshark.pod > ../rawshark.1 + $(srcdir)/rawshark.pod > rawshark.1 -../rawshark.html: rawshark.pod ../config.h ../ws.css +rawshark.html: rawshark.pod ../config.h $(top_srcdir)/docbook/ws.css $(POD2HTML) \ --title="rawshark - The Wireshark Network Analyzer $(VERSION)" \ - --css=ws.css \ + --css=$(top_srcdir)/docbook/ws.css \ --noindex \ - $(srcdir)/rawshark.pod > ../rawshark.html + $(srcdir)/rawshark.pod > rawshark.html CLEANFILES = \ wireshark-filter.pod \ wireshark-tmp.pod \ - ../wireshark-filter.4 \ - ../wireshark-filter.html \ - ../wireshark.1 \ - ../wireshark.html \ - ../capinfos.1 \ - ../capinfos.html \ - ../editcap.1 \ - ../editcap.html \ - ../mergecap.1 \ - ../mergecap.html \ - ../tshark.1 \ - ../tshark.html \ - ../text2pcap.1 \ - ../text2pcap.html \ - ../dumpcap.1 \ - ../dumpcap.html \ - ../idl2wrs.1 \ - ../idl2wrs.html \ - ../rawshark.1 \ - ../rawshark.html + wireshark-filter.4 \ + wireshark-filter.html \ + wireshark.1 \ + wireshark.html \ + capinfos.1 \ + capinfos.html \ + editcap.1 \ + editcap.html \ + mergecap.1 \ + mergecap.html \ + tshark.1 \ + tshark.html \ + text2pcap.1 \ + text2pcap.html \ + dumpcap.1 \ + dumpcap.html \ + idl2wrs.1 \ + idl2wrs.html \ + rawshark.1 \ + rawshark.html DISTCLEANFILES = \ pod2htmi.tmp \ pod2htmd.tmp \ + AUTHORS-SHORT \ + AUTHORS-SHORT-FORMAT \ *~ MAINTAINERCLEANFILES = \ @@ -213,6 +280,9 @@ EXTRA_DIST = \ README.stats_tree \ README.tapping \ README.xml-output \ + make-authors-format.pl \ + make-authors-short.pl \ + perlnoutf.pl \ capinfos.pod \ dfilter2pod.pl \ dumpcap.pod \ diff --git a/doc/Makefile.nmake b/doc/Makefile.nmake index 4509930c69..1abc955108 100644 --- a/doc/Makefile.nmake +++ b/doc/Makefile.nmake @@ -33,13 +33,21 @@ doc: wireshark.html tshark.html wireshark-filter.html capinfos.html \ man: wireshark.1 tshark.1 wireshark-filter.4 capinfos.1 editcap.1 \ idl2wrs.1 mergecap.1 text2pcap.1 dumpcap.1 rawshark.1 -wireshark-tmp.pod: wireshark.pod ../AUTHORS-SHORT-FORMAT - copy /B wireshark.pod + ..\AUTHORS-SHORT-FORMAT wireshark-tmp.pod +wireshark-tmp.pod: wireshark.pod AUTHORS-SHORT-FORMAT + copy /B wireshark.pod + AUTHORS-SHORT-FORMAT wireshark-tmp.pod -../AUTHORS-SHORT-FORMAT: - cd .. - $(MAKE) /$(MAKEFLAGS) -f makefile.nmake AUTHORS-SHORT-FORMAT - cd doc +# +# Build the short version of the authors file for the about dialog +# +AUTHORS-SHORT: ../AUTHORS make-authors-short.pl + $(PERL) perlnoutf.pl make-authors-short.pl < ../AUTHORS > AUTHORS-SHORT + +# +# Build the short version of the authors file with formatting codes for +# the man page +# +AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl + $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT ws.css: ../docbook/ws.css copy ..\docbook\ws.css . @@ -200,6 +208,7 @@ clean: rm -f rawshark.html rawshark.1 rm -f pod2htm* rm -f ws.css + rm -f AUTHORS-SHORT AUTHORS-SHORT-FORMAT distclean: clean diff --git a/doc/make-authors-format.pl b/doc/make-authors-format.pl new file mode 100755 index 0000000000..8c325d2d87 --- /dev/null +++ b/doc/make-authors-format.pl @@ -0,0 +1,89 @@ +# $Id$ + +# Convert AUTHORS-SHORT file for use in man page and HTML documentation +# after processing through pod2man and pod2html. +# +# Must be called via perlnoutf. + +use strict; + +print "=for html <pre>\n\n"; +print "=for man .nf\n\n"; + +while (<>) { + printline(); +} + +print "\n=for html </pre>\n"; +print "\n=for man .fi\n"; + +sub printline { + my $line = shift || $_; +# +# Translate UTF-8 characters to the E<> escapes handled by Pod::Man +# (and only those, since they're a subset of HTML entities) +# + $line =~ s/\xc3\x80/E<Agrave>/g; + $line =~ s/\xc3\x81/E<Aacute>/g; + $line =~ s/\xc3\x82/E<Acirc>/g; + $line =~ s/\xc3\x83/E<Atilde>/g; + $line =~ s/\xc3\x84/E<Auml>/g; + $line =~ s/\xc3\x85/E<Aring>/g; + $line =~ s/\xc3\x86/E<AElig>/g; + $line =~ s/\xc3\x87/E<Ccedil>/g; + $line =~ s/\xc3\x88/E<Egrave>/g; + $line =~ s/\xc3\x89/E<Eacute>/g; + $line =~ s/\xc3\x8a/E<Ecirc>/g; + $line =~ s/\xc3\x8b/E<Euml>/g; + $line =~ s/\xc3\x8c/E<Igrave>/g; + $line =~ s/\xc3\x8d/E<Iacute>/g; + $line =~ s/\xc3\x8e/E<Icirc>/g; + $line =~ s/\xc3\x8f/E<Iuml>/g; + $line =~ s/\xc3\x90/E<ETH>/g; + $line =~ s/\xc3\x91/E<Ntilde>/g; + $line =~ s/\xc3\x92/E<Ograve>/g; + $line =~ s/\xc3\x93/E<Oacute>/g; + $line =~ s/\xc3\x94/E<Ocirc>/g; + $line =~ s/\xc3\x95/E<Otilde>/g; + $line =~ s/\xc3\x96/E<Ouml>/g; + $line =~ s/\xc3\x98/E<Oslash>/g; + $line =~ s/\xc3\x99/E<Ugrave>/g; + $line =~ s/\xc3\x9a/E<Uacute>/g; + $line =~ s/\xc3\x9b/E<Ucirc>/g; + $line =~ s/\xc3\x9c/E<Uuml>/g; + $line =~ s/\xc3\x9d/E<Yacute>/g; + $line =~ s/\xc3\x9e/E<THORN>/g; + $line =~ s/\xc3\x9f/E<szlig>/g; + $line =~ s/\xc3\xa0/E<agrave>/g; + $line =~ s/\xc3\xa1/E<aacute>/g; + $line =~ s/\xc3\xa2/E<acirc>/g; + $line =~ s/\xc3\xa3/E<atilde>/g; + $line =~ s/\xc3\xa4/E<auml>/g; + $line =~ s/\xc3\xa5/E<aring>/g; + $line =~ s/\xc3\xa6/E<aelig>/g; + $line =~ s/\xc3\xa7/E<ccedil>/g; + $line =~ s/\xc3\xa8/E<egrave>/g; + $line =~ s/\xc3\xa9/E<eacute>/g; + $line =~ s/\xc3\xaa/E<ecirc>/g; + $line =~ s/\xc3\xab/E<euml>/g; + $line =~ s/\xc3\xac/E<igrave>/g; + $line =~ s/\xc3\xad/E<iacute>/g; + $line =~ s/\xc3\xae/E<icirc>/g; + $line =~ s/\xc3\xaf/E<iuml>/g; + $line =~ s/\xc3\xb0/E<eth>/g; + $line =~ s/\xc3\xb1/E<ntilde>/g; + $line =~ s/\xc3\xb2/E<ograve>/g; + $line =~ s/\xc3\xb3/E<oacute>/g; + $line =~ s/\xc3\xb4/E<ocirc>/g; + $line =~ s/\xc3\xb5/E<otilde>/g; + $line =~ s/\xc3\xb6/E<ouml>/g; + $line =~ s/\xc3\xb8/E<oslash>/g; + $line =~ s/\xc3\xb9/E<ugrave>/g; + $line =~ s/\xc3\xba/E<uacute>/g; + $line =~ s/\xc3\xbb/E<ucirc>/g; + $line =~ s/\xc3\xbc/E<uuml>/g; + $line =~ s/\xc3\xbd/E<yacute>/g; + $line =~ s/\xc3\xbe/E<thorn>/g; + $line =~ s/\xc3\xbf/E<yuml>/g; + print $line; +} diff --git a/doc/make-authors-short.pl b/doc/make-authors-short.pl new file mode 100755 index 0000000000..ac96b0c264 --- /dev/null +++ b/doc/make-authors-short.pl @@ -0,0 +1,31 @@ +# $Id$ + +# Remove tasks from individual author entries from AUTHORS file +# for use in the about dialog. +# +# Must be called via perlnoutf. + +use strict; + +my $subinfo=0; +my $nextline; + +$_ = <>; +s/\xef\xbb\xbf//; # Skip UTF-8 byte order mark +print unless /^\n/; + +while (<>) { + if (/(.*){/) { + $subinfo = 1; + print "$1\n"; + } elsif (/}/) { + $subinfo = 0; + if (($nextline = <>) !~ /^[\s]*$/) { + print $nextline; + } + } elsif ($subinfo == 1) { + next; + } else { + print; + } +} diff --git a/doc/perlnoutf.pl b/doc/perlnoutf.pl new file mode 100755 index 0000000000..9f5580fa8c --- /dev/null +++ b/doc/perlnoutf.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w + +# $Id$ + +# Call another Perl script, passing our caller's arguments, with +# environment variables unset so perl doesn't interpret bytes as UTF-8 +# characters. + +use strict; + +delete $ENV{LANG}; +delete $ENV{LANGUAGE}; +delete $ENV{LC_ALL}; +delete $ENV{LC_CTYPE}; + +system("$^X -w @ARGV"); |