The author of UDPT used ArchLinux for development, so the documentation assumes you are using ArchLinux. You should be able to get the following instructions to work on most Linux distributions.
..note:: Package names vary between distributions, for example: The SQLite package (with development headers/libs) on ArchLinux is *sqlite*, where on Debian you’ll need *libsqlite3-dev*.
Installing dependencies
-----------------------
In order to build UDPT you will need:
*Required Dependencies:*
* sqlite_ - Provides the storage backend, at the moment SQLite handles the In-Memory database too.
* libevent_ - Provides an asynchronous HTTP API (It can actually do more than that, be we just use it’s HTTP capabilities).
* boost_ - We just use boost-program_options, it provides configuration file parsing and command line parsing.
* cmake_ - Generates Makefiles for various platforms (and configures)
* gcc - C/C++ compiler, you can use clang if you prefer.
* binutils - Linker
*Optional Dependencies:*
* git_ - Get the source code, make changes and contribute!
Okay, now that you have the source code and all the dependencies, you may execute the following::
cd udpt
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
This should leave you with a udpt executable file, and optionally a udpt_tests executable. If any of the above instructions failed, please submit a issue to our `issue tracker`_.
If everything succeeded, head over to :doc:`udpt.conf` and get your tracker running!
Complete working Docker workflow is possible allowing you to start hacking and building without any other requirements or dependencies. All the required libs and build tools are handled by Docker build process.
Using the provided Dockerfile you can build a complete working image with all the required dependencies.
If you're not familiar with Docker, better use Docker Compose to both build and run your source easy and effortlessly.
From the ``docker-compose.yml`` directory, run::
docker-compose up --build
Skip the ``--build`` switch to launch the last built container image without rebuilding again.
The provided ``docker-compose.yml`` file is configured to:
* Expose daemon's ports to host (using port's defaults). API server is only exposed on 127.0.0.1 to the Docker host.
* Mount your host's ``udpt.conf`` from your source tree inside the container at ``/etc/udpt.conf`` (read-only).
* Start with the ``--interactive`` switch to avoid forking to background, as required with Docker.
To run udpt inside a Docker container, you need to:
* Configure logging to ``/dev/stdout`` to send the program's messages to Docker's standard logging.
* Configure API server to listen to 0.0.0.0 inside the container to be able to contact it from your development host, that is from outside the container.
See the ``docker-compose.yml`` to view and tweak the launch parameters.