Skip to content

Latest commit

 

History

History
191 lines (138 loc) · 6.41 KB

INSTALL.adoc

File metadata and controls

191 lines (138 loc) · 6.41 KB

Requirements

  • Meson, at least version 0.47.0.

  • Ninja, at least version 1.5.

  • yaml-cpp, at least version 0.5.0 Requirement will be removed in ip2unix version 3, since the YAML rule file format is deprecated.

  • C++ compiler supporting C++17 (eg. GNU C++ compiler version 9.0 or Clang version 7 or newer).

  • Python 3, at least version 3.6 is needed for running the integration tests.

Optional dependencies:
  • AsciiDoc or Asciidoctor for generating the manpage. The former is recommended as it generates a better manpage and also provides validation.

  • pytest for running automated tests.

  • systemd-socket-activate helper to run test cases specific to systemd socket activation support.

Cloning the repository

The source code can be fetched via Git using the following command:

$ git clone https://github.com/nixcloud/ip2unix.git

You will get an ip2unix directory inside your current working directory. All of the following steps are to be performed inside this ip2unix directory.

1. Using the Nix package manager

This is the easiest and recommended way to compile it from source and it should work on any distribution.

In order to build the latest version of ip2unix, the following command is needed without the need of cloning the source tree manually:

$ nix build github:nixcloud/ip2unix
Note
You need to have support for Flakes

If that’s not the case you can also ad-hoc-enable it using the following command:

$ nix build --experimental-features 'nix-command flakes' github:nixcloud/ip2unix

This takes care of fetching the dependencies, building and running the test suite. The resulting command can now be found in result/bin/ip2unix.

If you want to add the package to your user environment, you can install it using the command:

$ nix profile install github:nixcloud/ip2unix

2. Debian and derivatives

To install the required dependencies:

$ sudo apt install meson g++ libyaml-cpp-dev pkg-config

If you want to have the manpage:

$ sudo apt install asciidoctor

In case you want to run the test suite, pytest is required:

$ sudo apt install python3-pytest

3. RPM-based distributions

To install the required dependencies:

$ sudo yum install meson gcc-c++ yaml-cpp-devel

If you want to have the manpage:

$ sudo yum install asciidoctor

If you want to run the test suite:

$ sudo yum install python3-pytest

4. Arch Linux and derivatives

To install the required dependencies:

$ sudo pacman -S yaml-cpp meson gcc pkg-config

If you want to have the manpage:

$ sudo pacman -S asciidoctor

In case you want to run the test suite:

$ sudo pacman -S python-pytest

Building

$ meson build

If you want to specify a different compiler executable, eg. g++-9:

$ CXX=g++-9 meson build

Compile:

$ ninja -C build

The executable is then placed in build/ip2unix, so to show the usage:

$ build/ip2unix --help

Installation

To install ip2unix, run the following command:

$ ninja -C build install

By default, this will install ip2unix in /usr/local/bin/ip2unix.

Running tests

$ ninja -C build test