Skip to content

Commit

Permalink
debian: add packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
fepitre committed Jun 16, 2020
1 parent e73015e commit 6fce1a9
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 47 deletions.
45 changes: 20 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 $@ $<
Expand All @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions Makefile.builder
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
RPM_SPEC_FILES := rpm_spec/qmgr.spec
DEBIAN_BUILD_DIRS := debian
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
qubes-manager (4.1.9-1) unstable; urgency=medium

Initial commit

-- Frédéric Pierret (fepitre) <[email protected]> Sun, 14 Jun 2020 10:00:00 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
35 changes: 35 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Source: qubes-manager
Section: admin
Priority: optional
Maintainer: Frédéric Pierret (fepitre) <[email protected]>
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
22 changes: 22 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: qubes-manager
Source: <http://www.qubes-os.org/>

Files: debian/*
Copyright: 2020 Frédéric Pierret (fepitre) <[email protected]> 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 <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
22 changes: 22 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions rel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
25 changes: 3 additions & 22 deletions rpm_spec/qmgr.spec.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 || :
Expand Down

0 comments on commit 6fce1a9

Please sign in to comment.