* 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. svn path=/dists/trunk/linux-2.6/; revision=5565
This commit is contained in:
parent
69e663ac30
commit
63a86cf8e1
|
@ -48,6 +48,10 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
|
||||||
for i in ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),:
|
for i in ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),:
|
||||||
if config_entry.has_key(i[0]):
|
if config_entry.has_key(i[0]):
|
||||||
makeflags[i[1]] = config_entry[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):
|
def do_subarch_packages(self, packages, makefile, arch, subarch, vars, makeflags, extra):
|
||||||
headers_subarch = self.templates["control.headers.subarch"]
|
headers_subarch = self.templates["control.headers.subarch"]
|
||||||
|
@ -83,6 +87,14 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
|
||||||
):
|
):
|
||||||
if config_entry.has_key(i[0]):
|
if config_entry.has_key(i[0]):
|
||||||
makeflags[i[1]] = config_entry[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):
|
def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
|
||||||
image = self.templates["control.image"]
|
image = self.templates["control.image"]
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# This is the make-kpkg hook file, which runs when make-kpkg is invoked
|
|
||||||
# (from debian/rules) to create the flavour-independent kernel-headers
|
|
||||||
# package. The major tasks it performs is removing unneeded
|
|
||||||
# include/asm-* directories.
|
|
||||||
#
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# The scripts/ directory should be supplied for each flavour, since some
|
|
||||||
# archs do some *very* strange things...
|
|
||||||
rm -rf scripts
|
|
||||||
|
|
||||||
# XXX: once we're using a linux-headers-$(version)-$(debnum) that's Arch: all,
|
|
||||||
# we'll want to drop this bit of code. The asm-* directories should remain.
|
|
||||||
DIRS="generic $(for i in $KERNEL_HEADER_DIRS; do echo -n '|' $i; done)"
|
|
||||||
|
|
||||||
rm -f include/asm
|
|
||||||
eval "
|
|
||||||
for i in include/asm-*; do
|
|
||||||
case \${i#include/asm-} in
|
|
||||||
$DIRS)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
rm -rf "\$i"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"
|
|
|
@ -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")()
|
|
@ -17,12 +17,8 @@ export PYTHONPATH = $(CURDIR)/debian/lib/python
|
||||||
#
|
#
|
||||||
ifeq ($(SUBARCH),none)
|
ifeq ($(SUBARCH),none)
|
||||||
basedir := debian/arch/$(ARCH)
|
basedir := debian/arch/$(ARCH)
|
||||||
LOCALVERSION := -$(FLAVOUR)
|
|
||||||
LOCALVERSION_HEADERS :=
|
|
||||||
else
|
else
|
||||||
basedir := debian/arch/$(ARCH)/$(SUBARCH)
|
basedir := debian/arch/$(ARCH)/$(SUBARCH)
|
||||||
LOCALVERSION := -$(SUBARCH)-$(FLAVOUR)
|
|
||||||
LOCALVERSION_HEADERS := -$(SUBARCH)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
-include $(basedir)/Makefile.inc
|
-include $(basedir)/Makefile.inc
|
||||||
|
@ -36,20 +32,14 @@ include debian/rules.defs
|
||||||
# in Makefile.inc. @flavour@ in the expressions is going to be
|
# in Makefile.inc. @flavour@ in the expressions is going to be
|
||||||
# replaced by the flavour for which the command is run.
|
# 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 := make-kpkg --append-to-version '$(KPKG_ABINAME)$(LOCALVERSION)'
|
||||||
kpkg_image += --arch '$(ARCH)'
|
kpkg_image += --arch '$(ARCH)'
|
||||||
kpkg_image += --stem linux
|
kpkg_image += --stem linux
|
||||||
kpkg_image += --initrd
|
kpkg_image += --initrd
|
||||||
ifdef KPKG_SUBARCH
|
ifdef KPKG_SUBARCH
|
||||||
kpkg_image += --subarch '$(KPKG_SUBARCH)'
|
kpkg_image += --subarch '$(KPKG_SUBARCH)'
|
||||||
kpkg_header += --subarch '$(KPKG_SUBARCH)'
|
|
||||||
endif
|
endif
|
||||||
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
||||||
kpkg_header += --cross-compile='$(DEB_HOST_GNU_TYPE)'
|
|
||||||
kpkg_image += --cross-compile='$(DEB_HOST_GNU_TYPE)'
|
kpkg_image += --cross-compile='$(DEB_HOST_GNU_TYPE)'
|
||||||
endif
|
endif
|
||||||
setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION
|
setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION
|
||||||
|
@ -73,7 +63,7 @@ binary-indep: install-doc install-patch install-source install-tree
|
||||||
build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
|
|
||||||
setup-arch: $(STAMPS_DIR)/source
|
setup-arch: $(STAMPS_DIR)/source
|
||||||
setup-subarch: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)
|
setup-subarch:
|
||||||
setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -103,7 +93,7 @@ define patch_cmd
|
||||||
cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' --overwrite-home='$(CURDIR)/debian/patches' --overwrite-source='$(SOURCE_VERSION)' --overwrite-revisions='$(REVISIONS)'
|
cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' --overwrite-home='$(CURDIR)/debian/patches' --overwrite-source='$(SOURCE_VERSION)' --overwrite-revisions='$(REVISIONS)'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
srcfiles := $(filter-out debian, $(wildcard *))
|
srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
|
||||||
$(STAMPS_DIR)/source: DIR=$(BUILD_DIR)/source
|
$(STAMPS_DIR)/source: DIR=$(BUILD_DIR)/source
|
||||||
$(STAMPS_DIR)/source: debian/bin/apply.py
|
$(STAMPS_DIR)/source: debian/bin/apply.py
|
||||||
rm -rf '$(DIR)'
|
rm -rf '$(DIR)'
|
||||||
|
@ -152,14 +142,6 @@ $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(BUILD_DIR)/config.$(ARCH)-$
|
||||||
cd '$(DIR)'; $(setup_env) $(kpkg_image) configure
|
cd '$(DIR)'; $(setup_env) $(kpkg_image) configure
|
||||||
touch '$@'
|
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:
|
install-base:
|
||||||
dh_compress
|
dh_compress
|
||||||
dh_fixperms
|
dh_fixperms
|
||||||
|
@ -211,26 +193,39 @@ install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBAR
|
||||||
done
|
done
|
||||||
rm -rf '$(DIR)'
|
rm -rf '$(DIR)'
|
||||||
|
|
||||||
install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
|
install-header-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(VERSION)-$(ABINAME)$(LOCALVERSION_HEADERS)
|
||||||
install-header-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/$@
|
install-header-$(ARCH)-$(SUBARCH): export DH_OPTIONS = -p$(PACKAGE_NAME)
|
||||||
install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)
|
install-header-$(ARCH)-$(SUBARCH): BASE_DIR = /usr/src/$(PACKAGE_NAME)
|
||||||
rm -rf '$(DIR)'
|
install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
install-header-$(ARCH)-$(SUBARCH): DIR = $(CURDIR)/debian/$(PACKAGE_NAME)/$(BASE_DIR)
|
||||||
install debian/bin/install-header '$(DIR)/install-header'
|
install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
cd '$(DIR)'; $(setup_env) HEADER_CLEAN_HOOK='$(CURDIR)/$(DIR)/install-header' $(kpkg_header) kernel-headers
|
dh_testdir
|
||||||
cat '$(DIR)/debian/files' >> debian/files
|
dh_testroot
|
||||||
@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \
|
dh_clean -k -d
|
||||||
echo "mv \"$(BUILD_DIR)/$$i\" .."; \
|
cd $(SOURCE_DIR); \
|
||||||
mv "$(BUILD_DIR)/$$i" ..; \
|
( \
|
||||||
done
|
find . \
|
||||||
rm -rf '$(DIR)'
|
-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_OPTIONS = -plinux-headers-$(VERSION)
|
||||||
install-headers-all:
|
install-headers-all:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_install $(DH_OPTIONS) debian/arch '/usr/src/linux-headers-$(VERSION)'
|
dh_install $(DH_OPTIONS) debian/arch debian/lib debian/modules '/usr/src/linux-headers-$(VERSION)'
|
||||||
dh_install $(DH_OPTIONS) debian/lib '/usr/src/linux-headers-$(VERSION)'
|
|
||||||
dh_installdocs $(DH_OPTIONS)
|
dh_installdocs $(DH_OPTIONS)
|
||||||
dh_installchangelogs $(DH_OPTIONS)
|
dh_installchangelogs $(DH_OPTIONS)
|
||||||
dh_python $(DH_OPTIONS) -V 2.4 /usr/src/linux-headers-$(VERSION)/lib/python
|
dh_python $(DH_OPTIONS) -V 2.4 /usr/src/linux-headers-$(VERSION)/lib/python
|
||||||
|
|
Loading…
Reference in New Issue