From 04f15b640dd47daeeabd5d3a470129c6e65abb99 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Sun, 4 Jul 2021 20:52:58 +0200
Subject: [PATCH] Add debian files

---
 build-deb.sh                          |  4 ++++
 debian/changelog                      |  5 +++++
 debian/compat                         |  1 +
 debian/control                        | 17 +++++++++++++++++
 debian/copyright                      | 25 +++++++++++++++++++++++++
 debian/documento-printserver.install  |  1 +
 debian/documento-printserver.links    |  1 +
 debian/documento-printserver.triggers | 10 ++++++++++
 debian/rules                          |  7 +++++++
 9 files changed, 71 insertions(+)
 create mode 100755 build-deb.sh
 create mode 100644 debian/changelog
 create mode 100644 debian/compat
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/documento-printserver.install
 create mode 100644 debian/documento-printserver.links
 create mode 100644 debian/documento-printserver.triggers
 create mode 100755 debian/rules

diff --git a/build-deb.sh b/build-deb.sh
new file mode 100755
index 0000000..8a87ffa
--- /dev/null
+++ b/build-deb.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+poetry export --without-hashes > requirements.txt
+sed -i '/^pillow.*$/d' requirements.txt
+dpkg-buildpackage -us -uc -b
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e3d1bda
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+documento-printserver (0.1-1) unstable; urgency=medium
+
+  * Initial release.
+
+ -- Jonathan Weth <dev@jonathanweth.de>  Sun, 04 Jul 2021 12:20:29 +0200
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..b0bedde
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,17 @@
+Source: documento-printserver
+Section: python
+Priority: extra
+Maintainer: Jonathan Weth <dev@jonathanweth.de>
+Build-Depends: debhelper (>= 10), python3, dh-virtualenv (>= 1.0),
+    python3-setuptools, python3-pip, python3-dev, libffi-dev
+Standards-Version: 4.5.0
+Homepage: https://edugit.org/documento/documento-printserver
+Vcs-Git: https://edugit.org/documento/documento-printserver.git
+Vcs-Browser: https://edugit.org/documento/documento-printserver
+
+
+Package: documento-printserver
+Architecture: any
+Pre-Depends: dpkg (>= 1.16.1), python3 (>= 3.6), python3-pil, ${misc:Pre-Depends}
+Depends: ${misc:Depends}
+Description: The printserver for Documento
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..59187f0
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,25 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: documento-printserver
+Upstream-Contact: Jonathan Weth <dev@jonathanweth.de>
+Source: https://edugit.org/documento/documento-printserver
+
+Files: *
+Copyright: 2020, 2021 Jonathan Weth <dev@jonathanweth.de>
+License: GPL-3+
+
+License: GPL-3+
+ This program 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
+ any later version.
+ .
+ This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-3'.
diff --git a/debian/documento-printserver.install b/debian/documento-printserver.install
new file mode 100644
index 0000000..de04223
--- /dev/null
+++ b/debian/documento-printserver.install
@@ -0,0 +1 @@
+opt/venvs/documento-printserver/bin/documento-printserver usr/bin/documento-printserver
diff --git a/debian/documento-printserver.links b/debian/documento-printserver.links
new file mode 100644
index 0000000..de04223
--- /dev/null
+++ b/debian/documento-printserver.links
@@ -0,0 +1 @@
+opt/venvs/documento-printserver/bin/documento-printserver usr/bin/documento-printserver
diff --git a/debian/documento-printserver.triggers b/debian/documento-printserver.triggers
new file mode 100644
index 0000000..e544b96
--- /dev/null
+++ b/debian/documento-printserver.triggers
@@ -0,0 +1,10 @@
+# Register interest in Python interpreter changes (Python 2 for now); and
+# don't make the Python package dependent on the virtualenv package
+# processing (noawait)
+interest-noawait /usr/bin/python3.6
+interest-noawait /usr/bin/python3.7
+interest-noawait /usr/bin/python3.8
+interest-noawait /usr/bin/python3.9
+
+# Also provide a symbolic trigger for all dh-virtualenv packages
+interest dh-virtualenv-interpreter-update
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..83ba5db
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@ --with python-virtualenv
+
+override_dh_virtualenv:
+	dh_virtualenv --python python3 --extra-pip-arg "--no-deps" --use-system-packages
-- 
GitLab