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-09-30 22:44:11 +02:00
|
|
|
|
2010-03-08 21:01:52 +01:00
|
|
|
if [ "$2" != none ]; then
|
2016-07-03 20:44:13 +02:00
|
|
|
TZ=UTC "$2" -d manpage -o $output $input;
|
2010-03-08 21:01:52 +01:00
|
|
|
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-09-30 22:44:11 +02:00
|
|
|
|
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
|
2010-06-07 17:38:58 +02:00
|
|
|
cat<<EOF
|
|
|
|
==================================
|
|
|
|
You need a working asciidoc installed to be able to build the manpage.
|
|
|
|
|
|
|
|
a2x is installed, but for some reason it isn't working. Sometimes
|
2013-03-15 16:17:08 +01:00
|
|
|
this happens because required docbook support files are missing.
|
|
|
|
Please install docbook-xsl, docbook-xml, and xmlto (Debian) or
|
2012-07-20 15:29:20 +02:00
|
|
|
similar. If you use homebrew on Mac OS X, install the docbook formula
|
|
|
|
and add "export XML_CATALOG_FILES=/usr/local/etc/xml/catalog" to your
|
|
|
|
.bashrc
|
2010-06-07 17:38:58 +02:00
|
|
|
|
|
|
|
Alternatively, to build without manpages, use the --disable-asciidoc
|
|
|
|
argument when calling configure.
|
|
|
|
==================================
|
|
|
|
EOF
|
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
|
|
|
|