mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
f4f11adf4c
Previously, we said (more or less), "a2x is broken and here's how you could try to fix it". Instead, we now say "We need a2x to build manpages; a2x didn't work; here is a fix that might work for you; alternatively you could just skip manpage building." Addresses bug 1524. Also, give the message as a here-document rather than a bunch of echos.
66 lines
1.8 KiB
Bash
Executable File
66 lines
1.8 KiB
Bash
Executable File
#!/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:
|
|
# html|man asciidocpath outputfile
|
|
|
|
set -e
|
|
|
|
if [ $# != 3 ]; then
|
|
exit 1;
|
|
fi
|
|
|
|
output=$3
|
|
|
|
if [ "$1" = "html" ]; then
|
|
input=${output%%.html.in}.1.txt
|
|
base=${output%%.html.in}
|
|
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
|
|
elif [ "$1" = "man" ]; then
|
|
input=${output%%.1.in}.1.txt
|
|
base=${output%%.1.in}
|
|
|
|
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
|
|
if "$2" -f manpage $input; then
|
|
mv $base.1 $output;
|
|
else
|
|
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
|
|
This happens because required docbook support files are missing.
|
|
Please install docbook-xsl, docbook-xml, and libxml2-utils (Debian) or
|
|
similar.
|
|
|
|
Alternatively, to build without manpages, use the --disable-asciidoc
|
|
argument when calling configure.
|
|
==================================
|
|
EOF
|
|
exit 1;
|
|
fi
|
|
fi
|
|
|