repo-ng: Add systemd startup scripts

refs #2810

Change-Id: I5fd2047991fafa157434fd08dbf3c4074e0f68d3
diff --git a/repo-ng/debian/control b/repo-ng/debian/control
index 6167d94..a27892b 100644
--- a/repo-ng/debian/control
+++ b/repo-ng/debian/control
@@ -2,6 +2,7 @@
 Priority: extra
 Maintainer: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 Build-Depends: debhelper (>= 8.0.0),
+ dh-systemd (>= 1.5),
  python (>= 2.7.0),
  pkg-config (>= 0.26),
  ndn-cxx-dev (>= 0.3.0~rc0.2)
diff --git a/repo-ng/debian/control.precise b/repo-ng/debian/control.precise
new file mode 100644
index 0000000..6167d94
--- /dev/null
+++ b/repo-ng/debian/control.precise
@@ -0,0 +1,19 @@
+Source: repo-ng
+Priority: extra
+Maintainer: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+Build-Depends: debhelper (>= 8.0.0),
+ python (>= 2.7.0),
+ pkg-config (>= 0.26),
+ ndn-cxx-dev (>= 0.3.0~rc0.2)
+Standards-Version: 3.9.2
+Section: net
+Homepage: http://github.com/named-data/repo-ng
+Vcs-Git: git://github.com/named-data/repo-ng.git
+Vcs-Browser: http://github.com/named-data/repo-ng
+
+Package: repo-ng
+Architecture: i386 amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, ndn-cxx
+Description: Next generation of NDN repository
+ repo-ng is an implementation of a Named Data Networking data repository with the protocol
+ defined on NDN wiki: http://redmine.named-data.net/projects/repo-ng/wiki
diff --git a/repo-ng/debian/repo-ng.service b/repo-ng/debian/repo-ng.service
new file mode 100644
index 0000000..e141a19
--- /dev/null
+++ b/repo-ng/debian/repo-ng.service
@@ -0,0 +1,37 @@
+# Copyright (c) 2015,  Arizona Board of Regents.
+#
+# This file is part of NDN repo-ng (Next generation of NDN repository).
+# See AUTHORS.md for complete list of repo-ng authors and contributors.
+#
+# repo-ng is free software: you can redistribute it and/or modify it under the terms
+# of the GNU General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later version.
+#
+# repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Eric Newberry <enewberry@email.arizona.edu>
+
+[Unit]
+Description=New generation of NDN repo
+Documentation=man:ndn-repo-ng
+Requires=nfd.service
+After=nfd.service
+
+[Service]
+Environment=HOME=/var/lib/ndn/repo-ng
+User=ndn
+Group=ndn
+ExecStart=/usr/bin/ndn-repo-ng -c /etc/ndn/repo-ng.conf
+Restart=on-failure
+ProtectSystem=full
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectHome=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/repo-ng/debian/rules b/repo-ng/debian/rules
index 0d3817e..ffe978c 100755
--- a/repo-ng/debian/rules
+++ b/repo-ng/debian/rules
@@ -14,7 +14,7 @@
 CXXFLAGS += -std=c++11
 
 %:
-	dh $@ --parallel
+	dh $@ --parallel --with=systemd
 
 override_dh_auto_configure:
 	CXXFLAGS="$(CXXFLAGS)" LINKFLAGS="$(LDFLAGS)" ./waf configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var