#!/bin/sh
rm -rf coredns
mkdir coredns
export GOPATH=`pwd`/coredns
git clone --depth 1 https://github.com/coredns/coredns $GOPATH/src/github.com/coredns/coredns
#go get -v -d -u github.com/coredns/coredns/...
( cd $GOPATH/src/github.com/coredns/coredns
  go get -v -d
  #make dep-ensure
  #make godeps
)
tar cf - --exclude .git coredns | xz -9 >coredns-`date '+%Y%m%d'`.tar.xz
rm -rf coredns
