2018-06-24 16:41:58 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-09-13 10:25:41 +02:00
|
|
|
|
2018-06-18 13:12:07 +02:00
|
|
|
export LC_ALL=C
|
2016-09-13 10:25:41 +02:00
|
|
|
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
|
2018-02-19 00:04:54 +01:00
|
|
|
BUILDDIR=${BUILDDIR:-$TOPDIR}
|
|
|
|
|
|
|
|
BINDIR=${BINDIR:-$BUILDDIR/src}
|
2016-09-13 10:25:41 +02:00
|
|
|
MANDIR=${MANDIR:-$TOPDIR/doc/man}
|
|
|
|
|
2018-02-19 00:04:54 +01:00
|
|
|
BITCOIND=${BITCOIND:-$BINDIR/dashd}
|
|
|
|
BITCOINCLI=${BITCOINCLI:-$BINDIR/dash-cli}
|
|
|
|
BITCOINTX=${BITCOINTX:-$BINDIR/dash-tx}
|
2019-02-06 17:18:23 +01:00
|
|
|
WALLET_TOOL=${WALLET_TOOL:-$BINDIR/dash-wallet}
|
2018-02-19 00:04:54 +01:00
|
|
|
BITCOINQT=${BITCOINQT:-$BINDIR/qt/dash-qt}
|
2016-09-13 10:25:41 +02:00
|
|
|
|
|
|
|
[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
|
|
|
|
|
|
|
|
# The autodetected version git tag can screw up manpage output a little bit
|
2019-07-05 03:00:44 +02:00
|
|
|
read -r -a BTCVER <<< "$($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')"
|
2016-09-13 10:25:41 +02:00
|
|
|
|
|
|
|
# Create a footer file with copyright content.
|
2020-06-11 10:39:04 +02:00
|
|
|
# This gets autodetected fine for dashd if --version-string is not set,
|
|
|
|
# but has different outcomes for dash-qt and dash-cli.
|
2016-09-13 10:25:41 +02:00
|
|
|
echo "[COPYRIGHT]" > footer.h2m
|
|
|
|
$BITCOIND --version | sed -n '1!p' >> footer.h2m
|
|
|
|
|
2019-02-06 17:18:23 +01:00
|
|
|
for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINQT; do
|
2016-09-13 10:25:41 +02:00
|
|
|
cmdname="${cmd##*/}"
|
|
|
|
help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
|
|
|
|
sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f footer.h2m
|