[S2GRAPH-88]: include LICENSE, NOTICE and DISCLAIMER in the binary release.

JIRA:
  [S2GRAPH-88] https://issues.apache.org/jira/browse/S2GRAPH-88

Pull Request:
  Closes #61

Authors:
  Jong Wook Kim: jongwook@nyu.edu
diff --git a/CHANGES b/CHANGES
index 436cca4..091d5bf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -143,6 +143,9 @@
 
     S2GRAPH-81: Separate Serializable's toKeyValues into 3, toRowKey, toQualifier, toValue. (Committed by DOYUNG YOON).
 
+    S2GRAPH-88: Add DISCLAIMER, LICENSE, NOTICE on packaging process.
+		(Contributed by Jong Wook Kim<jongwook@nyu.edu>, committed by DOYUNG YOON)
+
   TEST
     
     S2GRAPH-21: Change PostProcessBenchmarkSpec not to store and fetch test data from storage. (Committed by DOYUNG YOON).
diff --git a/DISCLAIMER b/DISCLAIMER
new file mode 100644
index 0000000..5eba4ff
--- /dev/null
+++ b/DISCLAIMER
@@ -0,0 +1,11 @@
+Apache S2Graph is an effort undergoing incubation at the Apache Software
+Foundation (ASF), sponsored by the Apache Incubator PMC.
+
+Incubation is required of all newly accepted projects until a further
+review indicates that the infrastructure, communications, and decision
+making process have stabilized in a manner consistent with other
+successful ASF projects.
+
+While incubation status is not necessarily a reflection of the
+completeness or stability of the code, it does indicate that the
+project has yet to be fully endorsed by the ASF.
diff --git a/LICENSE.txt b/LICENSE
similarity index 100%
rename from LICENSE.txt
rename to LICENSE
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..4e67b28
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache S2Graph (incubating)
+Copyright 2016 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/project/Packager.scala b/project/Packager.scala
index cff65fd..5a9a121 100644
--- a/project/Packager.scala
+++ b/project/Packager.scala
@@ -36,19 +36,27 @@
     }
   }
 
-  val packagerTask = (baseDirectory, packagedJars, dependencyClasspath in Runtime, target, streams).map {
-    (root, packaged, dependencies, target, streams) =>
-      val base = target / "deploy"
+  val packagerTask = (baseDirectory, packagedJars, dependencyClasspath in Runtime, target, streams, version).map {
+    (root, packaged, dependencies, target, streams, version) =>
+      val name = s"s2graph-$version-incubating-bin"
+      val base = target / name
 
       IO.delete(base)
       IO.createDirectory(base)
 
       val subdirectories = Seq("bin", "conf", "lib")
+      val files = Seq("LICENSE", "NOTICE", "DISCLAIMER")
 
       for (dir <- subdirectories) {
         IO.createDirectory(base / dir)
       }
 
+      for (file <- files) {
+        val source = (root / file).toPath
+        val target = (base / file).toPath
+        Files.copy(source, target)
+      }
+
       // copy jars to /lib
       val libs = dependencies.filter(_.data.ext == "jar").map(_.data) ++ packaged
       libs.foreach { jar =>
@@ -58,11 +66,11 @@
         try {
           // try to create hard links for speed and to save disk space
           Files.createLink(target, source)
-          streams.log.debug(s"created link: $source -> $target")
+          streams.log.debug(s"Created link: $source -> $target")
         } catch {
           case e: Any =>
             Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING)
-            streams.log.debug(s"copied: $source -> $target")
+            streams.log.debug(s"Copied: $source -> $target")
         }
       }
 
@@ -74,20 +82,28 @@
           override def preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult = {
             val dest = target.resolve(source.relativize(dir))
             Files.createDirectories(dest)
-            streams.log.debug(s"created directory: $dest")
+            streams.log.debug(s"Created directory: $dest")
             FileVisitResult.CONTINUE
           }
 
           override def visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult = {
             val dest = target.resolve(source.relativize(file))
             Files.copy(file, dest)
-            streams.log.debug(s"copied: $file -> $dest")
+            streams.log.debug(s"Copied: $file -> $dest")
             FileVisitResult.CONTINUE
           }
         })
       }
 
-      streams.log.info(s"package for distribution located at $base")
+      streams.log.info(s"Package for distribution located at $base")
+
+      {
+        import scala.sys.process._
+        streams.log.info(s"creating a tarball...")
+        s"tar zcf $base.tar.gz $base".!!
+        streams.log.info(s"Tarball is located at $base.tar.gz")
+      }
+
       base
   }