From: Tim Deegan Subject: Re: [PATCH] Build target to wrap dist/install in a .deb archive Date: Mon, 16 May 2011 11:50:31 +0100 Message-ID: <20110516105031.GS24068@whitby.uk.xensource.com> References: <3e557227ab5055024ca8.1305127944@whitby.uk.xensource.com> <20110511212331.GA27544@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bKyqfOwhbdpXa4YI" Return-path: Content-Disposition: inline In-Reply-To: <20110511212331.GA27544@whitby.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --bKyqfOwhbdpXa4YI Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline At 22:23 +0100 on 11 May (1305152611), Tim Deegan wrote: > At 17:56 +0100 on 11 May (1305136560), Keir Fraser wrote: > > IOW you are posting this as an aid for other devs, not for applying to the > > tree? Personally I wouldn't be in favour of sticking this kind of thing in > > tree. > > I was suggesting checking it in, actually; just pointing out that it's > basically just using .deb format as an easy way do do uninstalls. > This is something I've been asked for by people who are trying to code > and test against tip of Xen without regrooving test boxes all the time. > > Linux has something similar in its tree, as a shell script rather than a > Makefile target. If you prefer, I could rework this patch as a script too. Scriptified version attached. Cheers, Tim. -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG) --bKyqfOwhbdpXa4YI Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: attachment; filename="deb" # HG changeset patch # User Tim Deegan # Date 1305542927 -3600 # Node ID 32a1bb05287323b2094274be0823fe2ea17aa702 # Parent f9bb0bbea7c27e256275cfe58c16c0077542984e Build target to wrap dist/install in a .deb archive. Adds "make deb", which does a "make dist" build and wraps the resulting dist/install files in dist/xen-.deb This is _not_ a "packaged" version of Xen for Debian users, nor is it intended to compete with anyone else's packaging efforts. In particular it doesn't do any of the boot-time or fstab fixups needed to actually start the xen tools. It's just a quick hack for developers to be able to quickly install and uninstall a Xen build on a test box. Signed-off-by: Tim Deegan diff -r f9bb0bbea7c2 -r 32a1bb052873 Makefile --- a/Makefile Thu May 12 16:42:54 2011 +0100 +++ b/Makefile Mon May 16 11:48:47 2011 +0100 @@ -118,6 +118,11 @@ world: $(MAKE) kdelete $(MAKE) dist +# Package a build in a .deb file +.PHONY: deb +deb: dist + fakeroot sh ./tools/misc/mkdeb $(XEN_ROOT) $$($(MAKE) -C xen xenversion | grep -v :) + # clean doesn't do a kclean .PHONY: clean clean:: diff -r f9bb0bbea7c2 -r 32a1bb052873 tools/misc/mkdeb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/misc/mkdeb Mon May 16 11:48:47 2011 +0100 @@ -0,0 +1,56 @@ +#!/bin/sh +# +# mkdeb: package the dist/install output of a Xen build in a .deb +# +# Takes 2 arguments, the path to the dist directory and the version + +set -e + +if test -z "$1" -o -z "$2" ; then + echo "usage: $0 path-to-XEN_ROOT xen-version" + exit 1 +fi + +cd $1 +version=$2 +if test "$XEN_TARGET_ARCH" = "x86_32"; then + arch=i386 +else + arch=amd64 +fi + +# Prepare the directory to package +cd dist +rm -rf deb +cp -a install deb + +# Debian doesn't use /usr/lib64 for 64-bit libraries +if test -d deb/usr/lib64 ; then + cp -a deb/usr/lib64/* deb/usr/lib/ + rm -rf deb/usr/lib64 +fi + +# Fill in the debian boilerplate +mkdir -p deb/DEBIAN +cat >deb/DEBIAN/control <