From eb6687bd32a895f2adb8c41374d0824ee05e948f Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Fri, 26 Oct 2012 06:55:01 +0200
Subject: [PATCH] allow build to be called outside of the project directory

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/build b/build
index 75496c8d..8e30c8d4 100755
--- a/build
+++ b/build
@@ -26,6 +26,7 @@
 # exit on any error
 #set -e
 
+basedir=${0%/*}
 version=$(git describe)
 
 # Manpage and HTML
@@ -44,6 +45,9 @@ MAN1DSTDIR=${MANDIR}/man1
 MAN7DSTDIR=${MANDIR}/man7
 SPEECHESDIR=docs/speeches
 
+# Change to checkout directory
+cd "$basedir"
+
 case "$1" in
     man)
         set -e