From d1bbcc506eafedd228ffd979c6625a8a3eec939f Mon Sep 17 00:00:00 2001
From: "Lukas F. Hartmann" <lukas@mntre.com>
Date: Wed, 9 Jun 2021 16:44:52 +0200
Subject: [PATCH] debian: include control files and shell script

---
 debian/DEBIAN/control  | 9 +++++++++
 debian/mkdeb.sh        | 6 +++++-
 debian/reform-handbook | 9 +++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 debian/DEBIAN/control
 create mode 100755 debian/reform-handbook

diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control
new file mode 100644
index 0000000..6564b74
--- /dev/null
+++ b/debian/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: reform-handbook
+Version: 1.0-2
+Section: base
+Priority: optional
+Architecture: all
+Depends: bash, xdg-utils, elinks
+Maintainer: Lukas F. Hartmann <lukas@mntre.com>
+Description: MNT Reform Operator Handbook
+ The HTML version of the handbook for the MNT Reform OSHW laptop, plus a helper script /usr/bin/reform-handbook which opens the web pages using xdg-open or elinks. Includes a copy of the Inter font by rsms.
diff --git a/debian/mkdeb.sh b/debian/mkdeb.sh
index 47c534b..742cd05 100755
--- a/debian/mkdeb.sh
+++ b/debian/mkdeb.sh
@@ -1,11 +1,15 @@
 #!/bin/bash
 
-version="1.0-1"
+version="1.0-3"
 target="./reform-handbook_${version}/usr/share/doc/reform-handbook"
 
+mkdir -p "${target}/usr/bin"
+cp reform-handbook "${target}/usr/bin/"
+
 mkdir -p "${target}/html"
 rm -r "${target}/html"
 
+cp -Rv ./DEBIAN "./reform-handbook_${version}/"
 cp -Rv ../src/build/html "${target}/"
 
 rm "${target}/html/_static/schem/"*.sla
diff --git a/debian/reform-handbook b/debian/reform-handbook
new file mode 100755
index 0000000..1eebdfe
--- /dev/null
+++ b/debian/reform-handbook
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ -z ${DISPLAY+x} ]
+then
+  # not running under X/wayland
+  elinks /usr/share/doc/reform-handbook/html/index.html
+else
+  xdg-open /usr/share/doc/reform-handbook/html/index.html
+fi
-- 
GitLab