Skip to content

Building a Binary Package

Brian Long edited this page Jan 23, 2018 · 8 revisions

Joy includes a script named build_pkg that uses fpm to build a Joy RPM, deb or MacOS pkg. Only CentOS 7, Debian Stretch (9.1), Ubuntu 16.04 LTS, MacOS Sierra (10.12) and MacOS High Sierra (10.13) have been tested. Follow the FPM installation instructions to install fpm on your build host.

RPM

On CentOS or RHEL 7, run the following command to ensure all your build dependencies are installed:

yum -y install gcc git libcurl libcurl-devel libpcap libpcap-devel make openssl openssl-devel python python2-pip rpm-build ruby rubygems

If you plan to use the default Gzip compression for the JSON output files, run the following as well:

yum -y install zlib zlib-devel

NOTE: bzip2 compression is not yet supported and development is in progress. Use git to checkout the latest Joy code:

git clone https://github.com/cisco/joy.git

Change to the joy subdirectory.

cd joy

Build the RPM using the master branch:

./build_pkg -t rpm

If you want to build Joy from a different branch, checkout that branch and run build_pkg specifying the branch:

git checkout your-branch-name; ./build_pkg -t rpm -r your-branch-name

Deb

On Ubuntu 16.04 LTS, run the following to ensure your build dependencies are installed:

apt-get update; apt-get install gcc git libcurl3 libcurl4-openssl-dev libpcap0.8 libpcap-dev libssl1.0.0 libssl-dev make python python-pip ruby ruby-ffi

On Debian Stretch (9.1), run the following to ensure your build dependencies are installed:

apt-get update; apt-get install gcc git libcurl3 libcurl4-openssl-dev libpcap0.8 libpcap-dev libssl1.0.2 libssl-dev make python python-pip ruby ruby-ffi

The only difference between the two platforms is the libssl1.0.0 vs. libssl1.0.2 package.

Use git to checkout the latest Joy code:

git clone https://github.com/cisco/joy.git

Change to the joy subdirectory.

cd joy

Build the Deb package using the master branch:

./build_pkg -t deb

If you want to build Joy from a different branch, checkout that branch and run build_pkg specifying the branch:

git checkout your-branch-name; ./build_pkg -t deb -r your-branch-name

MacOS Pkg

Before building Joy, you must install the OpenSSL development headers. MacOS includes the OpenSSL library, but depending on how recently you have patched your system, or if you use the Brew or MacPorts package manager, the version may be OpenSSL 0.9.8zh, 1.0.2l, or another. Run the following command to determine what version of OpenSSL you have:

openssl version

Download the appropriate tarball from openssl.org, extract it and prepare the header files.

MacOS Sierra native OpenSSL 0.9.8zh

You need the headers for OpenSSL 0.9.8zh.

curl -o openssl-0.9.8zh.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.8zh.tar.gz

Once you have downloaded the OpenSSL tarball, extract it and run the configuration script.

tar zxf openssl-0.9.8zh.tar.gz
cd openssl-0.9.8zh
./config

MacPorts or Brew OpenSSL 1.0.2l

If you use MacPorts or Brew, you might have a newer OpenSSL version. For example, for OpenSSL 1.0.2l, run the following:

curl -o openssl-1.0.2l.tar.gz https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz

Once you have downloaded the OpenSSL tarball, extract it and run the configuration script.

tar zxf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
./config

Download the Joy source-code and build the MacOS X package specifying the path to the OpenSSL header files:

git clone https://github.com/cisco/joy.git
cd joy
./build_pkg -t osxpkg -s ../openssl-1.0.2l/include/
Clone this wiki locally