From 61fd9f95f96675034e92508ce04dc233b28965f8 Mon Sep 17 00:00:00 2001 From: Simon McVittie <simon.mcvittie@collabora.co.uk> Date: Tue, 5 Jul 2016 18:05:10 +0100 Subject: [PATCH] debian: generate correct dependencies on python, python3 Closes: https://phabricator.apertis.org/T2059 Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Differential Revision: https://phabricator.apertis.org/D3561 --- debian/control | 29 ++++++++++++++++++---- debian/rules | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index dd695ff..6350cc9 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: autopoint, debhelper (>= 9), dh-apparmor, + dh-python, libclutter-1.0-dev, libclutter-gst-3.0-dev, libfolks-dev, @@ -23,14 +24,18 @@ Build-Depends: pkg-config, python, python-yaml, - valac + python3, + valac, Standards-Version: 3.9.6 Vcs-Browser: https://git.apertis.org/cgit/apertis-tests.git/ Vcs-Git: https://git.apertis.org/git/apertis-tests.git Package: apertis-tests Architecture: all -Depends: ${misc:Depends} +Depends: + ${misc:Depends}, + ${python3:Depends}, + ${python:Depends}, Description: automated and manual test definitions This package installs test scripts, test data and other pieces of automated and manual tests. @@ -45,6 +50,8 @@ Package: apertis-tests-bin Architecture: any Depends: ${misc:Depends}, + ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, Description: automated and manual test executables This package installs compiled executables that have no shared library @@ -70,7 +77,8 @@ Depends: apparmor (>= 2.8.0-0ubuntu5co4), ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, - ${python3:Depends} + ${python3:Depends}, + ${python:Depends}, Description: Functional tests for Chaiwala specific features This package tests Chaiwala specific features and requirement which are not necessarely the same of AppArmor upstream tests (although some tests might be @@ -103,6 +111,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -120,6 +129,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -138,6 +148,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -154,6 +165,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -171,6 +183,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -189,6 +202,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apparmor (>= 2.8.0-0ubuntu5co4), @@ -206,6 +220,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -224,6 +239,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -244,6 +260,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -262,6 +279,7 @@ Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, + ${python:Depends}, ${shlibs:Depends}, apertis-tests, apertis-tests-apparmor-report, @@ -275,7 +293,10 @@ Description: Functional tests for PulseAudio AppArmor profiles/abstractions Package: chaiwala-tests Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, +Depends: ${misc:Depends}, + ${python3:Depends}, + ${python:Depends}, + ${shlibs:Depends}, apertis-tests, apertis-tests-bin, libglib2.0-bin, binutils, diff --git a/debian/rules b/debian/rules index c3645b3..4b93e79 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,73 @@ #!/usr/bin/make -f %: - dh $@ -- + dh $@ \ + --with python2 \ + --with python3 \ + $(NULL) override_dh_auto_install: dh_auto_install --destdir=debian/tmp override_dh_install: dh_install --fail-missing + +# Do not attempt to parse Python 3 scripts: not all of our scripts are +# python-2-compatible. +# Do not rename *.so as though they were Python extensions: they aren't. +override_dh_python2: + dh_python2 \ + -Nchaiwala-tests \ + -X '.*/apertis_tests_lib/bluez.py' \ + -X '.*/bluez/bluez-test' \ + -v \ + --no-ext-rename \ + /usr/lib/apertis-tests + dh_python2 -pchaiwala-tests \ + -v \ + --no-ext-rename \ + /usr/lib/chaiwala-tests \ + $(NULL) + dh_python2 -pchaiwala-tests \ + -v \ + --no-ext-rename \ + /usr/share/chaiwala-tests \ + $(NULL) + +# Do not attempt to parse Python 2 scripts: not all of our scripts are +# python3-compatible yet. +# Do not rename *.so as though they were Python extensions: they aren't. +override_dh_python3: + dh_python3 \ + -Nchaiwala-tests \ + -X '.*/apparmor/dbus/dbus-client.py' \ + -X '.*/apparmor/dbus/dbus-server.py' \ + -X '.*/boot-performance/automated/run-test.py' \ + -X '.*/connman/connman-test-service.py' \ + -X '.*/connman/connman-test.py' \ + -X '.*/dbus/dos-match-rules/match-rules.py' \ + -X '.*/gstreamer-decode/gstreamer-decode.py' \ + -X '.*/gstreamer-decode/gstreamer1.0-decode.py' \ + -X '.*/rfkill-toggle/rfkill-toggle.py' \ + -X '.*/traffic-control/manual/client.py' \ + -v \ + --no-ext-rename \ + /usr/lib/apertis-tests \ + $(NULL) + dh_python3 -pchaiwala-tests \ + -X '.*/connman/connman-test-service.py' \ + -X '.*/connman/connman-test.py' \ + -X '.*/gstreamer-decode/gstreamer-decode.py' \ + -X '.*/gstreamer-decode/gstreamer1.0-decode.py' \ + -X '.*/rfkill-toggle/rfkill-toggle.py' \ + -v \ + --no-ext-rename \ + /usr/lib/chaiwala-tests \ + $(NULL) + dh_python3 -pchaiwala-tests \ + -X '.*/boot-performance/automated/run-test.py' \ + -X '.*/traffic-control/manual/client.py' \ + -v \ + --no-ext-rename \ + /usr/share/chaiwala-tests \ + $(NULL) -- GitLab