Make Python-path configurable

This commit introduces a Makefile that needs to be run initially to
configure reclass for use on the local system, by setting the full path
to the Python interpreter.

Closes: #1
Signed-off-by: martin f. krafft <madduck@madduck.net>
diff --git a/.gitignore b/.gitignore
index 169396b..0d3807b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 *.pyc
 /reclass-config.yml
+/reclass.py
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..67f71bd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+#!/usr/bin/make
+#
+# This file is part of reclass (http://github.com/madduck/reclass)
+#
+# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+
+PYTHON_DEFAULT = /usr/bin/python
+PYTHON := $(shell which python)
+
+IN_FILES = $(wildcard *.in adapters/*.in)
+all: $(patsubst %.in,%,$(IN_FILES))
+.PHONY: all
+
+ifeq ($(PYTHON),$(PYTHON_DEFAULT))
+REPLACE_PYTHON_SHEBANG = cat
+else
+REPLACE_PYTHON_SHEBANG = sed -e 's,$(PYTHON_DEFAULT),$(PYTHON),g'
+endif
+
+%: %.in ALWAYS_REDO
+	$(REPLACE_PYTHON_SHEBANG) $< > $@
+	chmod +x $@
+
+ALWAYS_REDO:
+	@:
diff --git a/README b/README
index a18b280..ca3de45 100644
--- a/README
+++ b/README
@@ -36,6 +36,19 @@
 In this document, you will find an overview of the concepts of reclass, the
 way it works, and how it can be tied in with Ansible.
 
+Installation
+~~~~~~~~~~~~
+Before you can use reclass, you need to run make to configure the scripts to
+your system. Right now, this only involves setting the full path to the
+Python interpreter.
+
+  make
+
+If your Python interpreter is not /usr/bin/python and is also not in your
+$PATH, then you need to pass that to make, e.g.
+
+  make PYTHON=/opt/local/bin/python
+
 Quick start — Ansible
 ~~~~~~~~~~~~~~~~~~~~~
 The following steps should get you up and running quickly. Generally, we will
diff --git a/adapters/.gitconfig b/adapters/.gitconfig
new file mode 100644
index 0000000..a6246db
--- /dev/null
+++ b/adapters/.gitconfig
@@ -0,0 +1 @@
+/ansible
diff --git a/adapters/ansible b/adapters/ansible.in
old mode 100755
new mode 100644
similarity index 100%
rename from adapters/ansible
rename to adapters/ansible.in
diff --git a/reclass.py b/reclass.py.in
old mode 100755
new mode 100644
similarity index 100%
rename from reclass.py
rename to reclass.py.in