Skip to content

Commit

Permalink
chore(debian): introduce mtda-client and mtda-service packages
Browse files Browse the repository at this point in the history
Signed-off-by: Cedric Hombourger <[email protected]>
  • Loading branch information
chombourger committed Jan 21, 2024
1 parent 9e74820 commit 8bb884f
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.pybuild
.tox
*.buildinfo
*.changes
*.img
*.pyc
*.swp
Expand Down
3 changes: 3 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
76 changes: 51 additions & 25 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
46 changes: 29 additions & 17 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
:
Expand All @@ -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

0 comments on commit 8bb884f

Please sign in to comment.