Skip to content

Commit e95e160

Browse files
MitchellCashckti
authored andcommitted
Add ability to install man pages via make install (ioncoincore#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 2bdb7b9 commit e95e160

File tree

8 files changed

+409
-894
lines changed

8 files changed

+409
-894
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/ion-cli.1

+25-60
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.10.
2-
.TH ION-CLI "1" "June 2019" "ion-cli v5.0.99.0" "User Commands"
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"
33
.SH NAME
4-
ion-cli \- manual page for ion-cli v5.0.99.0
4+
ion-cli \- manual page for ion-cli v3.0.4.0
55
.SH DESCRIPTION
6-
Ion Core RPC client version v5.0.99.0
6+
Ion Core RPC client version v3.0.4.0\-CEVAP
77
.SS "Usage:"
88
.TP
99
ion\-cli [options] <command> [params]
1010
Send command to Ion Core
11-
.IP
12-
ion\-cli [options] \fB\-named\fR <command> [name=value] ... Send command to Ion Core (with named arguments)
13-
ion\-cli [options] help List commands
14-
ion\-cli [options] help <command> Get help for a command
11+
.TP
12+
ion\-cli [options] help
13+
List commands
14+
.TP
15+
ion\-cli [options] help <command>
16+
Get help for a command
1517
.SH OPTIONS
1618
.HP
1719
\-?
@@ -26,41 +28,23 @@ Specify configuration file (default: ioncoin.conf)
2628
.IP
2729
Specify data directory
2830
.HP
29-
\fB\-getinfo\fR
30-
.IP
31-
Get general information from the remote server. Note that unlike
32-
server\-side RPC calls, the results of \fB\-getinfo\fR is the result of
33-
multiple non\-atomic requests. Some entries in the result may
34-
represent results from different states (e.g. wallet balance may
35-
be as of a different block from the chain state reported)
36-
.PP
37-
Chain selection options:
38-
.HP
3931
\fB\-testnet\fR
4032
.IP
41-
Use the test chain
42-
.HP
43-
\fB\-devnet=\fR<name>
44-
.IP
45-
Use devnet chain with provided name
33+
Use the test network
4634
.HP
4735
\fB\-regtest\fR
4836
.IP
4937
Enter regression test mode, which uses a special chain in which blocks
50-
can be solved instantly. This is intended for regression testing
51-
tools and app development.
52-
.HP
53-
\fB\-named\fR
54-
.IP
55-
Pass named instead of positional arguments (default: false)
38+
can be solved instantly. This is intended for regression testing tools
39+
and app development.
5640
.HP
5741
\fB\-rpcconnect=\fR<ip>
5842
.IP
5943
Send commands to node running on <ip> (default: 127.0.0.1)
6044
.HP
6145
\fB\-rpcport=\fR<port>
6246
.IP
63-
Connect to JSON\-RPC on <port> (default: 12705 or testnet: 27171)
47+
Connect to JSON\-RPC on <port> (default: 51473 or testnet: 51475)
6448
.HP
6549
\fB\-rpcwait\fR
6650
.IP
@@ -76,40 +60,21 @@ Password for JSON\-RPC connections
7660
.HP
7761
\fB\-rpcclienttimeout=\fR<n>
7862
.IP
79-
Timeout in seconds during HTTP requests, or 0 for no timeout. (default:
80-
900)
81-
.HP
82-
\fB\-stdinrpcpass\fR
83-
.TP
84-
Read RPC password from standard input as a single line.
85-
When combined
86-
.IP
87-
with \fB\-stdin\fR, the first line from standard input is used for the
88-
RPC password.
89-
.HP
90-
\fB\-stdin\fR
91-
.IP
92-
Read extra arguments from standard input, one per line until EOF/Ctrl\-D
93-
(recommended for sensitive information such as passphrases).
94-
When combined with \fB\-stdinrpcpass\fR, the first line from standard
95-
input is used for the RPC password.
96-
.HP
97-
\fB\-rpcwallet=\fR<walletname>
98-
.IP
99-
Send RPC for non\-default wallet on RPC server (needs to exactly match
100-
corresponding \fB\-wallet\fR option passed to dashd)
63+
Timeout during HTTP requests (default: 900)
10164
.SH COPYRIGHT
102-
Copyright (C) 2014-2020 The Dash Core developers
103-
Copyright (C) 2009-2020 The Bitcoin Core developers
65+
Copyright (C) 2009-2018 The Bitcoin Core Developers
66+
67+
Copyright (C) 2014-2018 The Dash Core Developers
10468

105-
Please contribute if you find Ion Core useful. Visit <https://ionomy.com> for
106-
further information about the software.
107-
The source code is available from <https://bitbucket.org/ioncoin/ion>.
69+
Copyright (C) 2015-2018 The PIVX Core Developers
70+
71+
Copyright (C) 2018 The Ion Core Developers
10872

10973
This is experimental software.
74+
11075
Distributed under the MIT software license, see the accompanying file COPYING
111-
or <https://opensource.org/licenses/MIT>
76+
or <http://www.opensource.org/licenses/mit-license.php>.
11277

11378
This product includes software developed by the OpenSSL Project for use in the
114-
OpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by
115-
Eric Young and UPnP software written by Thomas Bernard.
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)