Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

The Moonshot source code is available from our GIT repository and it all can be built by hand relatively easier, assuming you have all of the prerequisite packages installed. This page has instructions for building the software itself.

Contents

STILL UNDER CONSTRUCTION

This page is still under construction

1. System Preparation

1.1. Requirements

To build all of the Moonshot components, you need various packages installed. To install all of these, see below.

1.1.1. Get the required packages on macOS El Capitan

To get all of the requirements on El Capitan, you will need to install Xcode, the Xcode command-line extensions, and several GNU tools:

  1. Install Xcode from the Mac App Store.

  2. Open a Terminal, then install the Xcode Command Line Tools. You will be prompted with a dialog to install the Command Line Tools after a 130MB download.

    $ xcode-select --install
  3. Install the GNU tools that are required for Moonshot by following the instructions at How to install Autoconf, Automake and related tools on Mac OS X from source?

  4. Install GNU GetText:

    $ curl -O -L http://ftpmirror.gnu.org/gettext/gettext-latest.tar.gz
    $ tar -xzf gettext-latest.tar.gz
    $ cd gettext-*
    $ ./configure
    $ make && sudo install
  5. Install MacPorts by downloading the latest install package from MacPorts.org, then update it:

    $ sudo port -v selfupdate
  6. Install Makedepend from MacPorts:

    $ sudo port install makedepend
  7. Update CPAN and install JSON:

    $ sudo cpan install JSON

2. Download and build the required external dependencies:

 

2.1.1. Boost

  1. Download Boost:

    $ curl -OL https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
  2. Build Boost:

    $ tar -zvf boost_1_64_0.tar.gz
    $ cd boost_1_64_0
    $ ./bootstrap.sh
    $ ./b2
  3. Note down the location at the end of the Boost build. You will need it later in this process. In the below examples, we shall use /Users/admin/Desktop/build/boost_1_64_0

2.1.2. OpenSSL

  1. Create a directory called openssl.
  2. Download the OpenSSL build tree from Apple's OpenSource site. Some scripts that Apple provides will be needed, but we will not build it.

    $ cd openssl && curl -OL https://opensource.apple.com/tarballs/OpenSSL098/OpenSSL098-59.60.1.tar.gz
  3. Download the latest OpenSSL build from the OpenSSL website. We will build this version.

    $ curl -OL https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz
  4. Extract OpenSSL098-59.60.1.tar.gz, copy its 'bin' directory into the openssl directory, then delete the extracted source.
  5. Edit the extract_source.sh script in the bin directory:
    1. Comment out the IDEA removal and patch lines (lines 39-49).
    2. Add the following parameters to each of the three ./Configure lines: no-ssl2 enable-ec_nistp_64_gcc_128
    3. Change the --openssldir parameter to your appropriate directory. We recommend /usr/local/moonshot/bin
    4. Change the --prefix parameter from /usr to /usr/local/moonshot
    5. Comment out the line 'rm -f Makefile'
    6. Find the line 'rm -f x86_64.h i386.h', and insert the following below it: ln -s crypto/idea/idea.h include/openssl/idea.h
  6. From the openssl directory, run the following:

    openssl $ bin/extract_source.sh .
  7. In the src directory, edit the Makefile file:
    1. Add the -DNO_IDEA parameter to the CFLAG line
    2. Add the -DNO_IDEA parameter to the DEPFLAG line
  8. Run the following commands:

    openssl/src $ make depend
    openssl/src $ make
    openssl/src $ sudo make install_sw

2.1.3. Heimdal

Heimdal requires OpenSSL. Once OpenSSL has built successfully, build Heimdal.

  1. Download Heimdal:

    $ curl -OL https://github.com/heimdal/heimdal/releases/download/heimdal-7.3.0/heimdal-7.3.0.tar.gz
  2. Extract Heimdal:

    $ tar -xvf heimdal-7.3.0.tar.gz
     
  3. Build Heimdal:

    $ cd heimdal-7.3.0
    heimdal-7.3.0$ ./autogen.sh
    heimdal-7.3.0$ ./configure.sh --prefix=/usr/local/heimdal --with-openssl=/usr/local/moonshot
    heimdal-7.3.0$ make
    heimdal-7.3.0$ sudo make install

