#!/bin/sh
rm -rf websocketd
export GOPATH=`pwd`/websocketd
mkdir -p $GOPATH/src/github.com/joewalnes
git clone https://github.com/joewalnes/websocketd.git $GOPATH/src/github.com/joewalnes/websocketd
sed -i -e 's;code.google.com/p/go.net/websocket;golang.org/x/net/websocket;g' \
    $GOPATH/src/github.com/joewalnes/websocketd/libwebsocketd/http.go \
    $GOPATH/src/github.com/joewalnes/websocketd/libwebsocketd/http_test.go \
    $GOPATH/src/github.com/joewalnes/websocketd/libwebsocketd/handler.go
go get -v -d github.com/joewalnes/websocketd
tar cf - --exclude .git --exclude .hg --exclude .svn websocketd | xz -9 >websocketd-`date '+%Y%m%d'`.tar.xz
rm -rf websocketd
