[kernel] r5565 - in dists/trunk/linux-2.6: . debian debian/bin debian/modules

Bastian Blank waldi at costa.debian.org
Sun Jan 22 18:35:00 UTC 2006


Author: waldi
Date: Sun Jan 22 18:34:58 2006
New Revision: 5565

Added:
   dists/trunk/linux-2.6/debian/modules/
   dists/trunk/linux-2.6/debian/modules/gencontrol.py   (contents, props changed)
Removed:
   dists/trunk/linux-2.6/debian/bin/install-header
Modified:
   dists/trunk/linux-2.6/   (props changed)
   dists/trunk/linux-2.6/debian/bin/gencontrol.py
   dists/trunk/linux-2.6/debian/rules.real
Log:
* Use own header install target.
* Add preliminary modul gencontrol support.
* Set version on dependencies of headers-all package.

r5335:  waldi | 2006-01-07 02:09:14 +0100
debian/rules.real: Fix wildcard for source copy.

r5354:  waldi | 2006-01-08 16:25:37 +0100
* debian/bin/gencontrol.py: Calculate LOCALVERSION and LOCALVERSION_HEADERS.
* debian/rules.real: Remove LOCALVERSION.

r5368:  waldi | 2006-01-09 01:20:17 +0100
Use minimal headers package build, as we can use a clean tree for that. It puts
all arches into the package for now.

* debian/bin/gencontrol.py: Set LOCALVERSION on subarch level.
* debian/bin/install-header: Remove.
* debian/rules.real: Add minimal headers package build.

r5538:  waldi | 2006-01-21 12:43:55 +0100
debian/rules.real: Only install neccesary files into headers packages.

r5539:  waldi | 2006-01-21 12:44:44 +0100
* debian/modules: New directory.
* debian/modules/gencontrol.py: Add for modules build.

r5540:  waldi | 2006-01-21 12:56:20 +0100
* debian/bin/gencontrol.py: Set version on dependencies of headers-all package.
* debian/rules.real
  - Fix headers package name.
  - Install debian/modules into headers-all package.


Modified: dists/trunk/linux-2.6/debian/bin/gencontrol.py
==============================================================================
--- dists/trunk/linux-2.6/debian/bin/gencontrol.py	(original)
+++ dists/trunk/linux-2.6/debian/bin/gencontrol.py	Sun Jan 22 18:34:58 2006
@@ -48,6 +48,10 @@
         for i in ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),:
             if config_entry.has_key(i[0]):
                 makeflags[i[1]] = config_entry[i[0]]
+        localversion_headers = ''
+        if subarch != 'none':
+            localversion_headers = '-' + subarch
+        makeflags['LOCALVERSION_HEADERS'] = localversion_headers
 
     def do_subarch_packages(self, packages, makefile, arch, subarch, vars, makeflags, extra):
         headers_subarch = self.templates["control.headers.subarch"]
@@ -83,6 +87,14 @@
         ):
             if config_entry.has_key(i[0]):
                 makeflags[i[1]] = config_entry[i[0]]
+        localversion = ''
+        localversion_headers = ''
+        if subarch != 'none':
+            localversion = '-' + subarch
+            localversion_headers = '-' + subarch
+        localversion += '-' + flavour
+        makeflags['LOCALVERSION'] = localversion
+        makeflags['LOCALVERSION_HEADERS'] = localversion_headers
 
     def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
         image = self.templates["control.image"]

