# git clone the repository
git clone https://github.com/farsightsec/nmsg

# install required dependent packages.
sudo apt-get install libpcap0.8-dev
sudo apt-get install libprotobuf-c0-dev protobuf-c-compiler
sudo apt-get install zlib1g-dev
sudo apt-get install pkg-config

# Add quantal universe packages to /etc/apt/sources.list.d/quantal_universe.list
# Set the default os version to precise:
echo ‘APT::Default-Release “precise”;’ > /etc/apt/apt.conf.d/00release

# run an update to pull down the package files.
apt-get update

# install libxs-dev
sudo apt-get install libxs-dev

# get libwdns
git clone https://github.com/farsightsec/wdns
cd wdns
sh ./autogen.sh
./configure
make
sudo make install

# Configure/make nmsg
run autogen.sh:
sh ./autogen.sh
./configure
make
sudo make install

# git clone the pynmsg repository
git clone https://github.com/farsightsec/pynmsg

# install cython from apt: (and python-dev)
sudo apt-get install cython python-dev

# Now, install the nmsg python bindings.
sudo ./setup.py install

# git clone the sie-nmsg modules for install
git clone https://github.com/farsightsec/sie-nmsg
sh ./autogen.sh
./configure
Replace @PROTOC_C@ in Makefile with /usr/bin/protoc-c

# Finally, mess around with LD_LIBRARY_PATH.. why? :(
TODO(morrowc): Fix ld-library-path problems in a way that’s not /etc/profile.
echo “export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib” | sudo tee -a /etc/profile

NOTE: This is probably not the best option for install, apparently you could also go the PPA route with:
https://archive.farsightsecurity.com/SIE_Software_Installation_Debian/

# Cripple the ID reported in nmsg, due to:
###################################################
## START python error message #####################
File “/usr/local/scripts/nmsg_fifo.py”, line 165, in run
email_nmsg.source = SPAMMER_ID
File “nmsg_message.pyx”, line 9, in _nmsg.message.source.__set__ (_nmsg.c:5729)
OverflowError: Python int too large to convert to C long

## END python error message #######################
###################################################