#!/bin/sh -x
rm -rf node_modules
npm install statsd
npm install git://github.com/markkimsal/statsd-elasticsearch-backend.git
npm install statsd-influxdb-backend
npm install statsd-amqp-backend
rm -rf node_modules/statsd/node_modules/hashring/build/Release
rm -rf node_modules/statsd/node_modules/node-syslog/build/Release
version=`grep '"version":' node_modules/statsd/package.json  | sed -e 's;.*: ";;' -e 's;".*;;'`
date=`date '+%Y%m%d'`
tar cvf - node_modules | gzip -9 >statsd-$version-$date.tar.gz
rm -rf node_modules