2.1.4. Xerces-C

  1. Download Xerces from the Apache project site:

    $ curl -OL http://www-us.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.4.tar.gz
  2. Extract Xerces:

    $ tar -xzf xerces-c-3.1.4.tar.gz
  3. Build Xerces:

    $ cd xerces-c-3.1.4
    xerces-c-3.1.4$ LDFLAGS=" -Wl,-rpath,/usr/local/moonshot/lib " ./configure --prefix=/usr/local/moonshot --disable-static --enable-netaccessor-socket --enable-transcoder-macosunicodeconverter
    xerces-c-3.1.4$ make
    xerces-c-3.1.4$ sudo make install

2.1.5. XML-Security-C (Santuario)

  1. Download XML-Security from the Apache project site:

    $ curl -OL http://www-us.apache.org/dist/santuario/c-library/xml-security-c-1.7.3.tar.gz
  2. Extract XML-Security:

    $ tar -zxf xml-security-c-1.7.3.tar.gz
  3. Build XML-Security:

    $ cd xml-security-c-1.7.3
    xml-security-c-1.7.3$ LDFLAGS=" -Wl,-rpath,/usr/local/moonshot/lib " ./configure --with-openssl=/usr/local/moonshot --without-xalan \
    --prefix=/usr/local/moonshot --with-xerces=/usr/local/moonshot
    xml-security-c-1.7.3$ make
    xml-security-c-1.7.3$ sudo make install

2.1.6. LibConfuse

  1. Clone the latest Libconfuse repository:

    $ git clone --recursive https://github.com/martinh/libconfuse
  2. Build Libconfuse:

    $ cd libconfuse
    libconfuse$ ./autogen.sh
    libconfuse$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " ./configure --prefix=/usr/local/moonshot
    libconfuse$ make
    libconfuse$ sudo make install

2.1.7. LibEvent

  1. Clone the latest Libevent repository:

    $ git clone --recursive https://github.com/libevent/libevent
  2. Build Libevent:

    $ cd libevent
    libevent$ ./autogen.sh
    libevent$ CFLAGS=" -I/usr/local/moonshot/include " LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " ./configure \
    --prefix=/usr/local/moonshot
    libevent$ make
    libevent$ sudo make install

2.1.8. Log4Shib

Moonshot requires Shibboleth, which in turn requires Log4Shib.

  1. Download Log4Shib:

    $ curl -OL http://shibboleth.net/downloads/log4shib/latest/log4shib-1.0.9.tar.gz
  2. Extract Log4Shib:

    $ tar -zxf log4shib-1.0.9.tar.gz
  3. Build Log4Shib:

    $ cd log4shib-1.0.9
    log4shib-1.0.9$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " ./configure \
    --disable-static --disable-doxygen --prefix=/usr/local/moonshot
    log4shib-1.0.9$ make
    log4shib-1.0.9$ sudo make install

3. Checkout the Moonshot source

The Moonshot source code is all stored in a GIT repository. To fetch it, issue the following command.

$ git clone --recursive git://git.project-moonshot.org/moonshot.git
$ cd moonshot && git checkout master && cd ..

4. Build Moonshot's internal dependencies

The Moonshot repository contains a set of internal dependencies. These need to be built before you can build the Moonshot mechanism itself.

4.1.1. Libradsec

 

Libradsec is used by the Moonshot libraries.

 

  1. Configure the Libradsec build:

    $ cd moonshot/libradsec
    libradsec$ chmod +x autogen.sh
    libradsec$ ./autogen.sh
    libradsec$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " CFLAGS=" -I/usr/local/moonshot/include " ./configure \
    --prefix=/usr/local/moonshot
  2. Edit the Makefile, find the AM_CFLAGS and libradsec_la_CFLAGS lines, remove the -Werror parameter from both. Save the file.
  3. Build Libradsec:

    libradsec$ make
    libradsec$ sudo make install
    libradsec$ cd -

4.1.2. Jansson

 

Jansson is used by the Moonshot libraries.

 

  1. Confgure and build Jansson:

    $ cd moonshot/jansson
    jansson$ libtoolize --force --automake
    jansson$ aclocal -I m4 $ACLOCAL_FLAGS
    jansson$ autoheader
    jansson$ automake --add-missing
    jansson$ autoconf
    jansson$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " CFLAGS=" -I/usr/local/moonshot/include " ./configure \
    --prefix=/usr/local/moonshot --with-sysroot=/usr/local/moonshot
    jansson$ make
    jansson$ sudo make install
    jansson$ cd -

