From 6fce1a9fdf772b50f666f02aba8950c665581bb5 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 --- Makefile | 45 +++++++++++++++++++------------------------ Makefile.builder | 1 + debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 35 +++++++++++++++++++++++++++++++++ debian/copyright | 22 +++++++++++++++++++++ debian/rules | 22 +++++++++++++++++++++ debian/source/format | 1 + rel | 1 + rpm_spec/qmgr.spec.in | 25 +++--------------------- 10 files changed, 111 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 100755 debian/rules create mode 100644 debian/source/format create mode 100644 rel diff --git a/Makefile b/Makefile index 3be19ce5..b53e4869 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,8 @@ -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" - - -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 +LRELEASE_QT5 ?= $(if $(wildcard /etc/debian_version),lrelease,lrelease-qt5) qubesmanager/ui_%.py: ui/%.ui pyuic5 --from-imports -o $@ $< @@ -28,7 +13,7 @@ res: pyrcc5 -o qubesmanager/resources_rc.py resources.qrc translations: - lrelease-qt5 qubesmanager.pro + $(LRELEASE_QT5) qubesmanager.pro python: $(PYTHON) ./setup.py build @@ -39,17 +24,27 @@ python_install: 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 44e0fde7..de1630b5 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 00000000..765b6fc9 --- /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 00000000..f599e28b --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..d5bdd5bf --- /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 00000000..d55dc512 --- /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/rules b/debian/rules new file mode 100755 index 00000000..52a27dc9 --- /dev/null +++ b/debian/rules @@ -0,0 +1,22 @@ +#!/usr/bin/make -f + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +export PYBUILD_NAME = qubesmanager +export DESTDIR=$(shell pwd)/debian/tmp + +%: + dh $@ --with python3 --buildsystem=pybuild + +override_dh_auto_build: + make ui res translations + make python + +override_dh_auto_install: + make python_install + make install + +override_dh_clean: + dh_clean -O--buildsystem=pybuild + make clean diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/rel b/rel new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/rel @@ -0,0 +1 @@ +1 diff --git a/rpm_spec/qmgr.spec.in b/rpm_spec/qmgr.spec.in index 480c674e..a157abae 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 || :