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
|
2021-09-08 22:25:47 +02:00
|
|
|
exit 1
|
2010-01-18 22:15:38 +01:00
|
|
|
fi
|
|
|
|
|
2021-11-03 14:47:30 +01:00
|
|
|
SOURCE_DATE_EPOCH="$(git show --no-patch --format='%ct')"
|
|
|
|
export SOURCE_DATE_EPOCH
|
2020-07-10 02:31:35 +02:00
|
|
|
|
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
|
2021-11-03 14:49:07 +01:00
|
|
|
TZ=UTC "$2" -f "$(dirname "$0")/nofooter.conf" -d manpage -o "$output" "$input";
|
2010-03-08 21:01:52 +01:00
|
|
|
else
|
2021-09-08 22:25:47 +02:00
|
|
|
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
|
2010-03-08 21:01:52 +01:00
|
|
|
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
|
2021-09-08 22:25:47 +02:00
|
|
|
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
|
2010-03-08 21:01:52 +01:00
|
|
|
fi
|
2019-03-27 18:27:57 +01:00
|
|
|
if "$2" -f manpage "$input"; then
|
2021-09-08 22:25:47 +02:00
|
|
|
mv "$base.1" "$output"
|
2010-01-18 22:15:38 +01:00
|
|
|
else
|
2021-09-08 22:25:47 +02:00
|
|
|
cat<<EOF
|
2010-06-07 17:38:58 +02:00
|
|
|
==================================
|
|
|
|
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
|
2021-09-08 22:25:47 +02:00
|
|
|
similar. If you use homebrew on Mac OS X, install the docbook formula
|
2012-07-20 15:29:20 +02:00
|
|
|
and add "export XML_CATALOG_FILES=/usr/local/etc/xml/catalog" to your
|
2021-09-08 22:25:47 +02:00
|
|
|
.bashrc file.
|
2010-06-07 17:38:58 +02:00
|
|
|
|
|
|
|
Alternatively, to build without manpages, use the --disable-asciidoc
|
|
|
|
argument when calling configure.
|
|
|
|
==================================
|
|
|
|
EOF
|
2021-09-08 22:25:47 +02:00
|
|
|
exit 1
|
2010-01-18 22:15:38 +01:00
|
|
|
fi
|
|
|
|
fi
|