1. Setup

1.1. Setup from repository

1.1.1. Initial checkout from git repository
Go to a empty directory and run command:
  git clone https://gitlab.com/e_nss/e_nss.git
Enter into local source repository
  cd e_nss
and bootstrap with autotoools:
  libtoolize --force --copy
  aclocal --force
  autoheader --force
  autoconf --force
  automake --foreign --force-missing --add-missing  --copy

Note the project require libtool 2.x version and autoconf at least 2.62 version.

1.2. Source tarbal
Visit download page at
  https://roumenpetrov.info.localhost/e_nss/download.html
and choose source package and download
Uncompress package:
  bunzip2 e_nns-XXX.tar.bz2 or
  gunzip e_nss-XXX.tar.gz
and then unpack sources:
  tar xvf e_nss-XXX.tar


2. Check available options
Go to source directory created by prevoius step and run command:
  ./configure --help


3. Build and install

3.1. classic
  CPPFLAGS=-I<path_to_nss_headers> \
  LDFLAGS=-L<path_to_nss_libraries> \
  <path_to_soure_tree>/configure \
    --prefix=/usr \
    --with-enginesdir=....\
  make
  make install (as root !)

Note if build is with OpenSSL version 1.1+ you could use configure
option --with-sharedname=e_nss if you like to use name "e_nss" as
name of engine at openssl command line or in programm source.

3.2. rpm
See spec-files in contrib directory tree.


4. User configuration

4.1. Sample OpenSSL engine configuration file
=======================================================================
#[ default ]
openssl_conf = config

[ config ]
engines = engine_section

[ engine_section ]
engine = engine_conf

[ engine_conf ]
engine_id = e_nss
# or use self registration, for instance:
#dynamic_path = ${ENV::OPENSSL_ENGINES}/libe_nss.so
#dynamic_path = /usr/lib/engines/libe_nss.so

#init = 1
#DEBUG = 3
## Note set CONFIG_DIR to Mozilla "User Profile" directory
#CONFIG_DIR = ${ENV::HOME}/.mozilla/<APP>/<USERHASH>.default
=======================================================================

Note that OpenSSL versions before 1.1 use shared library name in format
lib<NAME><shared_suffix>. Version 1.1 is first that remove "lib" prefix.

4.2. Test user configuration
  OPENSSL_CONF=<path_to_openssl_configuration_file> \
  openssl engine -t -post CONFIG_DIR:"<path_to_mozilla_profile_directory>" -post LIST_CERTS e_nss
