ndncert: Initial release
Change-Id: I280c7a059b330e4065f66615165741f411d72168
diff --git a/.gitignore b/.gitignore
index 6763b1f..306d2da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*/work
*~
.deb/*
+.DS_Store
\ No newline at end of file
diff --git a/ndncert/Makefile b/ndncert/Makefile
new file mode 100644
index 0000000..75dabd1
--- /dev/null
+++ b/ndncert/Makefile
@@ -0,0 +1,16 @@
+# URL for git clone
+GIT_URL=https://github.com/cawka/ndncert
+
+# Tag name or commit hash for checkout
+GIT_VERSION=443a8609e87b10bc19fcd3cf06cf706693ceb11f
+
+# Package name
+NAME=ndncert
+
+# Package version
+VERSION=0.0.2-1-g443a860
+
+# PPA version
+PPA_VERSION=1
+
+include ../packaging.mk
diff --git a/ndncert/debian/changelog b/ndncert/debian/changelog
new file mode 100644
index 0000000..cc1deca
--- /dev/null
+++ b/ndncert/debian/changelog
@@ -0,0 +1,47 @@
+ndncert (0.0.1-g8f61cbb-ppa2~DISTRO) DISTRO; urgency=low
+
+ * New version based on 8f61cbba028f09553b856ac035071f98b00d0c78
+ (https://github.com/cawka/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Sat, 03 Feb 2018 19:22:34 +0000
+
+ndncert (0.0.1-g8f61cbb-ppa1~DISTRO) DISTRO; urgency=low
+
+ * New version based on 8f61cbba028f09553b856ac035071f98b00d0c78
+ (https://github.com/cawka/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Sat, 03 Feb 2018 19:11:28 +0000
+
+ndncert (0.0.0-g1c0bd37-ppa4~DISTRO) DISTRO; urgency=low
+
+ * New version based on 1c0bd377f52a95e83ae0769fa4c914289acca584
+ (https://github.com/named-data/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Fri, 02 Feb 2018 16:00:57 +0000
+
+ndncert (0.0.0-g1c0bd37-ppa3~DISTRO) DISTRO; urgency=low
+
+ * New version based on 1c0bd377f52a95e83ae0769fa4c914289acca584
+ (https://github.com/named-data/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Fri, 02 Feb 2018 15:48:33 +0000
+
+ndncert (0.0.0-g1c0bd37-ppa2~DISTRO) DISTRO; urgency=low
+
+ * New version based on 1c0bd377f52a95e83ae0769fa4c914289acca584
+ (https://github.com/named-data/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Fri, 02 Feb 2018 13:23:51 +0000
+
+ndncert (0.0.0-g1c0bd37-ppa1~DISTRO) DISTRO; urgency=low
+
+ * New version based on 1c0bd377f52a95e83ae0769fa4c914289acca584
+ (https://github.com/named-data/ndncert)
+
+ -- Alexander Afanasyev <alexander.afanasyev@ucla.edu> Fri, 02 Feb 2018 13:15:46 +0000
+
+ndncert (0.0.0~ppa0~DISTRO) DISTRO; urgency=low
+
+ * Initial release
+
+ -- Zhiyi Zhang <zhiyi@cs.ucla.edu> Wed, 17 Jan 2017 16:29:30 -0800
diff --git a/ndncert/debian/compat b/ndncert/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/ndncert/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/ndncert/debian/control b/ndncert/debian/control
new file mode 100644
index 0000000..0dc5f98
--- /dev/null
+++ b/ndncert/debian/control
@@ -0,0 +1,56 @@
+Source: ndncert
+Priority: extra
+Maintainer: Zhiyi Zhang <zhiyi@cs.ucla.edu>
+Build-Depends: debhelper (>= 8.0.0),
+ python (>= 2.7.0),
+ pkg-config (>= 0.26),
+ ndn-cxx-dev (>= 0.6.0)
+Standards-Version: 3.9.2
+Section: net
+Homepage: http://github.com/named-data/ndncert
+Vcs-Git: git://github.com/named-data/ndncert
+Vcs-Browser: http://github.com/named-data/ndncert
+
+Package: libndncert
+Section: libs
+Architecture: i386 amd64 arm64 armel armhf ppc64el
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: NDN Certificate Management System
+ The library to support NDNCERT protocol and help
+ NDN entities to manage certificates.
+
+Package: libndncert-dev
+Section: libdevel
+Depends: libndncert (= ${binary:Version}), ${misc:Depends}, ndn-cxx-dev
+Architecture: i386 amd64 arm64 armel armhf ppc64el
+Description: NDN Certificate Management System
+ The library to support NDNCERT protocol and help
+ NDN entities to manage certificates.
+ .
+ This package contains the development files (headers and libraries)
+
+Package: libndncert-dbg
+Section: debug
+Architecture: i386 amd64 arm64 armel armhf ppc64el
+Priority: extra
+Depends: libndncert (= ${binary:Version}), ${misc:Depends}
+Multi-Arch: foreign
+Description: NDN Certificate Management System
+ The library to support NDNCERT protocol and help
+ NDN entities to manage certificates.
+ .
+ This package contains the debugging symbols for the libraries.
+
+Package: ndncert
+Architecture: i386 amd64 arm64 armel armhf ppc64el
+Depends: ${shlibs:Depends}, ${misc:Depends}, ndn-cxx
+Description: NDN Certificate Management System
+ Tools to support NDNCERT protocol and help
+ NDN entities do certificate management.
+
+Package: ndncert-server
+Depends: ${shlibs:Depends}, ${misc:Depends}, ndncert, ndn-cxx, nfd
+Architecture: i386 amd64 arm64 armel armhf ppc64el
+Description: NDN Certificate Management System
+ Daemon to support NDNCERT protocol and help
+ NDN entities do certificate management.
diff --git a/ndncert/debian/copyright b/ndncert/debian/copyright
new file mode 100644
index 0000000..e5dccb7
--- /dev/null
+++ b/ndncert/debian/copyright
@@ -0,0 +1,36 @@
+Format: http://dep.debian.net/deps/dep5
+Upstream-Name: ndncert
+Source: http://github.com/named-data/ndncert
+
+Files: *
+Copyright: Copyright (c) 2018, Regents of the University of California
+
+License: GPL-3+
+ ndncert 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.
+ .
+ ndncert 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
+ ndncert, e.g., in COPYING file. If not, see <http://www.gnu.org/licenses/>.
+
+Files: debian/*
+Copyright: 2013-2018, Zhiyi Zhang <zhiyi@cs.ucla.edu>
+License: Apache 2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian systems, the complete text of the Apache License 2.0 can
+ be found in "/usr/share/common-licenses/Apache-2.0"
diff --git a/ndncert/debian/libndncert-dev.dirs b/ndncert/debian/libndncert-dev.dirs
new file mode 100644
index 0000000..8216000
--- /dev/null
+++ b/ndncert/debian/libndncert-dev.dirs
@@ -0,0 +1,3 @@
+usr/lib
+usr/lib/pkgconfig
+usr/include
diff --git a/ndncert/debian/libndncert-dev.install b/ndncert/debian/libndncert-dev.install
new file mode 100644
index 0000000..728e0d8
--- /dev/null
+++ b/ndncert/debian/libndncert-dev.install
@@ -0,0 +1,4 @@
+usr/lib/*/*.so
+usr/include/*
+usr/lib*/*/pkgconfig/*
+
diff --git a/ndncert/debian/libndncert.dirs b/ndncert/debian/libndncert.dirs
new file mode 100644
index 0000000..0d5487b
--- /dev/null
+++ b/ndncert/debian/libndncert.dirs
@@ -0,0 +1 @@
+usr/lib
\ No newline at end of file
diff --git a/ndncert/debian/libndncert.install b/ndncert/debian/libndncert.install
new file mode 100644
index 0000000..3de3b10
--- /dev/null
+++ b/ndncert/debian/libndncert.install
@@ -0,0 +1 @@
+usr/lib/*/*.so.*
diff --git a/ndncert/debian/ndncert-ca.conf b/ndncert/debian/ndncert-ca.conf
new file mode 100644
index 0000000..e338b51
--- /dev/null
+++ b/ndncert/debian/ndncert-ca.conf
@@ -0,0 +1,16 @@
+{
+ "ca-list":
+ [
+ {
+ "ca-prefix": "/example",
+ "issuing-freshness": "720",
+ "validity-period": "360",
+ "probe": "Get the PIN code from me :D",
+ "ca-info": "Example CA",
+ "supported-challenges":
+ [
+ { "type": "PIN" }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ndncert/debian/ndncert-server.default b/ndncert/debian/ndncert-server.default
new file mode 100644
index 0000000..4735d85
--- /dev/null
+++ b/ndncert/debian/ndncert-server.default
@@ -0,0 +1,4 @@
+# ndncert-ca-server defaults
+
+# Whether ndncert-ca-server publishes cert to repo
+FLAGS="-r"
diff --git a/ndncert/debian/ndncert-server.dirs b/ndncert/debian/ndncert-server.dirs
new file mode 100644
index 0000000..1ab19c5
--- /dev/null
+++ b/ndncert/debian/ndncert-server.dirs
@@ -0,0 +1,2 @@
+etc/ndncert
+usr/bin
diff --git a/ndncert/debian/ndncert-server.install b/ndncert/debian/ndncert-server.install
new file mode 100644
index 0000000..6278b9a
--- /dev/null
+++ b/ndncert/debian/ndncert-server.install
@@ -0,0 +1,5 @@
+etc/ndncert/ca.conf.sample
+etc/ndncert/ndncert-mail.conf.sample
+debian/ndncert-ca.conf /etc/ndncert/
+usr/bin/ndncert-ca-server
+usr/bin/ndncert-ca-status
diff --git a/ndncert/debian/ndncert-server.postinst b/ndncert/debian/ndncert-server.postinst
new file mode 100644
index 0000000..4ee63ca
--- /dev/null
+++ b/ndncert/debian/ndncert-server.postinst
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+if [ "$1" != "configure" ]; then
+ exit 0
+fi
+
+APP=ndncert
+
+if [ ! -f /var/lib/ndn/$APP/.ndn/pib.db ]; then
+ sudo mkdir -p /var/lib/ndn/$APP/.ndn
+ sudo chown -R ndn:ndn /var/lib/ndn/$APP
+fi
+
+exit 0
diff --git a/ndncert/debian/ndncert-server.service b/ndncert/debian/ndncert-server.service
new file mode 100644
index 0000000..23ed7db
--- /dev/null
+++ b/ndncert/debian/ndncert-server.service
@@ -0,0 +1,22 @@
+# Author: Zhiyi Zhang <zhiyi@cs.ucla.edu>
+
+[Unit]
+Description=Certificate Management CA Service for Named Data Networking
+Documentation=man:ndns-daemon
+Requires=nfd.service
+After=nfd.service
+
+[Service]
+Environment=HOME=/var/lib/ndn/ndncert
+EnvironmentFile=-/etc/default/ndncert
+User=ndncert
+Group=ndncert
+ExecStart=/usr/bin/ndncert-ca-server -c /etc/ndncert/ndncert-ca.conf $FLAGS
+Restart=on-failure
+ProtectSystem=full
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectHome=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ndncert/debian/ndncert-server.upstart b/ndncert/debian/ndncert-server.upstart
new file mode 100644
index 0000000..22ab33b
--- /dev/null
+++ b/ndncert/debian/ndncert-server.upstart
@@ -0,0 +1,21 @@
+description "NDN Certificate Management System Library"
+author "Zhiyi Zhang <zhiyi@cs.ucla.edu>"
+
+start on started nfd
+stop on stopping nfd
+
+respawn
+respawn limit unlimited
+
+setuid ndn
+setgid ndn
+
+script
+ FLAGS = ""
+ if [ -f /etc/default/ndncert ]; then
+ . /etc/default/ndncert
+ fi
+
+ export HOME=/var/lib/ndn/ndncert
+ exec /usr/bin/ndncert-ca-server -c /etc/ndncert/ndncert-ca.conf $FLAGS
+end script
diff --git a/ndncert/debian/ndncert.dirs b/ndncert/debian/ndncert.dirs
new file mode 100644
index 0000000..1ab19c5
--- /dev/null
+++ b/ndncert/debian/ndncert.dirs
@@ -0,0 +1,2 @@
+etc/ndncert
+usr/bin
diff --git a/ndncert/debian/ndncert.install b/ndncert/debian/ndncert.install
new file mode 100644
index 0000000..1343e5a
--- /dev/null
+++ b/ndncert/debian/ndncert.install
@@ -0,0 +1,2 @@
+etc/ndncert/client*
+usr/bin/ndncert-client
diff --git a/ndncert/debian/rules b/ndncert/debian/rules
new file mode 100755
index 0000000..10c8740
--- /dev/null
+++ b/ndncert/debian/rules
@@ -0,0 +1,43 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
+CXXFLAGS += -std=c++11
+LIBDIR := /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+%:
+ dh $@ --parallel
+
+override_dh_auto_configure:
+ CXXFLAGS="$(CXXFLAGS)" LINKFLAGS="$(LDFLAGS)" ./waf configure --prefix=/usr --sysconfdir=/etc --libdir="$(LIBDIR)" --localstatedir=/var --boost-libs="$(LIBDIR)"
+
+override_dh_auto_build:
+ ./waf build
+
+override_dh_auto_install:
+ ./waf install --destdir=debian/tmp
+
+override_dh_auto_clean:
+ ./waf distclean
+
+override_dh_clean:
+ dh_clean
+ ./waf distclean
+ rm -rf .waf-1*
+ rm -rf .waf3-1*
+ rm -f .waf-tools/*.pyc
+
+override_dh_auto_test:
+
+.PHONY: override_dh_strip
+override_dh_strip:
+ dh_strip --dbg-package=libndncert-dbg
diff --git a/ndncert/debian/source/format b/ndncert/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/ndncert/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)