Skip to content

Installation from Source on MacOS X 10.x

Carsten Strotmann edited this page May 14, 2014 · 1 revision

these instructions needs to be confirmed for MacOS X 10.9.

Notes by JINMEI, Tatuya, edited for Bundy by Carsten

This system notes describe a process to build Bundy on MacOS X 10.8 (Mountain Lion). I'll first describe the process for "normal" users who only need to install and use a release version of Bundy; for developers who need to build (and possibly modify) a development version, I'll add specific process and notes at the end of this memo.

Install necessary tools.

Unless this is your first time to build an application on OS X by hand, it's quite likely that you've already done (something like) this process. But I'm briefly summarizing this phase just in case.

Bundy depends on several external packages, and you'll need to install a packaging system for OS X in addition to Xcode. I've been using HomeBrew for quite some time, and this page assumes HomeBrew as the packaging system. I used to use MacPorts to build Bundy (or BIND 10) on earlier versions of OS X. It may still work today.

Install Xcode Command Line Tools. The specific procedure may differ based on the version of Xcode available at the time of your installation. In my case (version 4.6; 4.5.2 is believed to work too), I installed Xcode from App Store (it's free), invoke it, and install Command Line Tools from its "Downloads" preference panel. (Make sure you have write permission on and under /usr/local; Otherwise there will be various troubles with HomeBrew)

Install HomeBrew as shown in its top web page:

% ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Install necessary dependencies.

All of the required dependencies are available in HomeBrew packages, so their installation is theoretically easy; there are some tricky parts, though. Still, this is basically a copy-and-paste-and-run process:

% brew install python3
% brew install boost
% brew install botan
% brew install log4cplus

Notes:

Same notes as those listed in the previous section (except the one specific to the Bundy formula) also apply here.

You don't have to install sqlite: it's installed as a side effect of installing python3.

Download, build, and install Bundy.

This is a complete process to download and build Bundy. I believe it works for most of the recently released snapshot versions (and hopefully for future released versions):

% wget https://github.com/bundy-dns/bundy/archive/master.zip
% unzip master.zip
% cd bundy
% ./configure --prefix=/opt/bundy
% make
% sudo make install

The installation prefix doesn't have to be /opt/bundy; it's just an example. Also, depending on where to install it and whether you have write permission in the install destination, you may or may not need sudo at the final step.

Like the dependency installation phase, there are a couple of tricky points (you don't have to read this unless you want to know why we need to do some unusual setup in the above example):

HomeBrew does not install sqlite3 in publicly visible directories because Mountain Lion has its own sqlite (this is a basic policy of HomeBrew). So we need to specify some environment variables to tell the ./configure script where to search for sqlite header files and libraries.

Run Bundy!

Congratulations, you are now ready to run Bundy!

Run the Bundy system in one console:

% sudo /opt/bundy/sbin/bundy

(Note: if you are here directly from Section 1, the path to bundy should be /usr/local/sbin/bundy)

Next, create an account for bundyctl:

% cd /opt/bundy/etc/bundy
% sudo /opt/bundy/sbin/b10-cmdctl-usermgr
% sudo chmod 600 cmdctl-accounts.csv

(or /usr/local/sbin/b10-cmdctl-usermgr if you are here directly from Section 1).

And start configuring it from the other console:

% /opt/bundy/bin/bundyctl

(or /usr/local/bin/bundyctl if you are here directly from Section 1).

For Developers

Build/Install dependencies for developers

To build Bundy on a cloned git repository, you'll need some other external packages. They can be installed via HomeBrew:

% brew install automake
% brew install libtool

In addition, as a developer you'd also need to make googletest available. This is not absolutely necessary if you only need to build Bundy, but for serious development it's crucial. It cannot be "installed" via HomeBrew anymore; you need to fetch a source archive and extract it by hand:

% curl -o gtest-1.6.0.zip  http://googletest.googlecode.com/files/gtest-1.6.0.zip
% unzip gtest-1.6.0.zip

Where to extract it doesn't matter. For specific examples below, we assume it's extracted under /opt/src. Note also that there is no need to build it (i.e., no need to do ./configure or make); just extracting the archive is sufficient.

Finally, to run system (integration) tests you may also want to install lettuce. It's a Python application running on Python 2 (available on Mountain Lion by default) and can be installed as follows:

% sudo easy_install pip
% sudo pip install lettuce

Clone Bundy git repository and build it

The following are a common process for getting and building the latest development version of Bundy, enabling all unit tests.

% git clone https://github.com/bundy-dns/bundy.git
% cd bundy
% autoreconf -i
% SQLITE_CFLAGS=-I/usr/local/opt/sqlite/include SQLITE_LIBS='-L/usr/local/opt/sqlite/lib -lsqlite3' ./configure --prefix=/opt/bundy --with-gtest-source=/opt/src/gtest/gtest-1.6.0
% make

Of course, once you clone the repository the first step can be replaced with git pull under the bundy directory. Specifying the --with-gtest-source is the only difference for the ./configure script than the example for building the release version shown above.

Run tests

When build is completed, you can run unit tests as follows:

% make check

Note: as of this writing, some of Python unit tests fail due to the use of Python 3.3. There are bug tickets about this, and hopefully they'll be fixed soon.

You can also run lettuce systems tests as follows:

% cd tests/lettuce
% ./run_lettuce.sh

and run Bundy in the source tree (i.e., without installing it, which is useful for developers):

% cd src/bin/bundy
% ./run_bundy.sh