Skip to content

Commit 7e9ab95

Browse files
committed
Merge #8608: Install manpages via make install, also add some autogenerated manpages
d19583f improved gen-manpages.sh, includes bitcoin-tx and strips commit tag, now also runs binaries from build dir by default, added variables for more control (nomnombtc) 09546ca regenerated all manpages with commit tag stripped, also add bitcoin-tx (nomnombtc) ae6e754 change help string --enable-man to --disable-man (nomnombtc) a32c102 add conditional for --enable-man, default is yes (nomnombtc) dc84b6f add doc/man to subdir if configure flag --enable-man is set (nomnombtc) 00dba72 add doc/man/Makefile.am to include manpages (nomnombtc) eb5643b add autogenerated manpages by help2man (nomnombtc) 6edf2fd add gen-manpages.sh description to README.md (nomnombtc) d2cd9c0 add script to generate manpages with help2man (nomnombtc)
2 parents 2a0836f + d19583f commit 7e9ab95

File tree

9 files changed

+1244
-1
lines changed

9 files changed

+1244
-1
lines changed

Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
ACLOCAL_AMFLAGS = -I build-aux/m4
22
SUBDIRS = src
3+
if ENABLE_MAN
4+
SUBDIRS += doc/man
5+
endif
36
.PHONY: deploy FORCE
47

58
GZIP_ENV="-9n"
@@ -213,6 +216,8 @@ DISTCLEANFILES = qa/pull-tester/tests_config.pyc
213216

214217
.INTERMEDIATE: $(COVERAGE_INFO)
215218

219+
DISTCHECK_CONFIGURE_FLAGS = --enable-man
220+
216221
clean-local:
217222
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)
218223
rm -rf qa/pull-tester/__pycache__

configure.ac

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ AC_ARG_ENABLE([zmq],
171171

172172
AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
173173

174+
AC_ARG_ENABLE(man,
175+
[AS_HELP_STRING([--disable-man],
176+
[do not install man pages (default is to install)])],,
177+
enable_man=yes)
178+
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
179+
174180
# Enable debug
175181
AC_ARG_ENABLE([debug],
176182
[AS_HELP_STRING([--enable-debug],
@@ -1057,7 +1063,7 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
10571063
AC_SUBST(ZMQ_LIBS)
10581064
AC_SUBST(PROTOBUF_LIBS)
10591065
AC_SUBST(QR_LIBS)
1060-
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
1066+
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
10611067
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
10621068
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])
10631069
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])

contrib/devtools/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ would be changed to:
4040

4141
```// Copyright (c) 2009-2015 The Bitcoin Core developers```
4242

43+
gen-manpages.sh
44+
===============
45+
46+
A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option.
47+
This requires help2man which can be found at: https://www.gnu.org/software/help2man/
48+
4349
git-subtree-check.sh
4450
====================
4551

contrib/devtools/gen-manpages.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
4+
SRCDIR=${SRCDIR:-$TOPDIR/src}
5+
MANDIR=${MANDIR:-$TOPDIR/doc/man}
6+
7+
BITCOIND=${BITCOIND:-$SRCDIR/bitcoind}
8+
BITCOINCLI=${BITCOINCLI:-$SRCDIR/bitcoin-cli}
9+
BITCOINTX=${BITCOINTX:-$SRCDIR/bitcoin-tx}
10+
BITCOINQT=${BITCOINQT:-$SRCDIR/qt/bitcoin-qt}
11+
12+
[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
13+
14+
# The autodetected version git tag can screw up manpage output a little bit
15+
BTCVER=($($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))
16+
17+
# Create a footer file with copyright content.
18+
# This gets autodetected fine for bitcoind if --version-string is not set,
19+
# but has different outcomes for bitcoin-qt and bitcoin-cli.
20+
echo "[COPYRIGHT]" > footer.h2m
21+
$BITCOIND --version | sed -n '1!p' >> footer.h2m
22+
23+
for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $BITCOINQT; do
24+
cmdname="${cmd##*/}"
25+
help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
26+
sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1
27+
done
28+
29+
rm -f footer.h2m

doc/man/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist_man1_MANS=bitcoind.1 bitcoin-qt.1 bitcoin-cli.1 bitcoin-tx.1

doc/man/bitcoin-cli.1

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.5.
2+
.TH BITCOIN-CLI "1" "September 2016" "bitcoin-cli v0.13.0.0" "User Commands"
3+
.SH NAME
4+
bitcoin-cli \- manual page for bitcoin-cli v0.13.0.0
5+
.SH DESCRIPTION
6+
Bitcoin Core RPC client version v0.13.0.0
7+
.SS "Usage:"
8+
.TP
9+
bitcoin\-cli [options] <command> [params]
10+
Send command to Bitcoin Core
11+
.TP
12+
bitcoin\-cli [options] help
13+
List commands
14+
.TP
15+
bitcoin\-cli [options] help <command>
16+
Get help for a command
17+
.SH OPTIONS
18+
.HP
19+
\-?
20+
.IP
21+
This help message
22+
.HP
23+
\fB\-conf=\fR<file>
24+
.IP
25+
Specify configuration file (default: bitcoin.conf)
26+
.HP
27+
\fB\-datadir=\fR<dir>
28+
.IP
29+
Specify data directory
30+
.PP
31+
Chain selection options:
32+
.HP
33+
\fB\-testnet\fR
34+
.IP
35+
Use the test chain
36+
.HP
37+
\fB\-regtest\fR
38+
.IP
39+
Enter regression test mode, which uses a special chain in which blocks
40+
can be solved instantly. This is intended for regression testing
41+
tools and app development.
42+
.HP
43+
\fB\-rpcconnect=\fR<ip>
44+
.IP
45+
Send commands to node running on <ip> (default: 127.0.0.1)
46+
.HP
47+
\fB\-rpcport=\fR<port>
48+
.IP
49+
Connect to JSON\-RPC on <port> (default: 8332 or testnet: 18332)
50+
.HP
51+
\fB\-rpcwait\fR
52+
.IP
53+
Wait for RPC server to start
54+
.HP
55+
\fB\-rpcuser=\fR<user>
56+
.IP
57+
Username for JSON\-RPC connections
58+
.HP
59+
\fB\-rpcpassword=\fR<pw>
60+
.IP
61+
Password for JSON\-RPC connections
62+
.HP
63+
\fB\-rpcclienttimeout=\fR<n>
64+
.IP
65+
Timeout during HTTP requests (default: 900)
66+
.HP
67+
\fB\-stdin\fR
68+
.IP
69+
Read extra arguments from standard input, one per line until EOF/Ctrl\-D
70+
(recommended for sensitive information such as passphrases)
71+
.SH COPYRIGHT
72+
Copyright (C) 2009-2016 The Bitcoin Core developers
73+
74+
Please contribute if you find Bitcoin Core useful. Visit
75+
<https://bitcoincore.org> for further information about the software.
76+
The source code is available from <https://github.com/bitcoin/bitcoin>.
77+
78+
This is experimental software.
79+
Distributed under the MIT software license, see the accompanying file COPYING
80+
or <http://www.opensource.org/licenses/mit-license.php>.
81+
82+
This product includes software developed by the OpenSSL Project for use in the
83+
OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written
84+
by Eric Young and UPnP software written by Thomas Bernard.

0 commit comments

Comments
 (0)