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