Installation
************

Possibly NNCP package already exists for your distribution:

   * Arch Linux AUR (https://aur.archlinux.org/packages/nncp)

   * Debian packages (https://tracker.debian.org/pkg/nncp)

   * Docker image (https://hub.docker.com/r/jgoerzen/nncp)

   * DragonFly BSD ports
     (https://github.com/DragonFlyBSD/DPorts/tree/master/net/nncp)

   * FreeBSD ports (https://www.freshports.org/net/nncp/)

   * GNU Guix (https://packages.guix.gnu.org/packages/nncp/)

   * Linux Mint (https://community.linuxmint.com/software/view/nncp)

   * NetBSD package (https://pkgsrc.se/wip/nncp)

   * NixOS packages
     (https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/nn/nncp)

   * Ubuntu (https://packages.ubuntu.com/search?keywords=nncp)

   * Void Linux
     (https://github.com/void-linux/void-packages/blob/master/srcpkgs/nncp/template)

   NNCP should run on any POSIX-compatible operating system.

   NNCP is written in Go (https://go.dev/) programming language and you
have to install Go compiler 1.22+ version.  redo
(http://cr.yp.to/redo.html) build system is recommended for convenience.
Texinfo (https://www.gnu.org/software/texinfo/) is used for building
documentation (although tarballs already include it).

   In general you must get *note the tarball: Tarballs, check its *note
integrity and authenticity: Integrity. and run 'redo'.  Look for general
and platform-specific *note build instructions: Build-instructions.

Prepared tarballs
=================

You can obtain releases source code prepared tarballs from
<http://www.nncpgo.org/> and from one of its mirrors
(http://www.nncpgo.org/Mirrors.html).

Tarballs integrity check
========================

You *have to* verify downloaded tarballs authenticity to be sure that
you retrieved trusted and untampered software.  There are two options:

OpenPGP (https://www.openpgp.org/) '.asc' signature
     Use GNU Privacy Guard (https://www.gnupg.org/) free software
     implementation.  For the very first time it is necessary to get
     signing public key and import it.  It is provided here
     (.well-known/openpgpkey/nncpgo.org/hu/i4cdqgcarfjdjnba6y4jnf498asg8c6p.asc),
     but you should check alternate resources.

     pub   rsa2048/0x2B25868E75A1A953 2017-01-10
           92C2 F0AE FE73 208E 46BF  F3DE 2B25 868E 75A1 A953
     uid   NNCP releases <releases at nncpgo dot org>

          $ gpg --auto-key-locate dane --locate-keys releases at nncpgo dot org
          $ gpg --auto-key-locate  wkd --locate-keys releases at nncpgo dot org

OpenSSH (https://www.openssh.com/) '.sig' signature
     Public key (PUBKEY-SSH.pub) and its OpenPGP signature
     (PUBKEY-SSH.pub.asc) made with the key above.  Its fingerprint:
     'SHA256:FRiWawVNBkyS3jFn8uZ/JlT+PWKSFbhWe5XSixp1+SY'.

          $ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I releases@nncpgo.org -n file \
              -s nncp-8.12.1.tar.zst.sig <nncp-8.12.1.tar.zst

Build instructions
==================

Make sure that Go 1.22+ is installed.  Go can be installed from packages
or build manually (https://go.dev/doc/install/source):

FreeBSD
     pkg install go
Debian, Ubuntu
     apt install golang

     $ [fetch|wget] http://www.nncpgo.org/download/nncp-8.12.1.tar.xz
     $ [fetch|wget] http://www.nncpgo.org/download/nncp-8.12.1.tar.xz.{asc,sig}
     [verify signature]
     $ xz -d <nncp-8.12.1.tar.xz | tar xf -
     $ cd nncp-8.12.1
     [optionally edit config]
     $ ./build

   After that you should get various 'bin/nncp-*' binaries and
'bin/hjson-cli' command (only for your convenience, not necessary
installation).  For example, documentation for 'nncp-bundle' command can
be get with 'info doc/nncp.info -n nncp-bundle'.

   'config' file contains some environment variables that are respected
during installation: '$PREFIX', '$DESTDIR', '$GO', '$MAKEINFO',
'$PLANTUML', '$PREFIX', '$SENDMAIL', '$CFGPATH', '$SPOOLPATH',
'$LOGPATH', '$BINDIR', '$INFODIR', '$DOCDIR'.

   There is 'install' script for binaries and info-documentation
installation:

     # PREFIX=/usr/local ./install

   NNCP depends on 'github.com/fsnotify/fsnotify' library, that solely
relies on OS-specific mechanisms.  There is possibility that you have
either broken or unsupported ones.  You can still build NNCP with '-tags
nofsnotify' build option, to skip 'fsnotify' library usage at all:

     $ GO_CFLAGS="-tags nofsnotify" ./build

   You can also disable Yggdrasil support with '-tags noyggdrasil'.

Development source code
=======================

Development source code contains the latest version of the code.  It may
be buggy.  It does not contain compiled documentation and dependent
libraries source code.  Because of that, it is recommended for porters
to use *note tarballs: Tarballs. instead.

     $ git clone --branch develop git://git.cypherpunks.su/nncp.git nncp

   You can also use
'anongit@master.git.stargrave.org:cypherpunks.su/nncp.git',
'anongit@slave.git.stargrave.org:cypherpunks.su/nncp.git',
'anongit@master.git.cypherpunks.su:cypherpunks.su/nncp.git',
'anongit@slave.git.cypherpunks.su:cypherpunks.su/nncp.git',
<git://git.stargrave.org/nncp.git>,
<git://y.git.stargrave.org/nncp.git>,
<git://y.git.cypherpunks.su/nncp.git> URLs instead.