4.1.3. XMLTooling

XMLTooling is used by the Shibboleth libraries required by Moonshot.

  1. Configure and build XMLTooling:

    $ cd moonshot/shibboleth/xmltooling
    xmltooling$ libtoolize --force --automake
    xmltooling$ aclocal -I m4 $ACLOCAL_FLAGS
    xmltooling$ autoheader
    xmltooling$ automake --add-missing
    xmltooling$ autoconf
    xmltooling$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " CFLAGS=" -I/usr/local/moonshot/include " ./configure \
    --with-log4shib=/usr/local/moonshot --prefix=/usr/local/moonshot --with-boost=/Users/admin/Desktop/build/boost_1_64_0 -C --with-openssl=/usr/local/moonshot
    xmltooling$ make
    xmltooling$ sudo make install
    xmltooling$ cd -

4.1.4. OpenSAML

OpenSAML is used by the Shibboleth libraries required by Moonshot.

  1. Configure and built OpenSAML:

    $ cd moonshot/shibboleth/opensaml2
    opensaml2$ libtoolize --force --automake
    opensaml2$ aclocal -I m4 $ACLOCAL_FLAGS
    opensaml2$ autoheader
    opensaml2$ automake --add-missing
    opensaml2$ autoconf
    opensaml2$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " CFLAGS=" -I/usr/local/include " ./configure \
    --with-log4shib=/usr/local/moonshot --prefix=/usr/local/moonshot --with-boost=/Users/admin/Desktop/build/boost_1_64_0 \ 
    --with-openssl=/usr/local/moonshot -C
    opensaml2$ make
    opensaml2$ sudo make install
    opensaml2$ cd saml
    opensaml2$ sudo make install
    opensaml2$ cd ../../../..

4.1.5. XML-Security-C

  1. Download XML-Security from the Apache project site:

    $ curl -OL http://www-us.apache.org/dist/santuario/c-library/xml-security-c-1.7.3.tar.gz
  2. Extract XML-Security:

    $ tar -zxf xml-security-c-1.7.3.tar.gz
  3. Build XML-Security:

    $ cd xml-security-c-1.7.3
    xml-security-c-1.7.3$ LDFLAGS=" -Wl,-rpath,/usr/local/moonshot/lib " ./configure --with-openssl=/usr/local/moonshot --without-xalan \
    --prefix=/usr/local/moonshot --with-xerces=/usr/local/moonshot
    xml-security-c-1.7.3$ make
    xml-security-c-1.7.3$ sudo make install

4.1.6. LibConfuse

  1. Clone the latest Libconfuse repository:

    $ git clone --recursive https://github.com/martinh/libconfuse
  2. Build Libconfuse:

    $ cd libconfuse
    libconfuse$ ./autogen.sh
    libconfuse$ LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " ./configure --prefix=/usr/local/moonshot
    libconfuse$ make
    libconfuse$ sudo make install

4.1.7. LibEvent

  1. Clone the latest Libevent repository:

    $ git clone --recursive https://github.com/libevent/libevent
  2. Build Libevent:

    $ cd libevent
    libevent$ ./autogen.sh
    libevent$ CFLAGS=" -I/usr/local/moonshot/include " LDFLAGS=" -L/usr/local/moonshot/lib -Wl,-rpath,/usr/local/moonshot/lib " ./configure \
    --prefix=/usr/local/moonshot
    libevent$ make
    libevent$ sudo make install

 

 

 

$ cd moonshot && ./builder --prefix=/opt/moonshot

You probably know this, but if you stuck your installation into an unusual location, you may need to do the following (as root) - where, here, /opt/moonshot is the install path you used for the prefix option above:

# echo /opt/moonshot/lib >/etc/ld.so.conf.d/moonshot.conf
# ldconfig

(TODO: document /etc/init.d/ stuff?)

5. Build Moonshot's internal dependencies

To build Moonshot, simply enter the moonshot directory of the git repo that you just checked out, and run the builder script. In the --prefix option, you can specify where the code will be installed to. Note that you will need to build as a user who has permission to install in the target directory, because the builder script installs during the build, instead of doing an install after the build has finished (so you can't build first as an underprivileged user and install as a superuser as you would normally do).

$ cd moonshot && ./builder --prefix=/opt/moonshot

You

 

 

 

 

  • No labels