Browse code

Fix ubuntu packaging to build from a clean checkout of the correct git tag

Solomon Hykes authored on 2013/04/20 04:39:40
Showing 1 changed files
... ...
@@ -14,6 +14,7 @@ GITHUB_PATH=github.com/dotcloud/docker
14 14
 DOCKER_VERSION=${PKG_NAME}_${VERSION}
15 15
 DOCKER_FVERSION=${PKG_NAME}_$(shell head -1 changelog | sed 's/^.\+(\(.\+\)).\+$$/\1/')
16 16
 BUILD_SRC=${CURDIR}/../../build_src
17
+VERSION_TAG=v$(shell head -1 changelog | sed 's/^.\+(\(.\+\)-[0-9]\+).\+$$/\1/')
17 18
 
18 19
 all:
19 20
 	# Compile docker. Used by dpkg-buildpackage.
... ...
@@ -33,7 +34,8 @@ ubuntu:
33 33
 	# This Makefile will compile the github master branch of dotcloud/docker
34 34
 	# Retrieve docker project and its go structure from internet
35 35
 	rm -rf ${BUILD_SRC}
36
-	GOPATH=${BUILD_SRC} go get ${GITHUB_PATH}
36
+	git clone $(shell git rev-parse --show-toplevel) ${BUILD_SRC}/${GITHUB_PATH}
37
+	cd ${BUILD_SRC}/${GITHUB_PATH}; git checkout ${VERSION_TAG} && GOPATH=${BUILD_SRC} go get -d
37 38
 	# Add debianization
38 39
 	mkdir ${BUILD_SRC}/debian
39 40
 	cp Makefile ${BUILD_SRC}