diff --git a/wscript b/wscript
new file mode 100644
index 0000000..551c572
--- /dev/null
+++ b/wscript
@@ -0,0 +1,131 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+VERSION='0.1.0'
+APPNAME='nTorrent'
+
+from waflib import Configure, Utils, Logs, Context
+import os
+
+def options(opt):
+
+    opt.load(['compiler_c', 'compiler_cxx', 'gnu_dirs'])
+
+    opt.load(['default-compiler-flags', 'boost',
+              'doxygen', 'sphinx_build'],
+              tooldir=['.waf-tools'])
+
+    opt = opt.add_option_group('nTorrent Options')
+
+    opt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
+                   help='''build unit tests''')
+
+def configure(conf):
+    conf.load(['compiler_c', 'compiler_cxx',
+               'default-compiler-flags', 'boost', 'gnu_dirs',
+               'doxygen', 'sphinx_build'])
+
+    if 'PKG_CONFIG_PATH' not in os.environ:
+      os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
+
+    conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
+                   uselib_store='NDN_CXX', mandatory=True)
+
+    boost_libs = 'system random thread filesystem'
+    if conf.options.with_tests:
+        conf.env['WITH_TESTS'] = 1
+        conf.define('WITH_TESTS', 1);
+        boost_libs += ' unit_test_framework'
+
+    conf.check_boost(lib=boost_libs)
+    if conf.env.BOOST_VERSION_NUMBER < 104800:
+        Logs.error("Minimum required boost version is 1.48.0")
+        Logs.error("Please upgrade your distribution or install custom boost libraries" +
+                   " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
+        return
+
+    conf.write_config_header('src/config.h')
+
+def build (bld):
+    feature_list = 'cxx'
+
+    bld(
+        features='cxx',
+        name='nTorrent',
+        source=bld.path.ant_glob(['src/**/*.cpp'],
+                                 excl=['src/main.cpp',]),
+        use='version NDN_CXX BOOST',
+        includes='src',
+        export_includes='src',
+    )
+
+    if bld.env["WITH_TESTS"]:
+        feature_list += ' cxxstlib'
+    else:
+        feature_list += ' cxxprogram'
+
+    # Unit tests
+    if bld.env["WITH_TESTS"]:
+      unittests = bld.program (
+          target="unit-tests",
+          source = bld.path.ant_glob(['tests/**/*.cpp']),
+          features=['cxx', 'cxxprogram'],
+          use = 'BOOST nTorrent',
+          includes = "src .",
+          install_path = None
+          )
+
+# docs
+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",
+                    "docs/named_data_theme/named_data_footer-with-analytics.html.in"],
+            target=["docs/doxygen.conf",
+                    "docs/named_data_theme/named_data_footer-with-analytics.html"],
+            VERSION=VERSION,
+            HTML_FOOTER="../build/docs/named_data_theme/named_data_footer-with-analytics.html" \
+                          if os.getenv('GOOGLE_ANALYTICS', None) \
+                          else "../docs/named_data_theme/named_data_footer.html",
+            GOOGLE_ANALYTICS=os.getenv('GOOGLE_ANALYTICS', ""),
+            )
+
+        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)
+
+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('.')]
+
+    try:
+        cmd = ['git', 'describe', '--match', 'nTorrent-*']
+        p = Utils.subprocess.Popen(cmd, stdout=Utils.subprocess.PIPE,
+                                   stderr=None, stdin=None)
+        out = p.communicate()[0].strip()
+        if p.returncode == 0 and out != "":
+            Context.g_module.VERSION = out[11:]
+    except:
+        pass
