2010-01-18 22:15:38 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Copyright (c) The Tor Project, Inc.
|
|
|
|
# See LICENSE for licensing information
|
|
|
|
# Run this to generate .html.in or .1.in files from asciidoc files.
|
|
|
|
# Arguments:
|
2010-02-27 17:06:06 +01:00
|
|
|
# html|man asciidocpath outputfile
|
2010-01-18 22:15:38 +01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2010-02-27 17:06:06 +01:00
|
|
|
if [ $# != 3 ]; then
|
2010-01-18 22:15:38 +01:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2010-02-27 17:06:06 +01:00
|
|
|
output=$3
|
2010-01-18 22:15:38 +01:00
|
|
|
|
|
|
|
if [ "$1" = "html" ]; then
|
2010-02-27 17:06:06 +01:00
|
|
|
input=${output%%.html.in}.1.txt
|
|
|
|
base=${output%%.html.in}
|
2010-03-08 21:01:52 +01:00
|
|
|
if [ "$2" != none ]; then
|
|
|
|
"$2" -d manpage -o $output $input;
|
|
|
|
else
|
|
|
|
echo "==================================";
|
|
|
|
echo;
|
|
|
|
echo "You need asciidoc installed to be able to build the manpage.";
|
|
|
|
echo "To build without manpages, use the --disable-asciidoc argument";
|
|
|
|
echo "when calling configure.";
|
|
|
|
echo;
|
|
|
|
echo "==================================";
|
|
|
|
exit 1;
|
|
|
|
fi
|
2010-01-18 22:15:38 +01:00
|
|
|
elif [ "$1" = "man" ]; then
|
2010-02-27 17:06:06 +01:00
|
|
|
input=${output%%.1.in}.1.txt
|
|
|
|
base=${output%%.1.in}
|
|
|
|
|
2010-03-08 21:01:52 +01:00
|
|
|
if test "$2" = none; then
|
|
|
|
echo "==================================";
|
|
|
|
echo;
|
|
|
|
echo "You need asciidoc installed to be able to build the manpage.";
|
|
|
|
echo "To build without manpages, use the --disable-asciidoc argument";
|
|
|
|
echo "when calling configure.";
|
|
|
|
echo;
|
|
|
|
echo "==================================";
|
|
|
|
exit 1;
|
|
|
|
fi
|
2010-03-01 03:17:48 +01:00
|
|
|
if "$2" -f manpage $input; then
|
|
|
|
mv $base.1 $output;
|
2010-01-18 22:15:38 +01:00
|
|
|
else
|
|
|
|
echo "==================================";
|
|
|
|
echo;
|
2010-03-01 03:17:48 +01:00
|
|
|
echo "a2x is installed, but some required docbook support files are";
|
2010-03-30 14:53:30 +02:00
|
|
|
echo "missing. Please install docbook-xsl, docbook-xml, and";
|
|
|
|
echo "libxml2-utils (Debian) or similar.";
|
2010-01-18 22:15:38 +01:00
|
|
|
echo;
|
|
|
|
echo "==================================";
|
2010-03-01 03:17:48 +01:00
|
|
|
exit 1;
|
2010-01-18 22:15:38 +01:00
|
|
|
fi
|
|
|
|
fi
|
2010-03-08 21:01:52 +01:00
|
|
|
|