-
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.
-
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.
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.
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
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
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
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
$ 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
To install ip2unix, run the following command:
$ ninja -C build install
By default, this will install ip2unix in /usr/local/bin/ip2unix
.
$ ninja -C build test