Added: dists/trunk/linux-2.6/debian/modules/gencontrol.py
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/modules/gencontrol.py	Sun Jan 22 18:34:58 2006
@@ -0,0 +1,41 @@
+#!/usr/bin/env python2.4
+import sys
+sys.path.append(sys.path[0] + "/../lib/python")
+import debian_linux.gencontrol
+
+class gencontrol(debian_linux.gencontrol.gencontrol):
+    def do_main_packages(self, packages):
+        vars = self.changelog_vars
+
+        main = self.templates["control.main"]
+        packages.extend(self.process_packages(main, vars))
+
+    def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
+        modules = self.templates["control.modules"]
+        modules = self.process_packages(modules, vars)
+
+        for package in modules:
+            name = package['Package']
+            if packages.has_key(name):
+                package = packages.get(name)
+                package['Architecture'].append(arch)
+            else:
+                package['Architecture'] = [arch]
+                packages.append(package)
+
+        packages.extend(modules)
+
+        makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
+
+        cmds_binary_arch = []
+        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags_string,))
+        cmds_build = []
+        cmds_build.append(("$(MAKE) -f debian/rules.real build %s" % makeflags_string,))
+        cmds_setup = []
+        cmds_setup.append(("$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags_string,))
+        makefile.append(("binary-arch-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_binary_arch))
+        makefile.append(("build-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_build))
+        makefile.append(("setup-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_setup))
+
+if __name__ == '__main__':
+    gencontrol(sys.path[0] + "/../arch")()

Modified: dists/trunk/linux-2.6/debian/rules.real
==============================================================================
--- dists/trunk/linux-2.6/debian/rules.real	(original)
+++ dists/trunk/linux-2.6/debian/rules.real	Sun Jan 22 18:34:58 2006
@@ -17,12 +17,8 @@
 #
 ifeq ($(SUBARCH),none)
   basedir := debian/arch/$(ARCH)
-  LOCALVERSION := -$(FLAVOUR)
-  LOCALVERSION_HEADERS :=
 else
   basedir := debian/arch/$(ARCH)/$(SUBARCH)
-  LOCALVERSION := -$(SUBARCH)-$(FLAVOUR)
-  LOCALVERSION_HEADERS := -$(SUBARCH)
 endif
 
 -include $(basedir)/Makefile.inc
@@ -36,20 +32,14 @@
 # in Makefile.inc. @flavour@ in the expressions is going to be
 # replaced by the flavour for which the command is run. 
 #
-kpkg_header += make-kpkg --append-to-version '$(KPKG_ABINAME)$(LOCALVERSION_HEADERS)'
-kpkg_header += --arch '$(ARCH)'
-kpkg_header += --stem linux
-kpkg_header += --config defconfig
 kpkg_image := make-kpkg --append-to-version '$(KPKG_ABINAME)$(LOCALVERSION)'
 kpkg_image += --arch '$(ARCH)'
 kpkg_image += --stem linux
 kpkg_image += --initrd
 ifdef KPKG_SUBARCH
   kpkg_image += --subarch '$(KPKG_SUBARCH)'
-  kpkg_header += --subarch '$(KPKG_SUBARCH)'
 endif
 ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-  kpkg_header += --cross-compile='$(DEB_HOST_GNU_TYPE)'
   kpkg_image += --cross-compile='$(DEB_HOST_GNU_TYPE)'
 endif
 setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION
@@ -73,7 +63,7 @@
 build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 
 setup-arch: $(STAMPS_DIR)/source
-setup-subarch: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)
+setup-subarch:
 setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 
 #
@@ -103,7 +93,7 @@
 cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' --overwrite-home='$(CURDIR)/debian/patches' --overwrite-source='$(SOURCE_VERSION)' --overwrite-revisions='$(REVISIONS)'
 endef
 
-srcfiles := $(filter-out debian, $(wildcard *))
+srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
 $(STAMPS_DIR)/source: DIR=$(BUILD_DIR)/source
 $(STAMPS_DIR)/source: debian/bin/apply.py
 	rm -rf '$(DIR)'
@@ -152,14 +142,6 @@
 	cd '$(DIR)'; $(setup_env) $(kpkg_image) configure
 	touch '$@'
 
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
-$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
-	rm -rf '$(DIR)'
-	cp -al '$(SOURCE_DIR)' '$(DIR)'
-	cd '$(DIR)'; $(setup_env) $(kpkg_header) configure
-	touch '$@'
-
 install-base:
 	dh_compress
 	dh_fixperms
@@ -211,26 +193,39 @@
 	done
 	rm -rf '$(DIR)'
 
-install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
-install-header-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/$@
-install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)
-	rm -rf '$(DIR)'
-	cp -al '$(SOURCE_DIR)' '$(DIR)'
-	install debian/bin/install-header '$(DIR)/install-header'
-	cd '$(DIR)'; $(setup_env) HEADER_CLEAN_HOOK='$(CURDIR)/$(DIR)/install-header' $(kpkg_header) kernel-headers
-	cat '$(DIR)/debian/files' >> debian/files
-	@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do	\
-	  echo "mv \"$(BUILD_DIR)/$$i\" ..";				\
-	  mv "$(BUILD_DIR)/$$i" ..;					\
-	done
-	rm -rf '$(DIR)'
+install-header-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(VERSION)-$(ABINAME)$(LOCALVERSION_HEADERS)
+install-header-$(ARCH)-$(SUBARCH): export DH_OPTIONS = -p$(PACKAGE_NAME)
+install-header-$(ARCH)-$(SUBARCH): BASE_DIR = /usr/src/$(PACKAGE_NAME)
+install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
+install-header-$(ARCH)-$(SUBARCH): DIR = $(CURDIR)/debian/$(PACKAGE_NAME)/$(BASE_DIR)
+install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	cd $(SOURCE_DIR); \
+	( \
+	  find . \
+	    -path './Documentation/*' -prune -o \
+	    -path './arch/*' -prune -o \
+	    -path './include/asm*' -prune -o \
+	    -path './scripts/*' -prune -o \
+	    -path './include/' -o \
+	    \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Rules.make' \) -print; \
+	  for i in $(KERNEL_HEADER_DIRS); do \
+	    find arch/$$i \
+	      \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Rules.make' \) -print; \
+	    find include/asm-$$i -print; \
+	  done; \
+	) \
+	| \
+	cpio -pd --preserve-modification-time $(DIR)
+	$(MAKE) -f debian/rules.real install-base
 
 install-headers-all: DH_OPTIONS = -plinux-headers-$(VERSION)
 install-headers-all:
 	dh_testdir
 	dh_testroot
-	dh_install $(DH_OPTIONS) debian/arch '/usr/src/linux-headers-$(VERSION)'
-	dh_install $(DH_OPTIONS) debian/lib '/usr/src/linux-headers-$(VERSION)'
+	dh_install $(DH_OPTIONS) debian/arch debian/lib debian/modules '/usr/src/linux-headers-$(VERSION)'
 	dh_installdocs $(DH_OPTIONS)
 	dh_installchangelogs $(DH_OPTIONS)
 	dh_python $(DH_OPTIONS) -V 2.4 /usr/src/linux-headers-$(VERSION)/lib/python



More information about the Kernel-svn-changes mailing list