From f4b599551a29742b3695105b7315a09145901a03 Mon Sep 17 00:00:00 2001
From: Ben Firshman <ben@firshman.co.uk>
Date: Tue, 30 Sep 2014 18:52:47 -0700
Subject: [PATCH] Use uname to generate binary download URL

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
---
 CONTRIBUTING.md    |  2 +-
 docs/install.md    | 10 +++-------
 script/build-linux |  3 ++-
 script/build-osx   |  3 ++-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 924cca873..631f450f5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -86,7 +86,7 @@ The easiest way to do this is to use the `--signoff` flag when committing. E.g.:
 
 3. Build Linux version on any Docker host with `script/build-linux` and attach to release
 
-4. Build OS X version on Mountain Lion with `script/build-osx` and attach to release
+4. Build OS X version on Mountain Lion with `script/build-osx` and attach to release as `fig-Darwin-x86_64` and `fig-Linux-x86_64`.
 
 5. Publish GitHub release, creating tag
 
diff --git a/docs/install.md b/docs/install.md
index 02bdce0f9..f72de42d0 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -14,15 +14,11 @@ First, install Docker version 1.0 or greater. If you're on OS X, you can use [do
 
 Docker has guides for [Ubuntu](http://docs.docker.io/en/latest/installation/ubuntulinux/) and [other platforms](http://docs.docker.io/en/latest/installation/) in their documentation.
 
-Next, install Fig. On OS X:
+Next, install Fig:
 
-    curl -L https://github.com/docker/fig/releases/download/0.5.2/darwin > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
+    curl -L https://github.com/docker/fig/releases/download/0.5.2/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
 
-On 64-bit Linux:
-
-    curl -L https://github.com/docker/fig/releases/download/0.5.2/linux > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
-
-Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):
+Releases are available for OS X and 64-bit Linux. Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):
 
     $ sudo pip install -U fig
 
diff --git a/script/build-linux b/script/build-linux
index e16f2fb51..3dc2c643c 100755
--- a/script/build-linux
+++ b/script/build-linux
@@ -4,4 +4,5 @@ mkdir -p `pwd`/dist
 chmod 777 `pwd`/dist
 docker build -t fig .
 docker run -u user -v `pwd`/dist:/code/dist fig pyinstaller -F bin/fig
-docker run -u user -v `pwd`/dist:/code/dist fig dist/fig --version
+mv dist/fig dist/fig-Linux-x86_64
+docker run -u user -v `pwd`/dist:/code/dist fig dist/fig-Linux-x86_64 --version
diff --git a/script/build-osx b/script/build-osx
index 2f7cc75ee..359e9a037 100755
--- a/script/build-osx
+++ b/script/build-osx
@@ -6,4 +6,5 @@ venv/bin/pip install -r requirements.txt
 venv/bin/pip install -r requirements-dev.txt
 venv/bin/pip install .
 venv/bin/pyinstaller -F bin/fig
-dist/fig --version
+mv dist/fig dist/fig-Darwin-x86_64
+dist/fig-Darwin-x86_64 --version