Rename ndnputchunks to ndnserve

Change-Id: Id1cc90c91ec0778ec07495b364546b05464410c8
diff --git a/tools/chunks/README.md b/tools/chunks/README.md
deleted file mode 100644
index 2c68eed..0000000
--- a/tools/chunks/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# ndnputchunks
-
-**ndnputchunks** is a producer program that reads a file from the standard input, and makes
-it available as a set of NDN Data segments. It appends version and segment number components
-to the specified name as needed, according to the [NDN naming conventions](
-https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
-
-Files published by ndnputchunks can be fetched with [ndnget](../get/README.md).
-
-## Usage examples
-
-The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
-prefix:
-
-    ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
-
-To find the published version you have to start ndnputchunks with the `-p` command line option,
-for example:
-
-    ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
-
-This command will print the published version to standard output.
-
-To publish Data with a specific version, you need to append a version component to the end of the
-prefix. The version component must follow the aforementioned NDN naming conventions. For example,
-the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
-
-    ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
-
-If the specified version component is not valid, ndnputchunks will exit with an error. If no version
-component is specified, one will be generated and appended to the name.
diff --git a/tools/chunks/wscript b/tools/chunks/wscript
deleted file mode 100644
index 31fddd1..0000000
--- a/tools/chunks/wscript
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-top = '../..'
-
-def build(bld):
-    bld.objects(
-        target='chunks-objects',
-        source=bld.path.ant_glob('putchunks/*.cpp', excl='putchunks/main.cpp'),
-        use='core-objects')
-
-    bld.program(
-        target=f'{top}/bin/ndnputchunks',
-        name='ndnputchunks',
-        source='putchunks/main.cpp',
-        use='chunks-objects')
diff --git a/tools/serve/README.md b/tools/serve/README.md
new file mode 100644
index 0000000..acaab8f
--- /dev/null
+++ b/tools/serve/README.md
@@ -0,0 +1,31 @@
+# ndnserve
+
+**ndnserve** is a producer program that reads a file from the standard input, and makes it
+available as a set of NDN Data segments. It appends version and segment number components
+to the specified name as needed, according to the [NDN naming conventions](
+https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
+
+Files published by ndnserve can be fetched with [ndnget](../get/README.md).
+
+## Usage examples
+
+The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
+prefix:
+
+    ndnserve /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+
+To find the published version you have to start ndnserve with the `-p` command line option,
+for example:
+
+    ndnserve -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+
+This command will print the published version to standard output.
+
+To publish Data with a specific version, you need to append a version component to the end of the
+prefix. The version component must follow the aforementioned NDN naming conventions. For example,
+the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
+
+    ndnserve -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
+
+If the specified version component is not valid, ndnserve will exit with an error. If no version
+component is specified, one will be generated and appended to the name.
diff --git a/tools/chunks/putchunks/main.cpp b/tools/serve/main.cpp
similarity index 95%
rename from tools/chunks/putchunks/main.cpp
rename to tools/serve/main.cpp
index 04bfec8..995d36e 100644
--- a/tools/chunks/putchunks/main.cpp
+++ b/tools/serve/main.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -36,7 +36,7 @@
 
 #include <iostream>
 
-namespace ndn::chunks {
+namespace ndn::serve {
 
 namespace po = boost::program_options;
 
@@ -68,7 +68,7 @@
                     "maximum chunk size, in bytes")
     ("naming-convention,N",  po::value<std::string>(&nameConv),
                              "encoding convention to use for name components, either 'marker' or 'typed'")
-    ("signing-info,S",       po::value<std::string>(&signingStr), "see 'man ndnputchunks' for usage")
+    ("signing-info,S",       po::value<std::string>(&signingStr), "see 'man ndnserve' for usage")
     ("print-data-version,p", po::bool_switch(&opts.wantShowVersion),
                              "print Data version to the standard output")
     ("quiet,q",     po::bool_switch(&opts.isQuiet), "turn off all non-error output")
@@ -106,7 +106,7 @@
   }
 
   if (vm.count("version") > 0) {
-    std::cout << "ndnputchunks " << tools::VERSION << "\n";
+    std::cout << "ndnserve " << tools::VERSION << "\n";
     return 0;
   }
 
@@ -164,10 +164,10 @@
   return 0;
 }
 
-} // namespace ndn::chunks
+} // namespace ndn::serve
 
 int
 main(int argc, char* argv[])
 {
-  return ndn::chunks::main(argc, argv);
+  return ndn::serve::main(argc, argv);
 }
diff --git a/tools/chunks/putchunks/producer.cpp b/tools/serve/producer.cpp
similarity index 97%
rename from tools/chunks/putchunks/producer.cpp
rename to tools/serve/producer.cpp
index d9591d1..2c3ce8a 100644
--- a/tools/chunks/putchunks/producer.cpp
+++ b/tools/serve/producer.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -35,7 +35,7 @@
 
 #include <iostream>
 
-namespace ndn::chunks {
+namespace ndn::serve {
 
 Producer::Producer(const Name& prefix, Face& face, KeyChain& keyChain, std::istream& is,
                    const Options& opts)
@@ -158,4 +158,4 @@
   }
 }
 
-} // namespace ndn::chunks
+} // namespace ndn::serve
diff --git a/tools/chunks/putchunks/producer.hpp b/tools/serve/producer.hpp
similarity index 91%
rename from tools/chunks/putchunks/producer.hpp
rename to tools/serve/producer.hpp
index 46b25d9..48d19ca 100644
--- a/tools/chunks/putchunks/producer.hpp
+++ b/tools/serve/producer.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -27,8 +27,8 @@
  * @author Klaus Schneider
  */
 
-#ifndef NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
-#define NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
+#ifndef NDN_TOOLS_SERVE_PRODUCER_HPP
+#define NDN_TOOLS_SERVE_PRODUCER_HPP
 
 #include "core/common.hpp"
 
@@ -37,7 +37,7 @@
 
 #include <vector>
 
-namespace ndn::chunks {
+namespace ndn::serve {
 
 /**
  * @brief Segmented & versioned data publisher.
@@ -97,6 +97,6 @@
   const Options m_options;
 };
 
-} // namespace ndn::chunks
+} // namespace ndn::serve
 
-#endif // NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
+#endif // NDN_TOOLS_SERVE_PRODUCER_HPP
diff --git a/tools/serve/wscript b/tools/serve/wscript
new file mode 100644
index 0000000..376f72c
--- /dev/null
+++ b/tools/serve/wscript
@@ -0,0 +1,17 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+top = '../..'
+
+def build(bld):
+    bld.objects(
+        target='serve-objects',
+        source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
+        use='core-objects')
+
+    bld.program(
+        target=f'{top}/bin/ndnserve',
+        name='ndnserve',
+        source='main.cpp',
+        use='serve-objects')
+
+    # backward compatibility
+    bld.symlink_as('${BINDIR}/ndnputchunks', 'ndnserve')