Skip to content

Latest commit

 

History

History
116 lines (94 loc) · 4.93 KB

installation.org

File metadata and controls

116 lines (94 loc) · 4.93 KB

installation

1 Kazoo Installation Guide

This is a guide to building Kazoo from source on a Debian 8 (Jessie) base installation. Other GNU/Linux distros should work similarly, though the dependencies may differ a bit. If you want to just install and use Kazoo (and not build it) try using the installation instructions. The rest of this guide assumes you want to run a development environment for Kazoo.

1.1 Dependencies

1.1.1 Packages Required

sudo apt-get install build-essential libxslt-dev \
     zip unzip expat zlib1g-dev libssl-dev curl \
     libncurses5-dev git-core libexpat1-dev \
     htmldoc

Note: htmldoc is required only if you want to be able to download PDFs.

1.1.1.1 Docs-related

When running make docs, some Python libraries are useful:

sudo apt-get install python2.7 python-yaml
sudo pip install mkdocs mkdocs-bootstrap mkdocs-bootswatch pymdown-extensions

You can also run a local version of the docs with make docs-serve which will start a local server so you can view how the docs are rendered.

If you have a custom theme, you can copy it to doc/mkdocs/theme and build the docs again. When you serve the docs the theme should have been applied to the site.

1.1.2 Erlang

Kazoo 4 targets Erlang 18+. There are a couple ways to install Erlang:

1.1.2.1 From Source

I prefer to use a tool like kerl to manage my installations. If you want to play around with multiple versions of Erlang while hacking on Kazoo, this is probably the best way.

curl -O https://raw.githubusercontent.com/yrashk/kerl/master/kerl
chmod a+x kerl
mv kerl /usr/bin
kerl list releases
kerl build 18.2 r18.2 # this takes a while
kerl install r18.2 /usr/local/erlang
. /usr/local/erlang/activate

1.1.2.2 Erlang Solutions

Install from the Erlang Solutions packages. These tend to be kept up-to-date better than the default distro’s packages.

1.2 Building Kazoo

1.2.1 Short version

cd /opt
git clone https://github.com/2600Hz/kazoo.git
cd kazoo
make

1.2.2 Longer version

1.2.2.1 Clone the Kazoo repo:

git clone https://github.com/2600Hz/kazoo.git

1.2.2.2 Build Kazoo:

cd kazoo
make

1.2.2.3 Additional make targets

When developing, one can cd into any app directory (within applications/ or core/) and run:

  • make (make all or make clean)
  • make xref to look for calls to undefined functions (uses Xref)
  • make dialyze to statically type-check the app (uses Dialyzer)
  • make test runs the app / sub-apps test suite, if any.
    • Note: make sure to make clean all after running your tests, as test BEAMs are generated in ebin/!

1.2.2.4 Running the tests

To run the full test suite it is advised to:

  1. cd into the root of the project
  2. make compile-test to compile every app with the TEST macro defined
    • This way apps can call code from other apps in a kind of =TEST= mode
  3. make eunit (instead of make test) to run the test suite without recompiling each app
  4. make proper to run the test suite, including property-based tests (uses PropEr)

1.2.2.5 Generate an Erlang release

make build-release will generate a deployable release

1.3 SUP

The SUP command (sup) is found under core/sup/priv/sup and should be copied or symlinked to /usr/bin/sup (or somewhere in your $PATH). It is a shell file that calls sup.escript.

sudo ln -s core/sup/priv/sup /usr/bin/sup

Make sure that the path to Kazoo’s intallation directory is right (in /usr/bin/sup). Otherwise you can change it by setting the KAZOO_ROOT environment variable (not set by default). If one needs KAZOO_ROOT, an alias should be created:

alias sup='KAZOO_ROOT=/opt/kazoo sup'

1.3.0.1 Auto-completion

make sup_completion creates sup.bash: a Bash completion file for the SUP command

  • Copy or symlink this file to /etc/bash_completion.d/sup.bash