#!/bin/sh
rm -rf vulcand
mkdir vulcand
GOPATH=`pwd`/vulcand
export GOPATH
( mkdir -p $GOPATH/src/github.com/mailgun
  cd $GOPATH/src/github.com/mailgun
  git clone https://github.com/mailgun/vulcand.git
)
( cd $GOPATH
  go get -v -d ./...
)
rm -f vulcand/src/github.com/vulcand/vulcand/vulcand
rm -f vulcand/src/github.com/mailgun/vulcand/vulcand
tar cvf - --exclude .git vulcand | xz -9 >vulcand-`date '+%Y%m%d'`.tar.xz
rm -rf vulcand
