aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2017-04-14 17:40:25 -0400
committerRob Austein <sra@hactrn.net>2017-04-14 17:40:25 -0400
commit10eba36ef58559cf7964aa5c4888cee117122b31 (patch)
treeef4728cf9c21a36bbc04190cc26a728ee91018f6 /source
parent94cd0214ff95c9a13c2670c307c43f09f50f1739 (diff)
First cut at a setup.py for our Python code.
Diffstat (limited to 'source')
-rw-r--r--source/Makefile10
-rw-r--r--source/setup.py38
2 files changed, 41 insertions, 7 deletions
diff --git a/source/Makefile b/source/Makefile
index af018b1..5095766 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -6,6 +6,8 @@
# the primary packaging system is Debian-based, so this is written
# to work in that environment.
#
+# See setup.py for installation of the Python-related bits.
+#
# We also support Homebrew for MacOSX, using the source tarball
# generated by the Debian packaging process, but the Homebrew formula
# handles the build and installation for that environment.
@@ -20,10 +22,4 @@ install: all
install -D -m 644 cryptech-alpha-firmware.tar.gz ${DESTDIR}/usr/share/cryptech-alpha-firmware.tar.gz
install -D -m 644 sw/pkcs11/libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so
ln -s libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so.0
-# install -D sw/pkcs11/p11util ${DESTDIR}/usr/bin/p11util
-# install -D sw/pkcs11/libhal/cryptech_rpcd ${DESTDIR}/usr/bin/cryptech_rpcd
- install -D sw/stm32/projects/hsm/cryptech_upload ${DESTDIR}/usr/bin/cryptech_upload
- install -D sw/stm32/projects/hsm/cryptech_probe ${DESTDIR}/usr/bin/cryptech_probe
- install -D sw/stm32/projects/hsm/cryptech_miniterm ${DESTDIR}/usr/bin/cryptech_miniterm
-
-# Still need scripts to do something useful with the firmware tarball
+ python setup.py install --install-layout=deb --root=${DESTDIR}
diff --git a/source/setup.py b/source/setup.py
new file mode 100644
index 0000000..97b405d
--- /dev/null
+++ b/source/setup.py
@@ -0,0 +1,38 @@
+# Minimal distutils-based setup for Cryptech Alpha board software.
+#
+# Yes I know that the cool kids use setuptools these days, but that
+# drags in a lot of complex stuff which I don't think we really need
+# or even want here. Revisit if I turn out to be wrong about this.
+
+from distutils.core import setup
+
+try:
+ from cryptech_version import VERSION
+except ImportError:
+ VERSION = "0.0.0"
+
+setup(
+ name = "Cryptech Alpha",
+ version = VERSION,
+ description = "Software for Cryptech Alpha prototype HSM",
+ license = "BSD",
+ url = "https://cryptech.is/",
+
+ py_modules = [ "cryptech.libhal",
+ ],
+
+ packages = [ "cryptech.py11",
+ ],
+
+ package_dir = { "cryptech" : "sw/libhal/cryptech",
+ "cryptech.py11" : "sw/pkcs11/cryptech/py11",
+ },
+
+ scripts = [ "sw/libhal/cryptech_backup",
+ "sw/libhal/cryptech_console",
+ "sw/libhal/cryptech_muxd",
+ "sw/stm32/projects/hsm/cryptech_miniterm",
+ "sw/stm32/projects/hsm/cryptech_probe",
+ "sw/stm32/projects/hsm/cryptech_upload",
+ ],
+)