From d8de88b743612000515fb1adeee95b721d139da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Tue, 16 Jun 2020 14:52:28 +0200 Subject: [PATCH] debian: add packaging QubesOS/qubes-issues#4186 --- .gitignore | 1 + Makefile | 48 +++++++++++++-------------- Makefile.builder | 1 + debian/changelog | 5 +++ debian/compat | 1 + debian/control | 35 ++++++++++++++++++++ debian/copyright | 22 +++++++++++++ debian/install | 76 +++++++++++++++++++++++++++++++++++++++++++ debian/postinst | 11 +++++++ debian/postrm | 11 +++++++ debian/rules | 18 ++++++++++ debian/source/format | 1 + rel | 1 + rpm_spec/qmgr.spec.in | 25 ++------------ 14 files changed, 209 insertions(+), 47 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 rel diff --git a/.gitignore b/.gitignore index c6b361d..dc443f4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *~ rpm/ pkgs/ +debian/changelog.* diff --git a/Makefile b/Makefile index 3be19ce..d063c73 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,11 @@ -RPMS_DIR=rpm/ VERSION := $(shell cat version) PYTHON ?= python3 -help: - @echo "make rpms -- generate binary rpm packages" - @echo "make res -- compile resources" - @echo "make update-repo-current -- copy newly generated rpms to qubes yum repo" - @echo "make update-repo-unstable -- same, but to -testing repo" - @echo "make update-repo-installer -- copy dom0 rpms to installer repo" +LRELEASE_QT5 ?= $(if $(wildcard /etc/debian_version),lrelease,lrelease-qt5) - -rpms: rpms-dom0 - -rpms-vm: - -rpms-dom0: - rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/qmgr.spec - rpm --addsign $(RPMS_DIR)/x86_64/qubes-manager*$(VERSION)*.rpm +SETUPTOOLS_OPTS = +SETUPTOOLS_OPTS += $(if $(wildcard /etc/debian_version),--install-layout=deb,) qubesmanager/ui_%.py: ui/%.ui pyuic5 --from-imports -o $@ $< @@ -28,28 +16,38 @@ res: pyrcc5 -o qubesmanager/resources_rc.py resources.qrc translations: - lrelease-qt5 qubesmanager.pro + $(LRELEASE_QT5) qubesmanager.pro python: $(PYTHON) ./setup.py build python_install: - $(PYTHON) ./setup.py install -O1 --skip-build --root $(DESTDIR) + $(PYTHON) ./setup.py install -O1 --skip-build --root $(DESTDIR) $(SETUPTOOLS_OPTS) update_ts: res pylupdate5 qubesmanager.pro -update-repo-current: - ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../yum/current-release/current/dom0/rpm/ +install: + mkdir -p $(DESTDIR)/usr/libexec/qubes-manager/ + cp qubesmanager/mount_for_backup.sh $(DESTDIR)/usr/libexec/qubes-manager/ + cp qubesmanager/qvm_about.sh $(DESTDIR)/usr/libexec/qubes-manager/ + cp qubesmanager/dsa-4371-update $(DESTDIR)/usr/libexec/qubes-manager/ -update-repo-current-testing: - ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../yum/current-release/current-testing/dom0/rpm/ + mkdir -p $(DESTDIR)/usr/share/applications + cp qubes-global-settings.desktop $(DESTDIR)/usr/share/applications/ + cp qubes-vm-create.desktop $(DESTDIR)/usr/share/applications/ + cp qubes-backup.desktop $(DESTDIR)/usr/share/applications/ + cp qubes-backup-restore.desktop $(DESTDIR)/usr/share/applications/ + cp qubes-qube-manager.desktop $(DESTDIR)/usr/share/applications/ + cp qubes-template-manager.desktop $(DESTDIR)/usr/share/applications/ -update-repo-unstable: - ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../yum/current-release/unstable/dom0/rpm/ + mkdir -p $(DESTDIR)/usr/share/desktop-directories/ + cp qubes-tools.directory $(DESTDIR)/usr/share/desktop-directories/ -update-repo-installer: - ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../installer/yum/qubes-dom0/rpm/ + mkdir -p $(DESTDIR)/etc/xdg/menus/applications-merged/ + cp qubes-tools.menu $(DESTDIR)/etc/xdg/menus/applications-merged/ clean: rm -f qubesmanager/ui_*.py + rm -rf debian/changelog.* + rm -rf pkgs diff --git a/Makefile.builder b/Makefile.builder index 44e0fde..de1630b 100644 --- a/Makefile.builder +++ b/Makefile.builder @@ -1 +1,2 @@ RPM_SPEC_FILES := rpm_spec/qmgr.spec +DEBIAN_BUILD_DIRS := debian \ No newline at end of file diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..765b6fc --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +qubes-manager (4.1.9-1) unstable; urgency=medium + + Initial commit + + -- Frédéric Pierret (fepitre) Sun, 14 Jun 2020 10:00:00 +0200 \ No newline at end of file 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..d5bdd5b --- /dev/null +++ b/debian/control @@ -0,0 +1,35 @@ +Source: qubes-manager +Section: admin +Priority: optional +Maintainer: Frédéric Pierret (fepitre) +Build-Depends: + debhelper (>= 9), + dh-python, + python3-all, + python3-setuptools, + qt5-default, + qttools5-dev-tools, + pyqt5-dev-tools +Standards-Version: 4.3.0 +Homepage: https://www.qubes-os.org/ +#Vcs-Git: git://github.com/QubesOS/qubes-manager.git +#Vcs-Browser: https://github.com/QubesOS/qubes-manager +X-Python3-Version: >= 3.4 + +Package: qubes-manager +Architecture: any +Depends: + python3-qubesadmin, + python3-pyqt5, + python3-pyinotify, + python3-quamash, + qubes-desktop-linux-common, + qubes-artwork, + pmount, + cryptsetup, + wmctrl, + ${python3:Depends}, + ${misc:Depends} +Conflicts: qubes-core-agent (<< 4.1.9) +Description: Qubes administrative tools + Tools to manage Qubes system using Admin API \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d55dc51 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,22 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: qubes-manager +Source: + +Files: debian/* +Copyright: 2020 Frédéric Pierret (fepitre) License: GPL-2+ +License: GPL-2+ + This package 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 2 of the License, or + (at your option) any later version. + . + This package 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 + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". \ No newline at end of file diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..23e730d --- /dev/null +++ b/debian/install @@ -0,0 +1,76 @@ +/usr/bin/qubes-global-settings +/usr/bin/qubes-vm-settings +/usr/bin/qubes-vm-create +/usr/bin/qubes-vm-boot-from-device +/usr/bin/qubes-backup +/usr/bin/qubes-backup-restore +/usr/bin/qubes-qube-manager +/usr/bin/qubes-log-viewer +/usr/bin/qubes-template-manager +/usr/libexec/qubes-manager/mount_for_backup.sh +/usr/libexec/qubes-manager/qvm_about.sh +/usr/libexec/qubes-manager/dsa-4371-update + +/usr/lib/*/dist-packages/qubesmanager/__pycache__ +/usr/lib/*/dist-packages/qubesmanager/__init__.py +/usr/lib/*/dist-packages/qubesmanager/clipboard.py +/usr/lib/*/dist-packages/qubesmanager/table_widgets.py +/usr/lib/*/dist-packages/qubesmanager/appmenu_select.py +/usr/lib/*/dist-packages/qubesmanager/backup.py +/usr/lib/*/dist-packages/qubesmanager/backup_utils.py +/usr/lib/*/dist-packages/qubesmanager/firewall.py +/usr/lib/*/dist-packages/qubesmanager/global_settings.py +/usr/lib/*/dist-packages/qubesmanager/multiselectwidget.py +/usr/lib/*/dist-packages/qubesmanager/restore.py +/usr/lib/*/dist-packages/qubesmanager/settings.py +/usr/lib/*/dist-packages/qubesmanager/log_dialog.py +/usr/lib/*/dist-packages/qubesmanager/about.py +/usr/lib/*/dist-packages/qubesmanager/releasenotes.py +/usr/lib/*/dist-packages/qubesmanager/informationnotes.py +/usr/lib/*/dist-packages/qubesmanager/create_new_vm.py +/usr/lib/*/dist-packages/qubesmanager/common_threads.py +/usr/lib/*/dist-packages/qubesmanager/qube_manager.py +/usr/lib/*/dist-packages/qubesmanager/utils.py +/usr/lib/*/dist-packages/qubesmanager/bootfromdevice.py +/usr/lib/*/dist-packages/qubesmanager/device_list.py +/usr/lib/*/dist-packages/qubesmanager/template_manager.py + +/usr/lib/*/dist-packages/qubesmanager/resources_rc.py + +/usr/lib/*/dist-packages/qubesmanager/ui_backupdlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_bootfromdevice.py +/usr/lib/*/dist-packages/qubesmanager/ui_globalsettingsdlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_multiselectwidget.py +/usr/lib/*/dist-packages/qubesmanager/ui_newappvmdlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_newfwruledlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_restoredlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_settingsdlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_logdlg.py +/usr/lib/*/dist-packages/qubesmanager/ui_about.py +/usr/lib/*/dist-packages/qubesmanager/ui_releasenotes.py +/usr/lib/*/dist-packages/qubesmanager/ui_informationnotes.py +/usr/lib/*/dist-packages/qubesmanager/ui_qubemanager.py +/usr/lib/*/dist-packages/qubesmanager/ui_devicelist.py +/usr/lib/*/dist-packages/qubesmanager/ui_templatemanager.py +/usr/lib/*/dist-packages/qubesmanager/i18n/qubesmanager_*.qm +/usr/lib/*/dist-packages/qubesmanager/i18n/qubesmanager_*.ts + +/usr/lib/*/dist-packages/qubesmanager/tests/__pycache__ +/usr/lib/*/dist-packages/qubesmanager/tests/__init__.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_backup.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_backup_utils.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_global_settings.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_qube_manager.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_create_new_vm.py +/usr/lib/*/dist-packages/qubesmanager/tests/test_vm_settings.py + +/usr/lib/*/dist-packages/qubesmanager-*.egg-info/* + +/usr/share/applications/qubes-global-settings.desktop +/usr/share/applications/qubes-vm-create.desktop +/usr/share/applications/qubes-backup.desktop +/usr/share/applications/qubes-backup-restore.desktop +/usr/share/applications/qubes-qube-manager.desktop +/usr/share/applications/qubes-template-manager.desktop +/usr/share/desktop-directories/qubes-tools.directory +/etc/xdg/menus/applications-merged/qubes-tools.menu \ No newline at end of file diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..f6c7514 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + update-desktop-database &> /dev/null || : +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..5a7d027 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ]; then + update-desktop-database &> /dev/null || : +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e46bfc4 --- /dev/null +++ b/debian/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/default.mk +export DESTDIR=$(shell pwd)/debian/tmp + +%: + dh $@ + +override_dh_auto_build: + make ui res translations + make python + +override_dh_auto_install: + make python_install + make install + +override_dh_install: + dh_install --fail-missing \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/rel b/rel new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rel @@ -0,0 +1 @@ +1 diff --git a/rpm_spec/qmgr.spec.in b/rpm_spec/qmgr.spec.in index 480c674..a157aba 100644 --- a/rpm_spec/qmgr.spec.in +++ b/rpm_spec/qmgr.spec.in @@ -1,6 +1,6 @@ Name: qubes-manager Version: @VERSION@ -Release: 1%{?dist} +Release: @REL@%{?dist} Summary: The Graphical Qubes VM Manager. BuildArch: noarch Group: Qubes @@ -40,27 +40,8 @@ make ui res translations make python %install -make python_install \ - DESTDIR=$RPM_BUILD_ROOT - -mkdir -p $RPM_BUILD_ROOT/usr/libexec/qubes-manager/ -cp qubesmanager/mount_for_backup.sh $RPM_BUILD_ROOT/usr/libexec/qubes-manager/ -cp qubesmanager/qvm_about.sh $RPM_BUILD_ROOT/usr/libexec/qubes-manager/ -cp qubesmanager/dsa-4371-update $RPM_BUILD_ROOT/usr/libexec/qubes-manager/ - -mkdir -p $RPM_BUILD_ROOT/usr/share/applications -cp qubes-global-settings.desktop $RPM_BUILD_ROOT/usr/share/applications/ -cp qubes-vm-create.desktop $RPM_BUILD_ROOT/usr/share/applications/ -cp qubes-backup.desktop $RPM_BUILD_ROOT/usr/share/applications/ -cp qubes-backup-restore.desktop $RPM_BUILD_ROOT/usr/share/applications/ -cp qubes-qube-manager.desktop $RPM_BUILD_ROOT/usr/share/applications/ -cp qubes-template-manager.desktop $RPM_BUILD_ROOT/usr/share/applications/ - -mkdir -p $RPM_BUILD_ROOT/usr/share/desktop-directories/ -cp qubes-tools.directory $RPM_BUILD_ROOT/usr/share/desktop-directories/ - -mkdir -p $RPM_BUILD_ROOT/etc/xdg/menus/applications-merged/ -cp qubes-tools.menu $RPM_BUILD_ROOT/etc/xdg/menus/applications-merged/ +make python_install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT %post update-desktop-database &> /dev/null || :