Build rules for a71ch-crypto-support

Change-Id: I5a572e268f3eb483b083f46833d67b23ff21c17e
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3ad43c2
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+a71ch-crypto-support (1-1) mendel-day; urgency=medium
+
+  * Initial release.
+
+ -- Coral Team <coral-support@google.com>  Thu, 14 May 2020 12:00:00 -0700
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..1f3d760
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,13 @@
+Source: a71ch-crypto-support
+Section: misc
+Priority: optional
+Maintainer: Coral Team <coral-support@google.com>
+Build-Depends: debhelper (>=10), cmake, libi2c-dev, libssl-dev
+Standards-Version: 3.9.8
+Homepage: https://coral.ai
+
+Package: a71ch-crypto-support
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}, libi2c0, libssl1.1
+Description: Support for NXP A71CH
+ OpenSSL and configurator tools for NXP's A71CH secure element
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..363a896
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,7 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: a71ch-crypto-support
+Source: https://aiyprojects.googlesource.com/a71ch-crypto-support
+
+Files: debian/*
+Copyright: Copyright 2020 Google, LLC <coral-support@google.com>
+License: Apache-2.0
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
new file mode 100644
index 0000000..28ae699
--- /dev/null
+++ b/debian/lintian-overrides
@@ -0,0 +1,4 @@
+a71ch-crypto-support: package-name-doesnt-match-sonames libsss-engine libsssapisw
+a71ch-crypto-support: shlib-without-versioned-soname usr/lib/libsss_engine.so libsss_engine.so
+a71ch-crypto-support: shlib-without-versioned-soname usr/lib/libsssapisw.so libsssapisw.so
+a71ch-crypto-support: package-must-activate-ldconfig-trigger usr/lib/libsssapisw.so
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a866ceb
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+#
+# output every command that modifies files on the build system.
+# export DH_VERBOSE = 1
+PACKAGENAME=a71ch-crypto-support
+DESTDIR=$(shell pwd)/debian/$(PACKAGENAME)
+
+%:
+	dh $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- -DApplet=A71CH -DHost=Raspbian -DSMCOM=SCI2C -DHostCrypto=OPENSSL -DCMAKE_BUILD_TYPE=Release
+
+override_dh_auto_install:
+	dh_auto_install
+	install -d $(DESTDIR)/etc/ssl
+	install -m 755 demos/linux/common/openssl11_sss_a71ch.cnf $(DESTDIR)/etc/ssl
+	sed -i -e 's/\/usr\/local\/lib/\/usr\/lib/g' $(DESTDIR)/etc/ssl/openssl11_sss_a71ch.cnf
+	install -d $(destdir)/usr/lib
+	install -m 755 tools/libsssapisw.so $(DESTDIR)/usr/lib/libsssapisw.so
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)