From 7de975d0ea460d69948dc8219739a94433c1e6e2 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 19 Jan 2007 22:08:13 +0000 Subject: [PATCH] New publishing macros git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5268 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- tools/build/publish | 16 ++++++++-- tools/build/publish-image | 7 ++++ tools/build/publish-manpage | 64 +++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 3 deletions(-) create mode 100755 tools/build/publish-image create mode 100755 tools/build/publish-manpage diff --git a/tools/build/publish b/tools/build/publish index c775aaae0..76291702f 100755 --- a/tools/build/publish +++ b/tools/build/publish @@ -1,7 +1,7 @@ #!/bin/sh #STYLESHEET=/home/teastep/Shorewall/docbook-xsl-1.62.4//xhtml/docbook.xsl -STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/current/xhtml/docbook.xsl +STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl WEBSITE=/home/teastep/Shorewall/Website HTMFILES=" 6to4.htm @@ -44,6 +44,12 @@ HTMFILES=" VPN.htm whitelisting_under_shorewall.htm" +NOTOC=" + Documentation_Index.xml + GettingStarted.xml + ProxyARP.xml + shorewall_prerequisites.xml" + list_search() # $1 = element to search for , $2-$n = list { local e=$1 @@ -78,9 +84,13 @@ while [ $# -gt 0 ]; do f="$WEBSITE/$b" fi + GENTOC= + + list_search $1 $NOTOC && GENTOC="--stringparam generate.toc ''" + echo "Converting $1 from XML to HTML ($b) ..." - if xmllint --valid --noout $1 && xsltproc --output $f --stringparam html.stylesheet html.css --stringparam ulink.target _self -param toc.section.depth 3 $STYLESHEET $1 ; then + if xmllint --valid --noout $1 && xsltproc --output $f --stringparam html.stylesheet html.css --stringparam ulink.target _self $GENTOC --param toc.section.depth 3 $STYLESHEET $1 ; then filestocopy="$filestocopy $f" fi ;; @@ -95,7 +105,7 @@ while [ $# -gt 0 ]; do done DESTS=" -mail.shorewall.net:/srv/www/html +root@mail.shorewall.net:/srv/www/html " if [ -n "$filestocopy" ]; then diff --git a/tools/build/publish-image b/tools/build/publish-image new file mode 100755 index 000000000..03796d82d --- /dev/null +++ b/tools/build/publish-image @@ -0,0 +1,7 @@ +#!/bin/sh + +# scp $@ teastep@shorewall.sourceforge.net:/home/groups/s/sh/shorewall/htdocs/images + scp -p $@ root@mail:/srv/www/html/images +# cp -pf $@ /home/teastep/Shorewall-docs + + diff --git a/tools/build/publish-manpage b/tools/build/publish-manpage new file mode 100755 index 000000000..e04c62ad8 --- /dev/null +++ b/tools/build/publish-manpage @@ -0,0 +1,64 @@ +#!/bin/sh + +#STYLESHEET=/home/teastep/Shorewall/docbook-xsl-1.62.4//xhtml/docbook.xsl +STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl +WEBSITE=/home/teastep/Shorewall/Website + +list_search() # $1 = element to search for , $2-$n = list +{ + local e=$1 + + while [ $# -gt 1 ]; do + shift + [ "x$e" = "x$1" ] && return 0 + done + + return 1 +} + +if [ $# -eq 0 ]; then + echo "Usage: $(basename $0) ..." + exit 2 +fi + +while [ $# -gt 0 ]; do + + case $1 in + *.xml) + b=${1%.*}.html + + f="$WEBSITE/$b" + + echo "Converting $1 from XML to HTML ($b) ..." + + if xsltproc --output $f --stringparam html.stylesheet html.css --stringparam ulink.target _self -param toc.section.depth 3 $STYLESHEET $1 ; then + filestocopy="$filestocopy $f" + fi + ;; + + *) + filestocopy="$filestocopy $1" + ;; + esac + + shift + +done + +DESTS=" +root@mail.shorewall.net:/srv/www/html/manpages/ +" + +if [ -n "$filestocopy" ]; then + for f in $filestocopy; do + filestoreport="$filestoreport $(basename $f)" + done + + chmod 664 $filestocopy + for d in $DESTS; do + echo "$filestoreport -> $d" + scp -qp $filestocopy $d + done +fi + +