From 15b85d9d762106e03657ecde183303f6535ad90e Mon Sep 17 00:00:00 2001
From: Daniel Mizyrycki <daniel@dotcloud.com>
Date: Fri, 3 May 2013 15:03:01 -0700
Subject: [PATCH] packaging ubuntu; issue #510: Use goland-stable PPA package
 to build docker

---
 packaging/ubuntu/Vagrantfile | 11 +++++++----
 packaging/ubuntu/changelog   | 24 ++++++++++++------------
 packaging/ubuntu/control     |  2 +-
 3 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/packaging/ubuntu/Vagrantfile b/packaging/ubuntu/Vagrantfile
index 0689eea1c2..0636b01b1e 100644
--- a/packaging/ubuntu/Vagrantfile
+++ b/packaging/ubuntu/Vagrantfile
@@ -1,12 +1,15 @@
-BUILDBOT_IP = '192.168.33.32'
+GOPHERS_KEY = "308C15A29AD198E9"
 
 Vagrant::Config.run do |config|
   config.vm.box = 'precise64'
   config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
   config.vm.share_folder 'v-data', '/data/docker', "#{File.dirname(__FILE__)}/../.."
-  config.vm.network :hostonly,BUILDBOT_IP
 
+  # Add docker PPA key to the local repository and install docker
+  pkg_cmd = "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys #{GOPHERS_KEY}; " \
+    "echo 'deb http://ppa.launchpad.net/gophers/go/ubuntu precise main' >/etc/apt/sources.list.d/gophers-go.list; " \
   # Install ubuntu packaging dependencies and create ubuntu packages
-  config.vm.provision :shell, :inline => 'export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -qq -y git debhelper autotools-dev devscripts golang'
-  config.vm.provision :shell, :inline => "export GPG_KEY='#{ENV['GPG_KEY']}'; cd /data/docker/packaging/ubuntu; make ubuntu"
+  pkg_cmd << "export DEBIAN_FRONTEND=noninteractive; apt-get -qq update; apt-get install -qq -y git debhelper autotools-dev devscripts golang-stable; " \
+    "export GPG_KEY='#{ENV['GPG_KEY']}'; cd /data/docker/packaging/ubuntu; make ubuntu"
+  config.vm.provision :shell, :inline => pkg_cmd
 end
diff --git a/packaging/ubuntu/changelog b/packaging/ubuntu/changelog
index d8cd9f0e5a..b3e68558ff 100644
--- a/packaging/ubuntu/changelog
+++ b/packaging/ubuntu/changelog
@@ -1,21 +1,21 @@
 lxc-docker (0.3.0-1) precise; urgency=low
- - Registry: Implement the new registry
- - Documentation: new example: sharing data between 2 couchdb databases
- - Runtime: Fix the command existance check
- - Runtime: strings.Split may return an empty string on no match
- - Runtime: Fix an index out of range crash if cgroup memory is not
- - Documentation: Various improvments
- - Vagrant: Use only one deb line in /etc/apt
+  - Registry: Implement the new registry
+  - Documentation: new example: sharing data between 2 couchdb databases
+  - Runtime: Fix the command existance check
+  - Runtime: strings.Split may return an empty string on no match
+  - Runtime: Fix an index out of range crash if cgroup memory is not
+  - Documentation: Various improvments
+  - Vagrant: Use only one deb line in /etc/apt
 
  -- dotCloud <ops@dotcloud.com>  Fri, 5 May 2013 00:00:00 -0700
 
 
 lxc-docker (0.2.2-1) precise; urgency=low
- - Support for data volumes ('docker run -v=PATH')
- - Share data volumes between containers ('docker run -volumes-from')
- - Improved documentation
- - Upgrade to Go 1.0.3
- - Various upgrades to the dev environment for contributors
+  - Support for data volumes ('docker run -v=PATH')
+  - Share data volumes between containers ('docker run -volumes-from')
+  - Improved documentation
+  - Upgrade to Go 1.0.3
+  - Various upgrades to the dev environment for contributors
 
  -- dotCloud <ops@dotcloud.com>  Fri, 3 May 2013 00:00:00 -0700
 
diff --git a/packaging/ubuntu/control b/packaging/ubuntu/control
index c52303a88b..b0560ebf70 100644
--- a/packaging/ubuntu/control
+++ b/packaging/ubuntu/control
@@ -2,7 +2,7 @@ Source: lxc-docker
 Section: misc
 Priority: extra
 Maintainer: Daniel Mizyrycki <daniel@dotcloud.com>
-Build-Depends: debhelper,autotools-dev,devscripts,golang
+Build-Depends: debhelper,autotools-dev,devscripts,golang-stable
 Standards-Version: 3.9.3
 Homepage: http://github.com/dotcloud/docker