ndn-tools: Initial packaging
Change-Id: Ic1e722903cdc146095dccb410999c36303d5233d
diff --git a/ndn-tools/debian/ndnping.postinst b/ndn-tools/debian/ndnping.postinst
new file mode 100644
index 0000000..09502a5
--- /dev/null
+++ b/ndn-tools/debian/ndnping.postinst
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+if [ "$1" != "configure" ]; then
+ exit 0
+fi
+
+APP=ndnping
+
+if [ ! -f /var/lib/ndn/$APP/.ndn/ndnsec-public-info.db ]; then
+ # Create HOME and generate self-signed NDN certificate
+ sudo mkdir -p /var/lib/ndn/$APP/.ndn
+ sudo chown -R ndn:ndn /var/lib/ndn/$APP
+ sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec-keygen /localhost/daemons/$APP | \
+ sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec-install-cert -
+fi
+
+#DEBHELPER#
+
+exit 0