Skip to content

Commit 0da0dd8

Browse files
MitchellCashCevap Master
authored and
Cevap Master
committed
Add ability to install man pages via make install (#27)
* Add support for out-of-tree builds in gen-manpages.sh This adds support for setting the environment variable `BUILDDIR` to point to executables that are outside the source directory. E.g. to invoke the tool when the build is in $PWD/build: ```bash BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh ``` * Add autogenerated manpages for 3.0.4 * Add ability to install man pages via `make install`
1 parent ae0a10e commit 0da0dd8

File tree

9 files changed

+1339
-10
lines changed

9 files changed

+1339
-10
lines changed

Makefile.am

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
ACLOCAL_AMFLAGS = -I build-aux/m4
88
SUBDIRS = src
9+
if ENABLE_MAN
10+
SUBDIRS += doc/man
11+
endif
912
.PHONY: deploy FORCE
1013

1114
export PYTHONPATH
@@ -227,5 +230,7 @@ CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
227230

228231
.INTERMEDIATE: $(COVERAGE_INFO)
229232

233+
DISTCHECK_CONFIGURE_FLAGS = --enable-man
234+
230235
clean-local:
231236
rm -rf test_ion.coverage/ total.coverage/ $(OSX_APP)

configure.ac

+7-1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ AC_ARG_WITH([system-univalue],
179179

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

182+
AC_ARG_ENABLE(man,
183+
[AS_HELP_STRING([--disable-man],
184+
[do not install man pages (default is to install)])],,
185+
enable_man=yes)
186+
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
187+
182188
# Enable debug
183189
AC_ARG_ENABLE([debug],
184190
[AS_HELP_STRING([--enable-debug],
@@ -1141,7 +1147,7 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
11411147
AC_SUBST(ZMQ_LIBS)
11421148
AC_SUBST(PROTOBUF_LIBS)
11431149
AC_SUBST(QR_LIBS)
1144-
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
1150+
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
11451151
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
11461152
AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh])
11471153
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])

contrib/devtools/README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Contents
2-
===========
2+
========
33
This directory contains tools for developers working on this repository.
44

55
check-doc.py
@@ -8,6 +8,20 @@ check-doc.py
88
Check if all command line args are documented. The return value indicates the
99
number of undocumented args.
1010

11+
gen-manpages.sh
12+
===============
13+
14+
A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option.
15+
This requires help2man which can be found at: https://www.gnu.org/software/help2man/
16+
17+
With in-tree builds this tool can be run from any directory within the
18+
repostitory. To use this tool with out-of-tree builds set `BUILDDIR`. For
19+
example:
20+
21+
```bash
22+
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
23+
```
24+
1125
github-merge.py
1226
===============
1327

contrib/devtools/gen-manpages.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
#!/bin/bash
22

33
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
4-
SRCDIR=${SRCDIR:-$TOPDIR/src}
4+
BUILDDIR=${BUILDDIR:-$TOPDIR}
5+
6+
BINDIR=${BINDIR:-$BUILDDIR/src}
57
MANDIR=${MANDIR:-$TOPDIR/doc/man}
68

7-
IOND=${IOND:-$SRCDIR/iond}
8-
IONCLI=${IONCLI:-$SRCDIR/ion-cli}
9-
IONTX=${IONTX:-$SRCDIR/ion-tx}
10-
IONQT=${IONQT:-$SRCDIR/qt/ion-qt}
9+
IOND=${IOND:-$BINDIR/iond}
10+
IONCLI=${IONCLI:-$BINDIR/ion-cli}
11+
IONTX=${IONTX:-$BINDIR/ion-tx}
12+
IONQT=${IONQT:-$BINDIR/qt/ion-qt}
1113

1214
[ ! -x $IOND ] && echo "$IOND not found or not executable." && exit 1
1315

1416
# The autodetected version git tag can screw up manpage output a little bit
15-
BTCVER=($($IONCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))
17+
IONVER=($($IONCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))
1618

1719
# Create a footer file with copyright content.
1820
# This gets autodetected fine for iond if --version-string is not set,
@@ -22,8 +24,8 @@ $IOND --version | sed -n '1!p' >> footer.h2m
2224

2325
for cmd in $IOND $IONCLI $IONTX $IONQT; do
2426
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+
help2man -N --version-string=${IONVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
28+
sed -i "s/\\\-${IONVER[1]}//g" ${MANDIR}/${cmdname}.1
2729
done
2830

2931
rm -f footer.h2m

doc/man/Makefile.am

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dist_man1_MANS=
2+
3+
if BUILD_BITCOIND
4+
dist_man1_MANS+=iond.1
5+
endif
6+
7+
if ENABLE_QT
8+
dist_man1_MANS+=ion-qt.1
9+
endif
10+
11+
if BUILD_BITCOIN_UTILS
12+
dist_man1_MANS+=ion-cli.1 ion-tx.1
13+
endif

doc/man/ion-cli.1

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
2+
.TH ION-CLI "1" "April 2018" "ion-cli v3.0.4.0" "User Commands"
3+
.SH NAME
4+
ion-cli \- manual page for ion-cli v3.0.4.0
5+
.SH DESCRIPTION
6+
Ion Core RPC client version v3.0.4.0\-CEVAP
7+
.SS "Usage:"
8+
.TP
9+
ion\-cli [options] <command> [params]
10+
Send command to Ion Core
11+
.TP
12+
ion\-cli [options] help
13+
List commands
14+
.TP
15+
ion\-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: ioncoin.conf)
26+
.HP
27+
\fB\-datadir=\fR<dir>
28+
.IP
29+
Specify data directory
30+
.HP
31+
\fB\-testnet\fR
32+
.IP
33+
Use the test network
34+
.HP
35+
\fB\-regtest\fR
36+
.IP
37+
Enter regression test mode, which uses a special chain in which blocks
38+
can be solved instantly. This is intended for regression testing tools
39+
and app development.
40+
.HP
41+
\fB\-rpcconnect=\fR<ip>
42+
.IP
43+
Send commands to node running on <ip> (default: 127.0.0.1)
44+
.HP
45+
\fB\-rpcport=\fR<port>
46+
.IP
47+
Connect to JSON\-RPC on <port> (default: 51473 or testnet: 51475)
48+
.HP
49+
\fB\-rpcwait\fR
50+
.IP
51+
Wait for RPC server to start
52+
.HP
53+
\fB\-rpcuser=\fR<user>
54+
.IP
55+
Username for JSON\-RPC connections
56+
.HP
57+
\fB\-rpcpassword=\fR<pw>
58+
.IP
59+
Password for JSON\-RPC connections
60+
.HP
61+
\fB\-rpcclienttimeout=\fR<n>
62+
.IP
63+
Timeout during HTTP requests (default: 900)
64+
.SH COPYRIGHT
65+
Copyright (C) 2009-2018 The Bitcoin Core Developers
66+
67+
Copyright (C) 2014-2018 The Dash Core Developers
68+
69+
Copyright (C) 2015-2018 The PIVX Core Developers
70+
71+
Copyright (C) 2018 The Ion Core Developers
72+
73+
This is experimental software.
74+
75+
Distributed under the MIT software license, see the accompanying file COPYING
76+
or <http://www.opensource.org/licenses/mit-license.php>.
77+
78+
This product includes software developed by the OpenSSL Project for use in the
79+
OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written
80+
by Eric Young and UPnP software written by Thomas Bernard.

0 commit comments

Comments
 (0)