Blame README.md

Packit aea12f
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/330/badge)](https://bestpractices.coreinfrastructure.org/projects/330)
Packit aea12f
Packit Service 991b93
|Branch|CI system|Status|Test suite coverage|Fuzzer coverage|
Packit Service 991b93
|:----:|:-------:|-----:|:------:|:-------------:|
Packit Service 991b93
|Master/3.6.x|Gitlab|[![build status](https://gitlab.com/gnutls/gnutls/badges/master/pipeline.svg)](https://gitlab.com/gnutls/gnutls/commits/master)|[![coverage report](https://gitlab.com/gnutls/gnutls/badges/master/coverage.svg)](https://gnutls.gitlab.io/coverage/master)|[![Fuzzer coverage report](https://gnutls.gitlab.io/coverage/master-fuzz/badge.svg)](https://gnutls.gitlab.io/coverage/master-fuzz)|
Packit Service 991b93
|Master/3.6.x|Travis|[![build status](https://travis-ci.org/gnutls/gnutls.svg?branch=master)](https://travis-ci.org/gnutls/gnutls)|N/A|N/A|
Packit aea12f
Packit aea12f
Packit aea12f
# GnuTLS -- Information for developers
Packit aea12f
Packit aea12f
GnuTLS implements the TLS/SSL (Transport Layer Security aka Secure
Packit aea12f
Sockets Layer) protocol.  Additional information can be found at
Packit aea12f
[www.gnutls.org](https://www.gnutls.org/).
Packit aea12f
Packit aea12f
This file contains instructions for developers and advanced users that
Packit aea12f
want to build from version controlled sources. See [INSTALL.md](INSTALL.md)
Packit aea12f
for building released versions.
Packit aea12f
Packit aea12f
We require several tools to check out and build the software, including:
Packit aea12f
Packit aea12f
* [Make](https://www.gnu.org/software/make/)
Packit aea12f
* [Automake](https://www.gnu.org/software/automake/) (use 1.11.3 or later)
Packit aea12f
* [Autoconf](https://www.gnu.org/software/autoconf/)
Packit aea12f
* [Autogen](https://www.gnu.org/software/autogen/) (use 5.16 or later)
Packit aea12f
* [Libtool](https://www.gnu.org/software/libtool/)
Packit aea12f
* [Gettext](https://www.gnu.org/software/gettext/)
Packit aea12f
* [Texinfo](https://www.gnu.org/software/texinfo/)
Packit aea12f
* [Tar](https://www.gnu.org/software/tar/)
Packit aea12f
* [Gzip](https://www.gnu.org/software/gzip/)
Packit aea12f
* [Texlive & epsf](https://www.tug.org/texlive/) (for PDF manual)
Packit aea12f
* [GTK-DOC](https://www.gtk.org/gtk-doc/) (for API manual)
Packit aea12f
* [Git](https://git-scm.com/)
Packit aea12f
* [Perl](https://www.cpan.org/)
Packit aea12f
* [Nettle](https://www.lysator.liu.se/~nisse/nettle/)
Packit aea12f
* [Guile](https://www.gnu.org/software/guile/)
Packit aea12f
* [p11-kit](https://p11-glue.github.io/p11-glue/p11-kit.html)
Packit aea12f
* [gperf](https://www.gnu.org/software/gperf/)
Packit aea12f
* [libtasn1](https://www.gnu.org/software/libtasn1/) (optional)
Packit aea12f
* [Libidn2](https://www.gnu.org/software/libidn/#libidn2) (optional, for internationalization of DNS, IDNA 2008)
Packit aea12f
* [Libunistring](https://www.gnu.org/software/libunistring/) (optional, for internationalization)
Packit aea12f
* [AWK](https://www.gnu.org/software/awk/) (for make dist, pmccabe2html)
Packit aea12f
* [bison](https://www.gnu.org/software/bison) (for datetime parser in certtool)
Packit aea12f
* [libunbound](https://unbound.net/) (for DANE support)
Packit aea12f
* [libabigail](https://pagure.io/libabigail/) (for abi comparison in make dist)
Packit aea12f
* [tcsd](https://trousers.sourceforge.net/) (for TPM support; optional)
Packit aea12f
* [swtpm](https://github.com/stefanberger/swtpm) (for TPM test; optional)
Packit aea12f
* [ncat](https://nmap.org/download.html) (for TPM test; optional)
Packit aea12f
* [tpm-tools](https://trousers.sourceforge.net/) (for TPM test; optional)
Packit aea12f
* [expect](https://core.tcl.tk/expect/index) (for TPM test; optional)
Packit aea12f
Packit aea12f
The required software is typically distributed with your operating
Packit aea12f
system, and the instructions for installing them differ.  Here are
Packit aea12f
some hints:
Packit aea12f
Packit aea12f
Debian/Ubuntu:
Packit aea12f
```
Packit aea12f
apt-get install -y dash git-core autoconf libtool gettext autopoint
Packit aea12f
apt-get install -y automake autogen nettle-dev libp11-kit-dev libtspi-dev libunistring-dev
Packit aea12f
apt-get install -y guile-2.2-dev libtasn1-6-dev libidn2-0-dev gawk gperf
Packit aea12f
apt-get install -y libunbound-dev dns-root-data bison gtk-doc-tools
Packit aea12f
apt-get install -y texinfo texlive texlive-generic-recommended texlive-extra-utils
Packit aea12f
```
Packit aea12f
Packit Service 991b93
__NOTE:__ Some software versions might not be available in older releases, e.g. `nettle-dev`. 
Packit Service 991b93
Available backport repos, APT-Pinning or source code compilating can be used to install these versions (and dependencies) from a newer release.
Packit Service 991b93
Packit aea12f
Fedora/RHEL:
Packit aea12f
```
Packit aea12f
yum install -y dash git autoconf libtool gettext-devel automake autogen patch
Packit aea12f
yum install -y nettle-devel p11-kit-devel autogen-libopts-devel libunistring-devel
Packit aea12f
yum install -y trousers-devel guile22-devel libtasn1-devel libidn2-devel gawk gperf
Packit aea12f
yum install -y libtasn1-tools unbound-devel bison gtk-doc texinfo texlive
Packit aea12f
```
Packit aea12f
Packit aea12f
Sometimes, you may need to install more recent versions of Automake,
Packit aea12f
Nettle, P11-kit and Autogen, which you will need to build from sources. 
Packit aea12f
Packit aea12f
Dependencies that are used during make check or make dist are listed below.
Packit aea12f
Moreover, for basic interoperability testing you may want to install openssl
Packit aea12f
and mbedtls.
Packit aea12f
Packit aea12f
* [Valgrind](https://valgrind.org/) (optional)
Packit aea12f
* [Libasan](https://gcc.gnu.org//) (optional)
Packit aea12f
* [datefudge](https://packages.debian.org/datefudge) (optional)
Packit aea12f
* [nodejs](https://nodejs.org/) (needed for certain test cases)
Packit aea12f
* [softhsm](https://www.opendnssec.org/softhsm/) (for testing smart card support)
Packit aea12f
* [dieharder](https://www.phy.duke.edu/~rgb/General/dieharder.php) (for testing PRNG)
Packit aea12f
* [lcov](https://linux-test-project.github.io/) (for code coverage)
Packit Service 991b93
* [util-linux](https://github.com/karelzak/util-linux) or just [lscpu](https://github.com/NanXiao/lscpu) (for CPU feature detection)
Packit Service 991b93
* [libev](hhttp://software.schmorp.de/pkg/libev.html) (for testing)
Packit aea12f
Packit aea12f
Debian/Ubuntu:
Packit aea12f
```
Packit Service 991b93
apt-get install -y valgrind nodejs softhsm2 datefudge lcov libssl-dev libcmocka-dev expect libev-dev
Packit Service 991b93
apt-get install -y dieharder openssl abigail-tools socat net-tools ppp lockfile-progs util-linux
Packit Service 991b93
```
Packit Service 991b93
Packit Service 991b93
__NOTE:__ `libubsan0` and `libasan1` are required on older versions of Ubuntu <= 16.04. This packages must be manually added on these versions:
Packit Service 991b93
Packit Service 991b93
```
Packit Service 991b93
apt-get install -y v libubsan0 libasan1
Packit aea12f
```
Packit aea12f
Packit aea12f
Fedora/RHEL:
Packit aea12f
```
Packit Service 991b93
yum install -y valgrind libasan libasan-static libubsan nodejs softhsm datefudge lcov openssl-devel expect libev-devel
Packit Service 991b93
yum install -y dieharder mbedtls-utils openssl libabigail libcmocka-devel socat lockfile-progs util-linux
Packit aea12f
```
Packit aea12f
Packit aea12f
Packit aea12f
To download the version controlled sources:
Packit aea12f
Packit aea12f
```
Packit aea12f
$ git clone https://gitlab.com/gnutls/gnutls.git
Packit aea12f
$ cd gnutls
Packit aea12f
```
Packit aea12f
Packit aea12f
The next step is to bootstrap and ./configure:
Packit aea12f
Packit aea12f
```
Packit aea12f
$ ./bootstrap
Packit aea12f
$ ./configure
Packit aea12f
```
Packit aea12f
Packit aea12f
When built this way, some developer defaults will be enabled.  See
Packit aea12f
cfg.mk for details.
Packit aea12f
Packit aea12f
Then build the project normally, and run the test suite.
Packit aea12f
Packit aea12f
```
Packit aea12f
$ make
Packit aea12f
$ make check
Packit aea12f
```
Packit aea12f
Packit aea12f
To test the code coverage of the test suite use the following:
Packit aea12f
```
Packit aea12f
$ ./configure --enable-code-coverage
Packit aea12f
$ make && make check && make code-coverage-capture
Packit aea12f
```
Packit aea12f
Packit aea12f
Individual tests that may require additional hardware (e.g., smart cards)
Packit aea12f
are:
Packit aea12f
```
Packit aea12f
$ sh tests/suite/testpkcs11
Packit aea12f
```
Packit aea12f
Packit aea12f
# Building for windows
Packit aea12f
Packit aea12f
It is recommended to cross compile using Fedora and the following
Packit aea12f
dependencies:
Packit aea12f
Packit aea12f
```
Packit aea12f
yum install -y wine mingw32-nettle mingw32-libtasn1 mingw32-gcc
Packit aea12f
```
Packit aea12f
Packit aea12f
and build as:
Packit aea12f
Packit aea12f
```
Packit aea12f
mingw32-configure --enable-local-libopts --disable-non-suiteb-curves --disable-doc --without-p11-kit
Packit aea12f
mingw32-make
Packit aea12f
mingw32-make check
Packit aea12f
```
Packit aea12f
Packit aea12f
# Continuous Integration (CI)
Packit aea12f
Packit aea12f
We utilize two continuous integration systems, the gitlab-ci and travis.
Packit aea12f
Gitlab-CI is used to test most of the Linux systems (see .gitlab-ci.yml),
Packit aea12f
and is split in two phases, build image creation and compilation/test. The
Packit aea12f
build image creation is done at the gnutls/build-images subproject and
Packit aea12f
uploads the image at the gitlab.com container registry. The compilation/test
Packit aea12f
phase is on every commit to gnutls project.
Packit aea12f
Packit aea12f
The Travis based CI, is used to test compilation on MacOSX based systems.
Packit aea12f
Packit aea12f
Packit aea12f
# Contributing
Packit aea12f
Packit aea12f
See [the contributing document](CONTRIBUTING.md).
Packit aea12f
Packit aea12f
Packit aea12f
Happy hacking!
Packit aea12f
Packit aea12f
----------------------------------------------------------------------
Packit aea12f
Copying and distribution of this file, with or without modification,
Packit aea12f
are permitted in any medium without royalty provided the copyright
Packit aea12f
notice and this notice are preserved.