From 8bb884f6b1d6e3481a9b07d3922fe5d4c8e777a7 Mon Sep 17 00:00:00 2001 From: Cedric Hombourger Date: Sun, 21 Jan 2024 17:55:59 +0100 Subject: [PATCH] chore(debian): introduce mtda-client and mtda-service packages Signed-off-by: Cedric Hombourger --- .gitignore | 2 + debian/.gitignore | 3 + debian/control | 76 +++++++++++++------ .../{mtda.postinst => mtda-service.postinst} | 0 debian/{mtda.prerm => mtda-service.prerm} | 0 debian/rules | 46 ++++++----- 6 files changed, 85 insertions(+), 42 deletions(-) rename debian/{mtda.postinst => mtda-service.postinst} (100%) rename debian/{mtda.prerm => mtda-service.prerm} (100%) diff --git a/.gitignore b/.gitignore index 704dec8a..b73c5d38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .pybuild .tox +*.buildinfo +*.changes *.img *.pyc *.swp diff --git a/debian/.gitignore b/debian/.gitignore index 564dded1..e1f17aa5 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -4,9 +4,12 @@ debhelper-build-stamp files mtda +mtda-client +mtda-common mtda-config mtda-docker mtda-kvm mtda-pytest +mtda-service mtda-ui mtda-www diff --git a/debian/control b/debian/control index 146aa007..500509f7 100644 --- a/debian/control +++ b/debian/control @@ -14,25 +14,8 @@ X-Python3-Version: >= 3.7 Package: mtda Architecture: all Multi-Arch: foreign -Depends: python3:any (>= 3.7~), - python3-boto3, - python3-daemon, - python3-gevent, - python3-libgpiod, - python3-psutil, - python3-requests, - python3-serial, - python3-systemd, - python3-usb, - python3-zeroconf, - python3-zerorpc, - python3-zmq, - python3-zstandard, - usbrelay, - wamerican, - ${misc:Depends} -Replaces: mtda-usb-functions -Suggests: nbd-server +Depends: mtda-client, + mtda-service Description: Multi-Tenant Device Access Multi-Tenant Device Access (or MTDA for short) is a relatively small Python application and library acting as an interface @@ -41,10 +24,30 @@ Description: Multi-Tenant Device Access plug USB devices in or out (also requiring special hardware) or simply access its console (in most cases serial). +Package: mtda-client +Architecture: all +Multi-Arch: foreign +Depends: mtda-common, + python3-boto3, + wamerican, + ${misc:Depends} +Suggests: nbd-client +Description: CLI for Multi-Tenant Device Access + Provide a simple command line interface to interact with a + MTDA instance over the network. + +Package: mtda-common +Architecture: all +Multi-Arch: foreign +Depends: python3:any (>= 3.7~), + python3-zerorpc +Description: common modules for Multi-Tenant Device Access + Modules shared between the service and the client. + Package: mtda-config Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-service, python3-kconfiglib, python3-urwid Description: Tool to configure MTDA @@ -53,7 +56,7 @@ Description: Tool to configure MTDA Package: mtda-docker Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-service, docker-ce | docker.io, python3-docker Description: control docker containers using MTDA @@ -63,7 +66,7 @@ Description: control docker containers using MTDA Package: mtda-kvm Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-service, qemu-kvm Description: KVM machine managed by MTDA Provide a KVM machine with a MTDA interface to control its @@ -72,16 +75,39 @@ Description: KVM machine managed by MTDA Package: mtda-pytest Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-client, python3-pytest Description: support for pytest code that uses MTDA Provide helper classes to write tests with the pytest and MTDA frameworks. +Package: mtda-service +Architecture: all +Multi-Arch: foreign +Depends: mtda-common, + python3-daemon, + python3-gevent, + python3-libgpiod, + python3-psutil, + python3-requests, + python3-serial, + python3-systemd, + python3-usb, + python3-zeroconf, + python3-zmq, + python3-zstandard, + usbrelay, + ${misc:Depends} +Replaces: mtda-usb-functions +Suggests: nbd-server +Description: Multi-Tenant Device Access service + Provide the infrastructure for running MTDA as a systemd + service. + Package: mtda-ui Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-client, python3-py3qterm, python3-pyqt5.qtmultimedia Description: a simple user-interface for MTDA @@ -91,7 +117,7 @@ Description: a simple user-interface for MTDA Package: mtda-www Architecture: all Multi-Arch: foreign -Depends: mtda, +Depends: mtda-service, python3-flask-socketio, python3-gevent-websocket, novnc, diff --git a/debian/mtda.postinst b/debian/mtda-service.postinst similarity index 100% rename from debian/mtda.postinst rename to debian/mtda-service.postinst diff --git a/debian/mtda.prerm b/debian/mtda-service.prerm similarity index 100% rename from debian/mtda.prerm rename to debian/mtda-service.prerm diff --git a/debian/rules b/debian/rules index cbae1c1a..e2f274e5 100755 --- a/debian/rules +++ b/debian/rules @@ -13,31 +13,43 @@ override_dh_auto_install: dh_auto_install : rm -rf debian/mtda + rm -rf debian/mtda-client + rm -rf debian/mtda-common rm -rf debian/mtda-config rm -rf debian/mtda-docker rm -rf debian/mtda-kvm rm -rf debian/mtda-pytest + rm -rf debian/mtda-service rm -rf debian/mtda-ui # lintian package-installs-python-pycache-dir find debian -name "__pycache__" -type f -delete : - install -m 0755 -d debian/mtda - mv debian/tmp/usr debian/mtda/ - install -m 0755 -d debian/mtda/usr/sbin - mv debian/mtda/usr/bin/mtda-service debian/mtda/usr/sbin/ - mv debian/mtda/usr/bin/mtda-systemd-helper debian/mtda/usr/sbin/ + install -m 0755 -d debian/mtda-service + mv debian/tmp/usr debian/mtda-service/ + install -m 0755 -d debian/mtda-service/usr/sbin + mv debian/mtda-service/usr/bin/mtda-service debian/mtda-service/usr/sbin/ + mv debian/mtda-service/usr/bin/mtda-systemd-helper debian/mtda-service/usr/sbin/ + : + install -m 0755 -d debian/mtda-client/usr/bin + mv debian/mtda-service/usr/bin/mtda-cli debian/mtda-client/usr/bin/ + install -m 0755 -d debian/mtda-client$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/client.py debian/mtda-client$(MTDA_DIST)/ + : + install -m 0755 -d debian/mtda-common$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/constants.py debian/mtda-common$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/main.py debian/mtda-common$(MTDA_DIST)/ : install -m 0755 -d debian/mtda-config/usr/sbin install -m 0755 -d debian/mtda-config/var/lib/mtda/ - mv debian/mtda/usr/bin/mtda-config debian/mtda-config/usr/sbin/ + mv debian/mtda-service/usr/bin/mtda-config debian/mtda-config/usr/sbin/ install -m 0644 Kconfig debian/mtda-config/var/lib/mtda/Kconfig : install -m 0755 -d debian/mtda-docker$(MTDA_DIST)/console install -m 0755 -d debian/mtda-docker$(MTDA_DIST)/power install -m 0755 -d debian/mtda-docker$(MTDA_DIST)/storage - mv debian/mtda$(MTDA_DIST)/console/docker.py debian/mtda-docker$(MTDA_DIST)/console/ - mv debian/mtda$(MTDA_DIST)/power/docker.py debian/mtda-docker$(MTDA_DIST)/power/ - mv debian/mtda$(MTDA_DIST)/storage/docker.py debian/mtda-docker$(MTDA_DIST)/storage/ + mv debian/mtda-service$(MTDA_DIST)/console/docker.py debian/mtda-docker$(MTDA_DIST)/console/ + mv debian/mtda-service$(MTDA_DIST)/power/docker.py debian/mtda-docker$(MTDA_DIST)/power/ + mv debian/mtda-service$(MTDA_DIST)/storage/docker.py debian/mtda-docker$(MTDA_DIST)/storage/ install -m 0755 -d debian/mtda-docker/usr/share/doc/mtda-docker/examples/ install -m 0644 configs/docker.ini debian/mtda-docker/usr/share/doc/mtda-docker/examples/mtda.ini : @@ -47,26 +59,26 @@ override_dh_auto_install: install -m 0644 configs/qemu-ovmf-vars.fd debian/mtda-kvm/var/lib/mtda/ : install -m 0755 -d debian/mtda-pytest$(MTDA_DIST)/ - mv debian/mtda$(MTDA_DIST)/pytest.py debian/mtda-pytest$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/pytest.py debian/mtda-pytest$(MTDA_DIST)/ : install -m 0755 -d debian/mtda-ui/usr/bin - mv debian/mtda/usr/bin/mtda-ui debian/mtda-ui/usr/bin/ + mv debian/mtda-service/usr/bin/mtda-ui debian/mtda-ui/usr/bin/ : install -m 0755 -d debian/mtda-www$(MTDA_DIST)/ install -m 0755 -d debian/mtda-www/etc/mtda/config.d/ - mv debian/mtda$(MTDA_DIST)/assets debian/mtda-www$(MTDA_DIST)/ - mv debian/mtda$(MTDA_DIST)/templates debian/mtda-www$(MTDA_DIST)/ - mv debian/mtda$(MTDA_DIST)/www.py debian/mtda-www$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/assets debian/mtda-www$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/templates debian/mtda-www$(MTDA_DIST)/ + mv debian/mtda-service$(MTDA_DIST)/www.py debian/mtda-www$(MTDA_DIST)/ install -m 0644 configs/10-www.conf debian/mtda-www/etc/mtda/config.d/ override_dh_systemd_enable: - dh_systemd_enable + dh_systemd_enable --name=mtda dh_systemd_enable --name=mtda-config override_dh_installsystemd: - dh_installsystemd + dh_installsystemd --name=mtda dh_installsystemd --name=mtda-config override_dh_systemd_start: - dh_systemd_start + dh_systemd_start --name=mtda dh_systemd_start --name=mtda-config