diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.in | 1 | ||||
-rw-r--r-- | doc/SystemTap_Tapset_Reference/Makefile.am | 6 | ||||
-rw-r--r-- | doc/SystemTap_Tapset_Reference/Makefile.in | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | doc/Tapset_Reference_Guide/manpager.sh | 105 |
4 files changed, 55 insertions, 64 deletions
diff --git a/doc/Makefile.in b/doc/Makefile.in index eafd7ca7..e04852f4 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -163,6 +163,7 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PDF_FILES = tutorial.pdf langref.pdf diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 9e7d2069..68dfd971 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -2,7 +2,7 @@ ## process this file with automake to produce Makefile.in DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap -MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man5 +MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3stap HTML_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/tapsets @@ -36,7 +36,7 @@ tapsets.pdf: tapsets.xml xmlto pdf tapsets.xml stamp-mandocs: tapsets.xml - xmlto man -o man5 tapsets.xml + xmlto man -o man3stap tapsets.xml touch stamp-mandocs #FIXME need to figure out where to install things appropriately @@ -45,7 +45,7 @@ install-data-hook: $(MKDIR_P) $(DOC_INSTALL_DIR) $(INSTALL_DATA) tapsets.pdf $(DOC_INSTALL_DIR) $(MKDIR_P) $(MAN_INSTALL_DIR) - $(INSTALL_DATA) man5/* $(MAN_INSTALL_DIR) + $(INSTALL_DATA) man3stap/* $(MAN_INSTALL_DIR) $(MKDIR_P) $(HTML_INSTALL_DIR) $(INSTALL_DATA) tapsets/* $(HTML_INSTALL_DIR) endif diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index 5108dd07..22b27a3e 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -166,10 +166,11 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap -MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man5 +MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/man3stap HTML_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/tapsets SRCTREE = $(abs_top_srcdir)/ DOCPROC = $(abs_builddir)/docproc @@ -430,7 +431,7 @@ uninstall-am: @BUILD_REFDOCS_TRUE@ xmlto pdf tapsets.xml @BUILD_REFDOCS_TRUE@stamp-mandocs: tapsets.xml -@BUILD_REFDOCS_TRUE@ xmlto man -o man5 tapsets.xml +@BUILD_REFDOCS_TRUE@ xmlto man -o man3stap tapsets.xml @BUILD_REFDOCS_TRUE@ touch stamp-mandocs #FIXME need to figure out where to install things appropriately @@ -439,7 +440,7 @@ uninstall-am: @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(DOC_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) tapsets.pdf $(DOC_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(MAN_INSTALL_DIR) -@BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) man5/* $(MAN_INSTALL_DIR) +@BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) man3stap/* $(MAN_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(MKDIR_P) $(HTML_INSTALL_DIR) @BUILD_REFDOCS_TRUE@ $(INSTALL_DATA) tapsets/* $(HTML_INSTALL_DIR) # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/doc/Tapset_Reference_Guide/manpager.sh b/doc/Tapset_Reference_Guide/manpager.sh index 2b9873b7..0051d208 100644..100755 --- a/doc/Tapset_Reference_Guide/manpager.sh +++ b/doc/Tapset_Reference_Guide/manpager.sh @@ -3,12 +3,12 @@ # generated herein should be in sync with Tapset Reference Guide # cleanup -rm -rf workingdir +rm -rf man_pages # create working directory mkdir workingdir ; -# create list of man pages to generate; should be in sync with Tapset Reference Guide +# create list of man pages to generate cat ../SystemTap_Tapset_Reference/tapsets.tmpl | grep ^\!Itapset > manpageus ; sed -i -e 's/\!Itapset\///g' manpageus ; @@ -38,8 +38,6 @@ echo $i > tempname ; sed -i -e 's/.stp//g' tempname ; mv $i `cat tempname` ; mv tempname $i ; done ; -# clean all tapsetdescriptions (remove excess spaces) -# for i in `ls | grep tapsetdescription` ; do perl -p -i -e 's|^\n||g' $i ; done ; # create man page headers for i in `ls | grep -v .stp | grep -v tapsetdescription` ; do @@ -51,7 +49,6 @@ echo " " >> $i.template ; echo ".SH DESCRIPTION" >> $i.template ; cat $i.stp.tapsetdescription >> $i.template ; echo " " >> $i.template ; -#echo " " >> $i.template ; echo ".SH PROBES" >> $i.template ; echo ".br" >> $i.template ; echo ".P" >> $i.template ; @@ -59,73 +56,65 @@ echo ".TP" >> $i.template ; done # MOST IMPORTANT: clean man page body! -for i in `ls | grep -v .stp | grep -v tapsetdescription | grep -v template` ; -do cp $i $i.tmp ; +sed -i -e 's/\.stp$//g' ../manpageus ; +for i in `cat ../manpageus` ; +do mv $i $i.tmp ; perl -p -i -e 's| \* sfunction|.BR|g' $i.tmp ; perl -p -i -e 's| \* probe|.BR|g' $i.tmp ; perl -p -i -e 's| -|\ninitlinehere|g' $i.tmp ; -perl -p -i -e 's|^initlinehere([^\n]*)\n|\n.br\n$1\n\n.B Arguments:|g' $i.tmp ; -perl -p -i -e 's| \* @([^:]*):|\n.I $1\n.br\n|g' $i.tmp ; -perl -p -i -e 's| \* ([^:]*):|\n.BR $1:\n.br\n|g' $i.tmp ; +perl -p -i -e 's|^initlinehere([^\n]*)\n|$1\n |g' $i.tmp ; +perl -p -i -e 's| \* @([^:]*):|\n.I $1:\n|g' $i.tmp ; +perl -p -i -e 's| \* ([^:]*):|\n.BR $1:\n|g' $i.tmp ; +perl -p -i -e 's| \* ||g' $i.tmp perl -p -i -e 's|\*probestart|\n.P\n.TP|g' $i.tmp ; -perl -p -i -e 's|\.I|\n\n.I|g' $i.tmp ; -# special formatting for Arguments header -perl -p -i -e 's|.B Arguments: \*\/||g' $i.tmp ; -perl -p -i -e 's|.B Arguments: \*|.B Description:|g' $i.tmp ; - -cat $i.tmp | -perl -p -e 'undef $/;s|.B Arguments:\n.B|.B|msg' | -perl -p -e 'undef $/;s|\n\n\n|\n\n|msg' > $i.manpagebody ; +perl -p -i -e 's|\.I|\n.I|g' $i.tmp ; +# remove empty lines +sed -i -e '/^$/d' $i.tmp ; +sed -i -e '/^$/d' $i.tmp ; +sed -i -e 's/^[ \t]*//g' $i.tmp ; +# process Description headers +perl -p -i -e 's|^\*[^/]|\n.BR Description:\n|g' $i.tmp ; +perl -p -i -e 'undef $/;s|\.BR Description:\n\.BR|.BR|g' $i.tmp ; +perl -p -i -e 'undef $/;s|\.BR Description:\n\*\/||g' $i.tmp ; +# process Argument headers +perl -p -i -e 'undef $/;s|\n\n.I|\n.br\n.BR Arguments:\n.I|g' $i.tmp ; +# clean up formatting of arguments +perl -p -i -e 's|^.I([^:]*:)|\n.br\n.br\n.IR$1\n.br\n\t|g' $i.tmp ; done +# make tags work +for i in `cat ../manpageus` ; do +perl -p -i -e 's|</[^>]*>([^.])|$1\n|g' $i.tmp ; +perl -p -i -e 's|<[^>]*>|\n.B |g' $i.tmp ; +# the previous two statements create excess empty lines, remove some of them +sed -i -e '/^$/d' $i.tmp ; +# increase whitespace between some headers +perl -p -i -e 's|^\.BR ([^:]*:)|\n.br\n.BR $1\n.br\n|g' $i.tmp +done + # generate footer template -mv ../manpageus . -sed -i -e 's/.stp//g' manpageus echo ".SH SEE ALSO" >> footer echo ".IR stap (1)," >> footer echo ".IR stapprobes (5)," >> footer -for i in `cat manpageus`; do echo ".IR stapprobes."$i" (5)," >> footer ; done +for i in `cat ../manpageus`; do echo ".IR stapprobes."$i" (5)," >> footer ; done # assemble parts -for i in `cat manpageus`; do -cat $i.template >> $i.5 ; -cat $i.manpagebody >> $i.5 ; -cat footer >> $i.5 ; +for i in `cat ../manpageus`; do +cat $i.template >> stapprobes.$i.5 ; +cat $i.tmp >> stapprobes.$i.5 ; +cat footer >> stapprobes.$i.5 ; +# final polish +sed -i -e 's/\*\/$//g' stapprobes.$i.5 ; done # cleanup -for i in `cat manpageus`; do -# context.stp -perl -p -i -e 's|.B Description:/|\n.P\n.TP|g' $i.5 ; -perl -p -i -e 's|.B Description:|.B Description:\n\n |g' $i.5 ; -# convert tags -perl -p -i -e 's|</[^>]*>([^.])|$1\n|g' $i.5 ; -perl -p -i -e 's|<[^>]*>|\n.B |g' $i.5 ; -cat $i.5 | -perl -p -e 'undef $/;s|\.B Arguments:\n\n\.B |.B|msg' | -# for tagged commands followed by periods -perl -p -e 'undef $/;s|\n\.B \.|.\n|msg' | -perl -p -e 'undef $/;s|\n \* | |msg' > stapprobes.$i.5.in ; -# cleanup all remaining stars, excess initial whitespace, and trailing "/" per line -perl -p -i -e 's|^ \*||g' stapprobes.$i.5.in; -perl -p -i -e 's|^[ ]*||g' stapprobes.$i.5.in; -perl -p -i -e 's|^/||g' stapprobes.$i.5.in; -# cleanup remaining excess whitespace -perl -p -i -e 's|\t\t| |g' stapprobes.$i.5.in; -perl -p -i -e 's|^ ||g' stapprobes.$i.5.in; -sed -i -e 's/ / /g' stapprobes.$i.5.in; +for i in `ls | grep -v 'stapprobes.*.5'` ; do +rm $i ; done -# file cleanup -rm `ls | grep -v stapprobes` -#mv workingdir final_manpages -# perl -p -i -e 's|||g' stapprobes.$i.5.in ; - -# perl -p -i -e 's|||g' $i.manpagebody -# use to move marked strings. -# sed -n '/\/\/ <tapsetdescription>/,/\/\/ <\/tapsetdescription>/ s/.*/&/w bleh' < ioscheduler -# remove excess initial whitespace for each line -# perl -p -i -e 's|^ ||g' stapprobes.$i.5.in; -# convert tags -# perl -p -i -e 's|</[^>]*>|\n|g' stapprobes.$i.5.in ; -# perl -p -i -e 's|<[^>]*>|\n.B |g' stapprobes.$i.5.in ;
\ No newline at end of file +rm ../manpageus ; +cd .. +mv workingdir man_pages +echo " " +echo "Finished! man pages generated in ./man_pages." +echo " "
\ No newline at end of file |