diff --git a/wscript b/wscript
index c0e3934..8cfd410 100644
--- a/wscript
+++ b/wscript
@@ -19,10 +19,13 @@
 NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 """
 
-VERSION='1.0'
-NAME="NLSR"
+VERSION='0.1.0'
+NAME="nlsr"
+BUGREPORT = "http://redmine.named-data.net/projects/nlsr"
+URL = "http://named-data.net/doc/NLSR/"
+GIT_TAG_PREFIX = "NLSR-"
 
-from waflib import Build, Logs, Utils, Task, TaskGen, Configure
+from waflib import Build, Logs, Utils, Task, TaskGen, Configure, Context
 from waflib.Tools import c_preproc
 
 def options(opt):
@@ -39,9 +42,10 @@
 
 
 def configure(conf):
-    conf.load("compiler_cxx gnu_dirs boost openssl")
-
-    conf.load('default-compiler-flags')
+    conf.load(['compiler_cxx', 'gnu_dirs',
+               'boost', 'openssl',
+               'default-compiler-flags',
+               'doxygen', 'sphinx_build'])
 
     conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
                    uselib_store='NDN_CPP', mandatory=True)
@@ -71,7 +75,24 @@
     conf.write_config_header('config.hpp')
 
 
-def build (bld):
+def build(bld):
+    version(bld)
+
+    bld(features="subst",
+        name='version',
+        source='src/version.hpp.in',
+        target='src/version.hpp',
+        install_path=None,
+        VERSION_STRING=VERSION_BASE,
+        VERSION_BUILD=VERSION,
+        VERSION=int(VERSION_SPLIT[0]) * 1000000 +
+                int(VERSION_SPLIT[1]) * 1000 +
+                int(VERSION_SPLIT[2]),
+        VERSION_MAJOR=VERSION_SPLIT[0],
+        VERSION_MINOR=VERSION_SPLIT[1],
+        VERSION_PATCH=VERSION_SPLIT[2],
+        )
+
     nsync_objects = bld(
         target='nsync-objects',
         name='nsync-objects',
@@ -103,3 +124,93 @@
     if bld.env['WITH_TESTS']:
         bld.recurse('tests')
         bld.recurse('tests-integrated')
+
+
+def docs(bld):
+    from waflib import Options
+    Options.commands = ['doxygen', 'sphinx'] + Options.commands
+
+def doxygen(bld):
+    version(bld)
+
+    if not bld.env.DOXYGEN:
+        Logs.error("ERROR: cannot build documentation (`doxygen' is not found in $PATH)")
+    else:
+        bld(features="subst",
+            name="doxygen-conf",
+            source="docs/doxygen.conf.in",
+            target="docs/doxygen.conf",
+            VERSION=VERSION_BASE,
+            )
+
+        bld(features="doxygen",
+            doxyfile='docs/doxygen.conf',
+            use="doxygen-conf")
+
+def sphinx(bld):
+    version(bld)
+
+    if not bld.env.SPHINX_BUILD:
+        bld.fatal("ERROR: cannot build documentation (`sphinx-build' is not found in $PATH)")
+    else:
+        bld(features="sphinx",
+            outdir="docs",
+            source=bld.path.ant_glob('docs/**/*.rst'),
+            config="docs/conf.py",
+            VERSION=VERSION_BASE)
+
+def version(ctx):
+    if getattr(Context.g_module, 'VERSION_BASE', None):
+        return
+
+    Context.g_module.VERSION_BASE = Context.g_module.VERSION
+    Context.g_module.VERSION_SPLIT = [v for v in VERSION_BASE.split('.')]
+
+    didGetVersion = False
+    try:
+        cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
+        p = Utils.subprocess.Popen(cmd, stdout=Utils.subprocess.PIPE,
+                                   stderr=None, stdin=None)
+        out = p.communicate()[0].strip()
+        didGetVersion = (p.returncode == 0 and out != "")
+        if didGetVersion:
+            if out.startswith(GIT_TAG_PREFIX):
+                Context.g_module.VERSION = out[len(GIT_TAG_PREFIX):]
+            else:
+                Context.g_module.VERSION = "%s-commit-%s" % (Context.g_module.VERSION_BASE, out)
+    except OSError:
+        pass
+
+    versionFile = ctx.path.find_node('VERSION')
+
+    if not didGetVersion and versionFile is not None:
+        try:
+            Context.g_module.VERSION = versionFile.read()
+            return
+        except (OSError, IOError):
+            pass
+
+    # version was obtained from git, update VERSION file if necessary
+    if versionFile is not None:
+        try:
+            version = versionFile.read()
+            if version == Context.g_module.VERSION:
+                return # no need to update
+        except (OSError, IOError):
+            Logs.warn("VERSION file exists, but not readable")
+    else:
+        versionFile = ctx.path.make_node('VERSION')
+
+    if versionFile is None:
+        return
+
+    try:
+        versionFile.write(Context.g_module.VERSION)
+    except (OSError, IOError):
+        Logs.warn("VERSION file is not writeable")
+
+def dist(ctx):
+    version(ctx)
+
+def distcheck(ctx):
+    version(ctx)
