Repository: bitcoin/bitcoin (language: cpp)

Issue:
Build/Docs: -help text references rpcauth script not present in binary release
The help text says "a canonical python script is included in `share/rpcauth`":

    $ bitcoind -help | grep -A3 rpcauth
      -rpcauth=<userpw>
           Username and HMAC-SHA-256 hashed password for JSON-RPC connections. The
           field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A
           canonical python script is included in share/rpcauth. The client
           then connects normally using the
           rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This
           option can be specified multiple times

This is true of the git repository and the source release, but that file is not available in the binary releases:

    $ wget https://bitcoincore.org/bin/bitcoin-core-0.19.1/bitcoin-0.19.1-x86_64-linux-gnu.tar.gz
    $ tar tzf bitcoin-0.19.1-x86_64-linux-gnu.tar.gz | grep -i rpcauth || echo FILE NOT FOUND
    FILE NOT FOUND

IMO, this file should either be included with the binary releases or it should not be mentioned in the help text.  I think this issue needs a decision from experienced contributors about which approach to take, and then can be tagged as a *good first issue* for possible implementation by a less experienced contributor.

Note: this issue is a deliberate duplicate of #14292 (by [request](https://github.com/bitcoin/bitcoin/issues/14292#issuecomment-634733333)).


Discussion / hints:
CC: original reporter of #14292, @bitstein 
bitcoin-core/packaging might want to ship this as well

Fix patch:
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
index 28cad05013527..2795a90036970 100755
--- a/contrib/guix/libexec/build.sh
+++ b/contrib/guix/libexec/build.sh
@@ -369,6 +369,8 @@ mkdir -p "$DISTSRC"
         # has not been run before buildling, this file will be a stub
         cp "${DISTSRC}/share/examples/bitcoin.conf" "${DISTNAME}/"
 
+        cp -r "${DISTSRC}/share/rpcauth" "${DISTNAME}/share/"
+
         # Finally, deterministically produce {non-,}debug binary tarballs ready
         # for release
         case "$HOST" in
diff --git a/share/setup.nsi.in b/share/setup.nsi.in
index a5fb2e06cb811..2ce798bd2d1d3 100644
--- a/share/setup.nsi.in
+++ b/share/setup.nsi.in
@@ -75,6 +75,9 @@ Section -Main SEC0000
     File @abs_top_builddir@/release/@BITCOIN_GUI_NAME@@EXEEXT@
     File /oname=COPYING.txt @abs_top_srcdir@/COPYING
     File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt
+    File @abs_top_srcdir@/share/examples/bitcoin.conf
+    SetOutPath $INSTDIR\share\rpcauth
+    File @abs_top_srcdir@/share/rpcauth/*.*
     SetOutPath $INSTDIR\daemon
     File @abs_top_builddir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@
     File @abs_top_builddir@/release/@BITCOIN_CLI_NAME@@EXEEXT@
@@ -127,6 +130,8 @@ Section /o -un.Main UNSEC0000
     Delete /REBOOTOK $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
     Delete /REBOOTOK $INSTDIR\COPYING.txt
     Delete /REBOOTOK $INSTDIR\readme.txt
+    Delete /REBOOTOK $INSTDIR\bitcoin.conf
+    RMDir /r /REBOOTOK $INSTDIR\share
     RMDir /r /REBOOTOK $INSTDIR\daemon
     DeleteRegValue HKCU "${REGKEY}\Components" Main
 SectionEnd


Test patch: