From 79650f0c4c4455b3a5b89496fe638d773801d7ba Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Tue, 10 Feb 2015 10:40:51 -0500 Subject: [PATCH] debian: Converted debian package to a quilt package to allow patches Applied patch to qrexec Makefile to prevent compile failure on warnings qrexec: Disable all warnings being treated as errors gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I. -g -Wall -Wextra -Werror -pie -fPIC `pkg-config --cflags vchan-xen` -D_FORTIFY_SOURCE=2 -c -o qrexec-agent-data.o qrexec-agent-data.c qrexec-agent-data.c: In function 'handle_remote_data': qrexec-agent-data.c:217:17: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] status = *(unsigned int *)buf; ^ cc1: all warnings being treated as errors : recipe for target 'qrexec-agent-data.o' failed --- Makefile | 4 + debian/README.configuration | 77 +++++++++++++++++++ debian/changelog | 2 +- debian/control | 4 +- ...rexec_disable_all_warnings_as_errors.patch | 19 +++++ debian/patches/series | 1 + debian/rules | 5 +- debian/source/format | 2 +- 8 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 debian/README.configuration create mode 100644 debian/patches/qrexec_disable_all_warnings_as_errors.patch create mode 100644 debian/patches/series diff --git a/Makefile b/Makefile index 4068121..3f68d04 100644 --- a/Makefile +++ b/Makefile @@ -191,6 +191,10 @@ install-common: install -d $(DESTDIR)/home_volatile/user install -d $(DESTDIR)/rw +# Create a quilt orig package so we can build xen in Debian +dist: + tar cvfz "../qubes-core-agent_$(VERSION).orig.tar.gz" --exclude-vcs --exclude=debian . + install-deb: mkdir -p $(DESTDIR)/etc/apt/sources.list.d sed -e "s/@DIST@/`lsb_release -cs`/" misc/qubes-r3.list.in > $(DESTDIR)/etc/apt/sources.list.d/qubes-r3.list diff --git a/debian/README.configuration b/debian/README.configuration new file mode 100644 index 0000000..e36e514 --- /dev/null +++ b/debian/README.configuration @@ -0,0 +1,77 @@ +Debian Packaging Guide +---------------------- +https://www.debian.org/doc/manuals/maint-guide/first.en.html + + +=============================================================================== + Bash.rc +=============================================================================== +# Assume usename 'user' running this, otherwise +# /home/user/.bashrc +cat >>~/.bashrc <<'EOF' +DEBMAIL="user@chroot.local" +DEBFULLNAME="Qubes Builder" +export DEBMAIL DEBFULLNAME + +alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg" +complete -F _quilt_completion $_quilt_complete_opt dquilt +EOF + + +=============================================================================== + Quilt RC +=============================================================================== +cat >>~/.quiltrc-dpkg <<'EOF' +d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done +if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then + # if in Debian packaging tree with unset $QUILT_PATCHES + QUILT_PATCHES="debian/patches" + QUILT_PATCH_OPTS="--reject-format=unified" + QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto" + QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index" + QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33" + if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi +fi +EOF + +=============================================================================== + Create a fresh Debian configuration +=============================================================================== +apt-get dh-make + +# Example +$ cd ~/gentoo +$ wget http://example.org/gentoo-0.9.12.tar.gz +$ tar -xvzf gentoo-0.9.12.tar.gz +$ cd gentoo-0.9.12 +$ dh_make -f ../gentoo-0.9.12.tar.gz + + +=============================================================================== + Adding Patches +=============================================================================== +https://www.debian.org/doc/manuals/maint-guide/modify.en.html + +# When anyone (including yourself) provides a patch foo.patch to the source +# later, modifying a 3.0 (quilt) source package is quite simple: +$ dpkg-source -x gentoo_0.9.12.dsc +$ cd gentoo-0.9.12 +$ dquilt import ../foo.patch +$ dquilt push +$ dquilt refresh +$ dquilt header -e +... describe patch + + + +=============================================================================== + Other +=============================================================================== +# To list all dh_ modules... +man -k dh_ + +# To indicate what build-depends are required! +dpkg-depcheck -d ./configure + +# Test build (unsigned) +dpkg-buildpackage -us -uc diff --git a/debian/changelog b/debian/changelog index 5a211fc..90cf085 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -qubes-core-agent (3.0.0) jessie; urgency=medium +qubes-core-agent (3.0.0-1) jessie; urgency=medium [ Marek Marczykowski-Górecki ] * Improve handling of .desktop files diff --git a/debian/control b/debian/control index 6793733..019cf62 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,8 @@ Source: qubes-core-agent Section: admin Priority: extra Maintainer: Davíð Steinn Geirsson -Build-Depends: qubes-utils (>= 2.0.17), libvchan-xen-dev, python, debhelper, quilt, libxen-dev, dh-systemd (>= 1.5) -Standards-Version: 3.9.3 +Build-Depends: qubes-utils (>= 2.0.17), libvchan-xen-dev, python, debhelper, quilt, libxen-qubes-vm-dev, dh-systemd (>= 1.5) +Standards-Version: 3.9.5 Homepage: http://www.qubes-os.org Vcs-Git: git://git.qubes-os.org/marmarek/core-agent-linux.git diff --git a/debian/patches/qrexec_disable_all_warnings_as_errors.patch b/debian/patches/qrexec_disable_all_warnings_as_errors.patch new file mode 100644 index 0000000..f339717 --- /dev/null +++ b/debian/patches/qrexec_disable_all_warnings_as_errors.patch @@ -0,0 +1,19 @@ +qrexec: Disable all warnings being treated as errors + +gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I. -g -Wall -Wextra -Werror -pie -fPIC `pkg-config --cflags vchan-xen` -D_FORTIFY_SOURCE=2 -c -o qrexec-agent-data.o qrexec-agent-data.c +qrexec-agent-data.c: In function 'handle_remote_data': +qrexec-agent-data.c:217:17: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] + status = *(unsigned int *)buf; + ^ +cc1: all warnings being treated as errors +: recipe for target 'qrexec-agent-data.o' failed + +--- a/qrexec/Makefile ++++ b/qrexec/Makefile +@@ -1,5 +1,5 @@ + CC=gcc +-CFLAGS+=-I. -g -Wall -Wextra -Werror -pie -fPIC `pkg-config --cflags vchan-$(BACKEND_VMM)` ++CFLAGS+=-I. -g -Wall -Wextra -pie -fPIC `pkg-config --cflags vchan-$(BACKEND_VMM)` + LIBS=`pkg-config --libs vchan-$(BACKEND_VMM)` -lqrexec-utils + + all: qrexec-agent qrexec-client-vm diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..05ecef2 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +qrexec_disable_all_warnings_as_errors.patch diff --git a/debian/rules b/debian/rules index ff4db5c..f9b13cf 100755 --- a/debian/rules +++ b/debian/rules @@ -4,10 +4,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + export DESTDIR=$(shell pwd)/debian/qubes-core-agent %: - dh $@ --with systemd + dh $@ --with systemd --with autotools-dev override_dh_auto_build: make all diff --git a/debian/source/format b/debian/source/format index 89ae9db..163aaf8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt)