Patchwork [1/1] UBUNTU: debian -- include the debian packaging in the -source package

login
register
mail settings
Submitter Andy Whitcroft
Date Aug. 3, 2010, 12:46 p.m.
Message ID <1280839587-4780-2-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/60732/
State Accepted
Delegated to: Leann Ogasawara
Headers show

Comments

Andy Whitcroft - Aug. 3, 2010, 12:46 p.m.
BugLink: http://bugs.launchpad.net/bugs/608674

The -source package is a bootstrap package allowing other packages which
need the kernel source as part of their build process.  This allows
them to build depend on this package and have the source available.
Currently this only includes the actual kernel source which we built from.
In order to bootstrap compilers we consumers also need the rules used to
build the kernel.  Make a source version specific directory in /usr/src
and add the debian and debian.master contents.  Move the tarball into
this directory as well to better match other packages.  Finally include
a symlink from the original tarball name for backwards compatibility.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/rules.d/3-binary-indep.mk |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Patch

diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index c670e5f..d8f2407 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -47,6 +47,7 @@  install-headers:
 
 srcpkg = $(src_pkg_name)-source-$(release)
 srcdir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)
+balldir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)/$(srcpkg)
 install-source:
 	dh_testdir
 	dh_testroot
@@ -56,10 +57,20 @@  install-source:
 ifeq ($(do_source_package_content),true)
 	find . -path './debian' -prune -o -path './$(DEBIAN)' -prune -o \
 		-path './.*' -prune -o -print | \
+		cpio -pd --preserve-modification-time $(balldir)
+	(cd $(srcdir); tar cf - $(srcpkg)) | bzip2 -9c > \
+		$(srcdir)/$(srcpkg).tar.bz2
+	rm -rf $(balldir)
+	find './debian' './$(DEBIAN)' \
+		-path './debian/linux-*' -prune -o \
+		-path './debian/$(src_pkg_name)-*' -prune -o \
+		-path './debian/build' -prune -o \
+		-path './debian/files' -prune -o \
+		-path './debian/stamps' -prune -o \
+		-path './debian/tmp' -prune -o \
+		-print | \
 		cpio -pd --preserve-modification-time $(srcdir)
-	(cd $(srcdir)/..; tar cf - $(srcpkg)) | bzip2 -9c > \
-		$(srcdir).tar.bz2
-	rm -rf $(srcdir)
+	ln -s $(srcpkg)/$(srcpkg).tar.bz2 $(srcdir)/..
 endif
 
 install-tools: toolspkg = $(tools_common_pkg_name)