From: Sergey Matveev Date: Sat, 9 May 2015 20:49:21 +0000 (+0300) Subject: Move source code to separate directory. Bind dependent libraries to commits X-Git-Tag: 3.2^2~5 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=e0b2dac4d0732860cf41d8ffa4ddbeeb3fa04696;p=govpn.git Move source code to separate directory. Bind dependent libraries to commits Prepare to supply all dependent libraries together with GoVPN source code. Move everything to src subdirectory. Write makefile that will clone necessary repositories with specified commits. Signed-off-by: Sergey Matveev --- diff --git a/makefile b/makefile index e5db1da..9dbdc54 100644 --- a/makefile +++ b/makefile @@ -1,25 +1,23 @@ .PHONY: govpn-client govpn-server govpn-verifier +GOPATH=$(shell pwd) +export GOPATH + LDFLAGS=-X govpn.Version $(shell cat VERSION) all: govpn-client govpn-server govpn-verifier -dependencies: - [ "$(shell uname)" = FreeBSD ] || go get github.com/bigeagle/water - go get golang.org/x/crypto/poly1305 - go get golang.org/x/crypto/salsa20 - go get golang.org/x/crypto/xtea - go get golang.org/x/crypto/pbkdf2 - go get github.com/agl/ed25519 +depends: + $(MAKE) -C src -govpn-client: dependencies +govpn-client: depends go build -ldflags "$(LDFLAGS)" govpn/cmd/govpn-client -govpn-server: dependencies +govpn-server: depends go build -ldflags "$(LDFLAGS)" govpn/cmd/govpn-server -govpn-verifier: dependencies +govpn-verifier: depends go build -ldflags "$(LDFLAGS)" govpn/cmd/govpn-verifier -bench: dependencies - GOMAXPROC=2 go test -bench . +bench: + cd src/govpn ; GOMAXPROC=2 go test -bench . diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..1fb92d9 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,2 @@ +github.com +golang.org diff --git a/cmd/govpn-client/main.go b/src/govpn/cmd/govpn-client/main.go similarity index 100% rename from cmd/govpn-client/main.go rename to src/govpn/cmd/govpn-client/main.go diff --git a/cmd/govpn-server/main.go b/src/govpn/cmd/govpn-server/main.go similarity index 100% rename from cmd/govpn-server/main.go rename to src/govpn/cmd/govpn-server/main.go diff --git a/cmd/govpn-verifier/main.go b/src/govpn/cmd/govpn-verifier/main.go similarity index 100% rename from cmd/govpn-verifier/main.go rename to src/govpn/cmd/govpn-verifier/main.go diff --git a/common.go b/src/govpn/common.go similarity index 100% rename from common.go rename to src/govpn/common.go diff --git a/govpn.go b/src/govpn/govpn.go similarity index 100% rename from govpn.go rename to src/govpn/govpn.go diff --git a/handshake.go b/src/govpn/handshake.go similarity index 100% rename from handshake.go rename to src/govpn/handshake.go diff --git a/identify.go b/src/govpn/identify.go similarity index 100% rename from identify.go rename to src/govpn/identify.go diff --git a/stats.go b/src/govpn/stats.go similarity index 100% rename from stats.go rename to src/govpn/stats.go diff --git a/tap.go b/src/govpn/tap.go similarity index 100% rename from tap.go rename to src/govpn/tap.go diff --git a/tap_freebsd.go b/src/govpn/tap_freebsd.go similarity index 100% rename from tap_freebsd.go rename to src/govpn/tap_freebsd.go diff --git a/tap_linux.go b/src/govpn/tap_linux.go similarity index 100% rename from tap_linux.go rename to src/govpn/tap_linux.go diff --git a/transport.go b/src/govpn/transport.go similarity index 100% rename from transport.go rename to src/govpn/transport.go diff --git a/transport_test.go b/src/govpn/transport_test.go similarity index 100% rename from transport_test.go rename to src/govpn/transport_test.go diff --git a/verifier.go b/src/govpn/verifier.go similarity index 100% rename from verifier.go rename to src/govpn/verifier.go diff --git a/src/makefile b/src/makefile new file mode 100644 index 0000000..452b23f --- /dev/null +++ b/src/makefile @@ -0,0 +1,18 @@ +GIT ?= git + +all: golang.org/x/crypto github.com/agl/ed25519 github.com/bigeagle/water + +github.com/bigeagle/water: + mkdir -p github.com/bigeagle + $(GIT) clone https://github.com/bigeagle/water.git github.com/bigeagle/water + cd github.com/bigeagle/water && $(GIT) checkout --force 36aebfeb35da4f1f6a975726716c6fc563c5c495 + +github.com/agl/ed25519: + mkdir -p github.com/agl + $(GIT) clone https://github.com/agl/ed25519.git github.com/agl/ed25519 + cd github.com/agl/ed25519 && $(GIT) checkout --force d2b94fd789ea21d12fac1a4443dd3a3f79cda72c + +golang.org/x/crypto: + mkdir -p golang.org/x + $(GIT) clone https://go.googlesource.com/crypto golang.org/x/crypto + cd golang.org/x/crypto && $(GIT) checkout --force 24ffb5feb3312a39054178a4b0a4554fc2201248