r4026: waldi | 2005-08-23 16:16:40 +0200
debian/bin/gencontrol.py: Add error messages for arches without definitions. r4027: waldi | 2005-08-23 17:17:44 +0200 * debian/bin/gencontrol.py: Produce headers package for each subarch. * debian/templates/control.headers.main.in: Fix commandline. * debian/templates/control.headers.subarch.in: Remove. r4028: waldi | 2005-08-23 18:04:56 +0200 /debian/bin/gencontrol.py: Cleanup. r4029: waldi | 2005-08-23 19:02:41 +0200 * debian/bin/gencontrol.py: Move the logic into functions. * debian/lib/python/debian_linux.py (sorted_dict): Add. (entry): Implement via sorted_dict. r4030: waldi | 2005-08-23 19:13:06 +0200 debian/bin/gencontrol.py: Use dict for makeflags. r4031: waldi | 2005-08-23 19:18:37 +0200 debian/bin/gencontrol.py: Support extra packages which multiple architectures. r4032: waldi | 2005-08-23 19:31:34 +0200 * debian/bin/gencontrol.py: Set Architecture for each package. * debian/templates/control.headers.in, debian/templates/control.headers.latest.in, debian/templates/control.headers.subarch.in, debian/templates/control.image.in, debian/templates/control.image.latest.in: Remove Architecture field. r4033: waldi | 2005-08-23 19:33:50 +0200 debian/bin/gencontrol.py: Readd subarch headers package. r4034: waldi | 2005-08-23 19:38:05 +0200 debian/bin/gencontrol.py: Readd setup of variables for template substitution. r4035: waldi | 2005-08-23 19:40:58 +0200 debian/templates/control.headers.subarch.in: Fix package names in description. r4036: waldi | 2005-08-23 19:49:12 +0200 debian/lib/python/debian_linux.py (config): Support subarchitectures. r4037: waldi | 2005-08-23 22:05:05 +0200 Add support for linux-headers-$version-all package. It is currently blocked by #324741. * debian/bin/gencontrol.py: Update. * debian/lib/python/debian_linux.py: Move none subarch to the beginning of the list. * debian/templates/control.headers.main.in: Add. r4038: waldi | 2005-08-23 22:42:52 +0200 * debian/bin/gencontrol.py: Use special rule for building the general headers package. * debian/rules.real: Add rules. * debian/templates/control.headers.main.in: Drop -all suffix. r4039: waldi | 2005-08-23 23:12:53 +0200 debian/lib/python/debian_linux.py: Support overlay config. r4040: waldi | 2005-08-23 23:13:33 +0200 debian/rules.real: Fix installation of common headers package. r4045: waldi | 2005-08-24 00:52:03 +0200 * debian/arch/powerpc/defines: Add kernel arch settings. * debian/lib/python/debian_linux.py: Support kernel arch settings. r4047: waldi | 2005-08-24 10:31:57 +0200 * debian/bin/gencontrol.py: Add proper Architecture line to headers package. * debian/templates/control.headers.arch.in: Move from debian/templates/control.headers.main.in. r4049: waldi | 2005-08-24 19:49:53 +0200 debian/patches-debian/qla2xxx-removed.patch: Don't remove Kconfig entry. svn path=/trunk/kernel/linux-2.6/; revision=4062
This commit is contained in:
parent
988649d436
commit
c7e4885a56
|
@ -3,6 +3,7 @@ flavours:
|
||||||
powerpc
|
powerpc
|
||||||
powerpc-smp
|
powerpc-smp
|
||||||
powerpc64
|
powerpc64
|
||||||
|
kernel-arch: ppc
|
||||||
kpkg-subarch: powerpc
|
kpkg-subarch: powerpc
|
||||||
|
|
||||||
[powerpc]
|
[powerpc]
|
||||||
|
@ -12,4 +13,5 @@ depends: mkvmlinuz (>= 13)
|
||||||
depends: mkvmlinuz (>= 13)
|
depends: mkvmlinuz (>= 13)
|
||||||
|
|
||||||
[powerpc64]
|
[powerpc64]
|
||||||
|
kernel-arch: ppc64
|
||||||
kpkg-subarch: powerpc64
|
kpkg-subarch: powerpc64
|
||||||
|
|
|
@ -3,26 +3,34 @@ import os, os.path, re, sys, textwrap, ConfigParser
|
||||||
sys.path.append("debian/lib/python")
|
sys.path.append("debian/lib/python")
|
||||||
from debian_linux import *
|
from debian_linux import *
|
||||||
|
|
||||||
|
class packages_list(sorted_dict):
|
||||||
|
def append(self, package):
|
||||||
|
self[package['Package']] = package
|
||||||
|
|
||||||
|
def extend(self, packages):
|
||||||
|
for package in packages:
|
||||||
|
self[package['Package']] = package
|
||||||
|
|
||||||
def read_changelog():
|
def read_changelog():
|
||||||
r = re.compile(r"""
|
r = re.compile(r"""
|
||||||
^
|
^
|
||||||
(
|
(
|
||||||
(?P<header>
|
(?P<header>
|
||||||
(?P<header_source>
|
(?P<header_source>
|
||||||
\w[-+0-9a-z.]+
|
\w[-+0-9a-z.]+
|
||||||
)
|
|
||||||
\
|
|
||||||
\(
|
|
||||||
(?P<header_version>
|
|
||||||
[^\(\)\ \t]+
|
|
||||||
)
|
|
||||||
\)
|
|
||||||
\s+
|
|
||||||
(?P<header_distribution>
|
|
||||||
[-0-9a-zA-Z]+
|
|
||||||
)
|
|
||||||
\;
|
|
||||||
)
|
)
|
||||||
|
\
|
||||||
|
\(
|
||||||
|
(?P<header_version>
|
||||||
|
[^\(\)\ \t]+
|
||||||
|
)
|
||||||
|
\)
|
||||||
|
\s+
|
||||||
|
(?P<header_distribution>
|
||||||
|
[-0-9a-zA-Z]+
|
||||||
|
)
|
||||||
|
\;
|
||||||
|
)
|
||||||
)
|
)
|
||||||
""", re.VERBOSE)
|
""", re.VERBOSE)
|
||||||
f = file("debian/changelog")
|
f = file("debian/changelog")
|
||||||
|
@ -103,6 +111,21 @@ $
|
||||||
match = re.match(version_re, version, re.X)
|
match = re.match(version_re, version, re.X)
|
||||||
return match.groupdict()
|
return match.groupdict()
|
||||||
|
|
||||||
|
def process_changelog(in_vars, changelog):
|
||||||
|
ret = [None, None, None, None]
|
||||||
|
ret[0] = version = changelog[0]['Version']
|
||||||
|
vars = in_vars.copy()
|
||||||
|
if version['modifier'] is not None:
|
||||||
|
ret[1] = vars['abiname'] = version['modifier']
|
||||||
|
ret[2] = ""
|
||||||
|
else:
|
||||||
|
ret[1] = vars['abiname'] = c['base']['abiname']
|
||||||
|
ret[2] = "-%s" % vars['abiname']
|
||||||
|
vars['version'] = version['version']
|
||||||
|
vars['major'] = version['major']
|
||||||
|
ret[3] = vars
|
||||||
|
return ret
|
||||||
|
|
||||||
def process_depends(key, e, in_e, vars):
|
def process_depends(key, e, in_e, vars):
|
||||||
in_dep = in_e[key].split(',')
|
in_dep = in_e[key].split(',')
|
||||||
dep = []
|
dep = []
|
||||||
|
@ -197,12 +220,6 @@ def substitute(s, vars):
|
||||||
return vars[match.group(1)]
|
return vars[match.group(1)]
|
||||||
return re.sub(r'@([a-z_]+)@', subst, s)
|
return re.sub(r'@([a-z_]+)@', subst, s)
|
||||||
|
|
||||||
def vars_changelog(vars, changelog):
|
|
||||||
version = changelog[0]['Version']
|
|
||||||
vars['version'] = version['version']
|
|
||||||
vars['major'] = version['major']
|
|
||||||
return vars
|
|
||||||
|
|
||||||
def write_control(list):
|
def write_control(list):
|
||||||
write_rfc822(file("debian/control", 'w'), list)
|
write_rfc822(file("debian/control", 'w'), list)
|
||||||
|
|
||||||
|
@ -218,58 +235,108 @@ def write_makefile(list):
|
||||||
f.write("\t%s\n" % j)
|
f.write("\t%s\n" % j)
|
||||||
|
|
||||||
def write_rfc822(f, list):
|
def write_rfc822(f, list):
|
||||||
for i in list:
|
for entry in list:
|
||||||
for j in i.iteritems():
|
for key, value in entry.iteritems():
|
||||||
f.write("%s:" % j[0])
|
f.write("%s:" % key)
|
||||||
for k in j[1].split('\n'):
|
if isinstance(value, tuple):
|
||||||
|
value = value[0].join(value[1])
|
||||||
|
for k in value.split('\n'):
|
||||||
f.write(" %s\n" % k)
|
f.write(" %s\n" % k)
|
||||||
f.write('\n')
|
f.write('\n')
|
||||||
|
|
||||||
def main():
|
def process_real_arch(packages, makefile, config, arch, vars, makeflags):
|
||||||
changelog = read_changelog()
|
config_entry = config[arch]
|
||||||
|
vars.update(config_entry)
|
||||||
|
|
||||||
vars = {}
|
if not config_entry.get('available', True):
|
||||||
vars = vars_changelog(vars, changelog)
|
for i in ('binary-arch', 'build', 'setup'):
|
||||||
|
makefile.append(("%s-%s:" % (i, arch), ["@echo Architecture %s is not available!" % arch, "@exit 1"]))
|
||||||
|
return
|
||||||
|
|
||||||
c = config()
|
headers_arch = read_template("headers.arch")
|
||||||
|
package_headers_arch = process_package(headers_arch[0], vars)
|
||||||
|
|
||||||
vars.update(c['base'])
|
name = package_headers_arch['Package']
|
||||||
|
if packages.has_key(name):
|
||||||
version = changelog[0]['Version']
|
package_headers_arch = packages.get(name)
|
||||||
if version['modifier'] is not None:
|
package_headers_arch['Architecture'][1].append(arch)
|
||||||
abiname = version['modifier']
|
|
||||||
kpkg_abiname = ""
|
|
||||||
vars['abiname'] = abiname
|
|
||||||
else:
|
else:
|
||||||
abiname = c['base']['abiname']
|
package_headers_arch['Architecture'] = (' ', [arch])
|
||||||
kpkg_abiname = "-%s" % abiname
|
package_headers_arch['Depends'] = (', ', [])
|
||||||
|
packages.append(package_headers_arch)
|
||||||
|
|
||||||
arches = {}
|
for i in (('binary-arch', 'setup',)):
|
||||||
subarches_architecture = {}
|
makefile.append(("%s-%s:: %s-%s-real" % (i, arch, i, arch), None))
|
||||||
for arch in c['base']['arches']:
|
|
||||||
if not c[arch].get('available', True):
|
|
||||||
continue
|
|
||||||
t1 = {}
|
|
||||||
for subarch in c[arch].get('subarches', []):
|
|
||||||
t2 = {}
|
|
||||||
if subarch != 'none':
|
|
||||||
for flavour in c["%s-%s" % (arch, subarch)].get('flavours', []):
|
|
||||||
t2[flavour] = True
|
|
||||||
else:
|
|
||||||
for flavour in c[arch].get('flavours', []):
|
|
||||||
t2[flavour] = True
|
|
||||||
subarch = None
|
|
||||||
t1[subarch] = t2
|
|
||||||
t3 = subarches_architecture.get(subarch, {})
|
|
||||||
t3[arch] = True
|
|
||||||
subarches_architecture[subarch] = t3
|
|
||||||
arches[arch] = t1
|
|
||||||
|
|
||||||
packages = []
|
makeflags['ARCH'] = arch
|
||||||
makefile = []
|
makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
|
||||||
|
|
||||||
|
cmds_binary_arch = []
|
||||||
|
cmds_setup = []
|
||||||
|
cmds_binary_arch.append(("$(MAKE) -f debian/rules.real install-headers-all %s" % makeflags_string,))
|
||||||
|
cmds_setup.append(("$(MAKE) -f debian/rules.real setup-arch %s" % makeflags_string,))
|
||||||
|
makefile.append(("setup-%s-real:" % arch, cmds_setup))
|
||||||
|
makefile.append(("binary-arch-%s-real:" % arch, cmds_binary_arch))
|
||||||
|
|
||||||
|
for subarch in config_entry['subarches']:
|
||||||
|
process_real_subarch(packages, makefile, config, arch, subarch, vars.copy(), makeflags.copy(), package_headers_arch)
|
||||||
|
|
||||||
|
def process_real_flavour(packages, makefile, config, arch, subarch, flavour, vars, makeflags, package_headers_arch):
|
||||||
|
config_entry = config['-'.join((arch, subarch, flavour))]
|
||||||
|
vars.update(config_entry)
|
||||||
|
|
||||||
|
vars['flavour'] = flavour
|
||||||
|
if not vars.has_key('class'):
|
||||||
|
vars['class'] = '%s-class' % flavour
|
||||||
|
if not vars.has_key('longclass'):
|
||||||
|
vars['longclass'] = vars['class']
|
||||||
|
|
||||||
|
image = read_template("image")
|
||||||
|
headers = read_template("headers")
|
||||||
|
image_latest = read_template("image.latest")
|
||||||
|
headers_latest = read_template("headers.latest")
|
||||||
|
|
||||||
|
packages_own = []
|
||||||
|
packages_dummy = []
|
||||||
|
packages_own.append(process_real_image(image[0], vars))
|
||||||
|
packages_own.append(process_package(headers[0], vars))
|
||||||
|
packages_dummy.extend(process_packages(image_latest, vars))
|
||||||
|
packages_dummy.append(process_package(headers_latest[0], vars))
|
||||||
|
|
||||||
|
for package in packages_own + packages_dummy:
|
||||||
|
name = package['Package']
|
||||||
|
if packages.has_key(name):
|
||||||
|
package = packages.get(name)
|
||||||
|
package['Architecture'][1].append(arch)
|
||||||
|
else:
|
||||||
|
package['Architecture'] = (' ', [arch])
|
||||||
|
packages.append(package)
|
||||||
|
|
||||||
|
package_headers_arch['Depends'][1].append("%s [%s]" % (packages_own[1]['Package'], arch))
|
||||||
|
|
||||||
|
for i in ('binary-arch', 'build', 'setup'):
|
||||||
|
makefile.append(("%s-%s-%s:: %s-%s-%s-%s" % (i, arch, subarch, i, arch, subarch, flavour), None))
|
||||||
|
makefile.append(("%s-%s-%s-%s:: %s-%s-%s-%s-real" % (i, arch, subarch, flavour, i, arch, subarch, flavour), None))
|
||||||
|
|
||||||
|
makeflags['FLAVOUR'] = flavour
|
||||||
|
if config_entry.has_key('kpkg-subarch'):
|
||||||
|
makeflags['KPKG_SUBARCH'] = config_entry['kpkg-subarch']
|
||||||
|
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_binary_arch.append(("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='%s'" % ' '.join(["-p%s" % i['Package'] for i in packages_dummy]),))
|
||||||
|
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))
|
||||||
|
|
||||||
|
def process_real_main(packages, makefile, config, version, abiname, kpkg_abiname, changelog, vars):
|
||||||
source = read_template("source")
|
source = read_template("source")
|
||||||
packages.append(process_package(source[0], vars))
|
packages['source'] = process_package(source[0], vars)
|
||||||
|
|
||||||
main = read_template("main")
|
main = read_template("main")
|
||||||
packages.extend(process_packages(main, vars))
|
packages.extend(process_packages(main, vars))
|
||||||
|
@ -277,132 +344,36 @@ def main():
|
||||||
tree = read_template("tree")
|
tree = read_template("tree")
|
||||||
packages.append(process_real_tree(tree[0], changelog, vars))
|
packages.append(process_real_tree(tree[0], changelog, vars))
|
||||||
|
|
||||||
headers_main = read_template("headers.main")
|
makeflags = {
|
||||||
a = subarches_architecture[None].keys()
|
'VERSION': version['version'],
|
||||||
a.sort()
|
'SOURCE_VERSION': version['source'],
|
||||||
b = vars.copy()
|
'UPSTREAM_VERSION': version['upstream'],
|
||||||
b['arch'] = ' '.join(a)
|
'ABINAME': abiname,
|
||||||
packages.append(process_package(headers_main[0], b))
|
'KPKG_ABINAME': kpkg_abiname,
|
||||||
|
}
|
||||||
|
makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
|
||||||
|
|
||||||
headers = read_template("headers")
|
|
||||||
headers_latest = read_template("headers.latest")
|
|
||||||
image = read_template("image")
|
|
||||||
image_latest = read_template("image.latest")
|
|
||||||
|
|
||||||
makeflags = [
|
|
||||||
"VERSION='%s'" % version['version'],
|
|
||||||
"SOURCE_VERSION='%s'" % version['source'],
|
|
||||||
"UPSTREAM_VERSION='%s'" % version['upstream'],
|
|
||||||
]
|
|
||||||
cmds_binary_indep = []
|
cmds_binary_indep = []
|
||||||
cmds_binary_indep.append(("$(MAKE) -f debian/rules.real binary-indep %s" % ' '.join(makeflags),))
|
cmds_binary_indep.append(("$(MAKE) -f debian/rules.real binary-indep %s" % makeflags_string,))
|
||||||
makefile.append(("binary-indep:", cmds_binary_indep))
|
makefile.append(("binary-indep:", cmds_binary_indep))
|
||||||
|
|
||||||
arch_list = arches.keys()
|
for arch in iter(config['base']['arches']):
|
||||||
arch_list.sort()
|
process_real_arch(packages, makefile, config, arch, vars.copy(), makeflags.copy())
|
||||||
for arch in arch_list:
|
|
||||||
arch_vars = vars.copy()
|
|
||||||
arch_vars['arch'] = arch
|
|
||||||
arch_vars.update(c[arch])
|
|
||||||
|
|
||||||
for i in (('setup',)):
|
|
||||||
makefile.append(("%s-%s:: %s-%s-real" % (i, arch, i, arch), None))
|
|
||||||
|
|
||||||
arch_makeflags = makeflags[:]
|
|
||||||
arch_makeflags.append("ARCH='%s'" % arch)
|
|
||||||
cmds_setup = []
|
|
||||||
cmds_setup.append(("$(MAKE) -f debian/rules.real setup-arch %s" % ' '.join(arch_makeflags),))
|
|
||||||
makefile.append(("setup-%s-real:" % arch, cmds_setup))
|
|
||||||
|
|
||||||
subarch_list = arches[arch].keys()
|
|
||||||
subarch_list.sort()
|
|
||||||
for subarch in subarch_list:
|
|
||||||
subarch_vars = arch_vars.copy()
|
|
||||||
|
|
||||||
if subarch is not None:
|
|
||||||
subarch_text = subarch
|
|
||||||
subarch_vars['subarch'] = '%s-' % subarch
|
|
||||||
subarch_vars.update(c['%s-%s' % (arch, subarch)])
|
|
||||||
else:
|
|
||||||
subarch_text = 'none'
|
|
||||||
subarch_vars['subarch'] = ''
|
|
||||||
|
|
||||||
for i in ('binary-arch', 'build', 'setup'):
|
|
||||||
makefile.append(("%s-%s:: %s-%s-%s" % (i, arch, i, arch, subarch_text), None))
|
|
||||||
makefile.append(("%s-%s-%s::" % (i, arch, subarch_text), None))
|
|
||||||
for i in ('binary-arch', 'setup'):
|
|
||||||
makefile.append(("%s-%s-%s:: %s-%s-%s-real" % (i, arch, subarch_text, i, arch, subarch_text), None))
|
|
||||||
|
|
||||||
subarch_makeflags = arch_makeflags[:]
|
|
||||||
subarch_makeflags.extend([
|
|
||||||
"SUBARCH='%s'" % subarch_text,
|
|
||||||
"ABINAME='%s'" % abiname,
|
|
||||||
"KPKG_ABINAME='%s'" % kpkg_abiname,
|
|
||||||
])
|
|
||||||
subarch_makeflags_clean = subarch_makeflags[:]
|
|
||||||
if subarch_vars.has_key('kpkg-subarch'):
|
|
||||||
subarch_makeflags.append("KPKG_SUBARCH='%s'" % subarch_vars['kpkg-subarch'])
|
|
||||||
|
|
||||||
cmds_binary_arch = []
|
|
||||||
cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-subarch %s" % ' '.join(subarch_makeflags),))
|
|
||||||
cmds_setup = []
|
|
||||||
cmds_setup.append(("$(MAKE) -f debian/rules.real setup-subarch %s" % ' '.join(subarch_makeflags),))
|
|
||||||
makefile.append(("binary-arch-%s-%s-real:" % (arch, subarch_text), cmds_binary_arch))
|
|
||||||
makefile.append(("setup-%s-%s-real:" % (arch, subarch_text), cmds_setup))
|
|
||||||
|
|
||||||
flavour_list = arches[arch][subarch].keys()
|
|
||||||
flavour_list.sort()
|
|
||||||
for flavour in flavour_list:
|
|
||||||
flavour_vars = subarch_vars.copy()
|
|
||||||
flavour_vars['flavour'] = flavour
|
|
||||||
|
|
||||||
try:
|
|
||||||
flavour_vars.update(c['%s-%s-%s' % (arch, subarch_text, flavour)])
|
|
||||||
except ConfigParser.NoSectionError: pass
|
|
||||||
if not flavour_vars.has_key('class'):
|
|
||||||
flavour_vars['class'] = '%s-class' % flavour
|
|
||||||
if not flavour_vars.has_key('longclass'):
|
|
||||||
flavour_vars['longclass'] = flavour_vars['class']
|
|
||||||
|
|
||||||
dummy_packages = []
|
|
||||||
dummy_packages.extend(process_packages(image_latest, flavour_vars))
|
|
||||||
packages.append(process_real_image(image[0], flavour_vars))
|
|
||||||
dummy_packages.append(process_package(headers_latest[0], flavour_vars))
|
|
||||||
packages.append(process_package(headers[0], flavour_vars))
|
|
||||||
packages.extend(dummy_packages)
|
|
||||||
|
|
||||||
for i in ('binary-arch', 'build', 'setup'):
|
|
||||||
makefile.append(("%s-%s-%s:: %s-%s-%s-%s" % (i, arch, subarch_text, i, arch, subarch_text, flavour), None))
|
|
||||||
makefile.append(("%s-%s-%s-%s:: %s-%s-%s-%s-real" % (i, arch, subarch_text, flavour, i, arch, subarch_text, flavour), None))
|
|
||||||
|
|
||||||
flavour_makeflags = subarch_makeflags_clean[:]
|
|
||||||
flavour_makeflags.append("FLAVOUR='%s'" % flavour)
|
|
||||||
if flavour_vars.has_key('kpkg-subarch'):
|
|
||||||
flavour_makeflags.append("KPKG_SUBARCH='%s'" % flavour_vars['kpkg-subarch'])
|
|
||||||
cmds_binary_arch = []
|
|
||||||
cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % ' '.join(flavour_makeflags),))
|
|
||||||
cmds_binary_arch.append(("$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='%s'" % ' '.join(["-p%s" % i['Package'] for i in dummy_packages]),))
|
|
||||||
cmds_build = []
|
|
||||||
cmds_build.append(("$(MAKE) -f debian/rules.real build %s" % ' '.join(flavour_makeflags),))
|
|
||||||
cmds_setup = []
|
|
||||||
cmds_setup.append(("$(MAKE) -f debian/rules.real setup-flavour %s" % ' '.join(flavour_makeflags),))
|
|
||||||
makefile.append(("binary-arch-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_binary_arch))
|
|
||||||
makefile.append(("build-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_build))
|
|
||||||
makefile.append(("setup-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_setup))
|
|
||||||
|
|
||||||
extra = read_template("extra")
|
extra = read_template("extra")
|
||||||
packages.extend(process_packages(extra, vars))
|
packages.extend(process_packages(extra, vars))
|
||||||
extra_pn = {}
|
extra_pn = {}
|
||||||
for i in extra:
|
for i in extra:
|
||||||
a = i['Architecture']
|
arches = i['Architecture'].split(' ')
|
||||||
pn = extra_pn.get(a, [])
|
for arch in arches:
|
||||||
pn.append(i)
|
pn = extra_pn.get(arch, [])
|
||||||
extra_pn[a] = pn
|
pn.append(i)
|
||||||
|
extra_pn[arch] = pn
|
||||||
archs = extra_pn.keys()
|
archs = extra_pn.keys()
|
||||||
archs.sort()
|
archs.sort()
|
||||||
for arch in archs:
|
for arch in archs:
|
||||||
arch_vars = vars.copy()
|
arch_vars = vars.copy()
|
||||||
arch_vars.update(c[arch])
|
arch_vars.update(config[arch])
|
||||||
|
|
||||||
cmds = []
|
cmds = []
|
||||||
for i in extra_pn[arch]:
|
for i in extra_pn[arch]:
|
||||||
|
@ -413,7 +384,61 @@ def main():
|
||||||
makefile.append(("binary-arch-%s:: binary-arch-%s-extra" % (arch, arch), None))
|
makefile.append(("binary-arch-%s:: binary-arch-%s-extra" % (arch, arch), None))
|
||||||
makefile.append(("binary-arch-%s-extra:" % arch, cmds))
|
makefile.append(("binary-arch-%s-extra:" % arch, cmds))
|
||||||
|
|
||||||
write_control(packages)
|
def process_real_subarch(packages, makefile, config, arch, subarch, vars, makeflags, package_headers_arch):
|
||||||
|
if subarch == 'none':
|
||||||
|
vars['subarch'] = ''
|
||||||
|
config_entry = config[arch]
|
||||||
|
else:
|
||||||
|
vars['subarch'] = '%s-' % subarch
|
||||||
|
config_entry = config['%s-%s' % (arch, subarch)]
|
||||||
|
vars.update(config_entry)
|
||||||
|
|
||||||
|
headers_subarch = read_template("headers.subarch")
|
||||||
|
|
||||||
|
package_headers = process_package(headers_subarch[0], vars)
|
||||||
|
|
||||||
|
name = package_headers['Package']
|
||||||
|
if packages.has_key(name):
|
||||||
|
package_headers = packages.get(name)
|
||||||
|
package_headers['Architecture'][1].append(arch)
|
||||||
|
else:
|
||||||
|
package_headers['Architecture'] = (' ', [arch])
|
||||||
|
packages.append(package_headers)
|
||||||
|
|
||||||
|
for i in ('binary-arch', 'build', 'setup'):
|
||||||
|
makefile.append(("%s-%s:: %s-%s-%s" % (i, arch, i, arch, subarch), None))
|
||||||
|
makefile.append(("%s-%s-%s::" % (i, arch, subarch), None))
|
||||||
|
for i in ('binary-arch', 'setup'):
|
||||||
|
makefile.append(("%s-%s-%s:: %s-%s-%s-real" % (i, arch, subarch, i, arch, subarch), None))
|
||||||
|
|
||||||
|
makeflags['SUBARCH'] = subarch
|
||||||
|
if config_entry.has_key('kpkg-subarch'):
|
||||||
|
makeflags['KPKG_SUBARCH'] = config_entry['kpkg-subarch']
|
||||||
|
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-subarch %s" % makeflags_string,))
|
||||||
|
cmds_setup = []
|
||||||
|
cmds_setup.append(("$(MAKE) -f debian/rules.real setup-subarch %s" % makeflags_string,))
|
||||||
|
makefile.append(("binary-arch-%s-%s-real:" % (arch, subarch), cmds_binary_arch))
|
||||||
|
makefile.append(("setup-%s-%s-real:" % (arch, subarch), cmds_setup))
|
||||||
|
|
||||||
|
for flavour in config_entry['flavours']:
|
||||||
|
process_real_flavour(packages, makefile, config, arch, subarch, flavour, vars.copy(), makeflags.copy(), package_headers_arch)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
changelog = read_changelog()
|
||||||
|
|
||||||
|
c = config()
|
||||||
|
|
||||||
|
version, abiname, kpkg_abiname, vars = process_changelog({}, changelog)
|
||||||
|
|
||||||
|
packages = packages_list()
|
||||||
|
makefile = []
|
||||||
|
|
||||||
|
process_real_main(packages, makefile, c, version, abiname, kpkg_abiname, changelog, vars)
|
||||||
|
|
||||||
|
write_control(packages.itervalues())
|
||||||
write_makefile(makefile)
|
write_makefile(makefile)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import os, os.path, re, sys, textwrap, ConfigParser
|
import os, os.path, re, sys, textwrap, ConfigParser
|
||||||
|
|
||||||
config_name = "defines"
|
|
||||||
|
|
||||||
class schema_item_boolean(object):
|
class schema_item_boolean(object):
|
||||||
def __call__(self, i):
|
def __call__(self, i):
|
||||||
i = i.strip().lower()
|
i = i.strip().lower()
|
||||||
|
@ -32,36 +30,56 @@ class config(dict):
|
||||||
'depends': schema_item_string,
|
'depends': schema_item_string,
|
||||||
'desc': schema_item_string,
|
'desc': schema_item_string,
|
||||||
'flavours': schema_item_list,
|
'flavours': schema_item_list,
|
||||||
|
'kernel-arch': schema_item_string,
|
||||||
'kpkg-subarch': schema_item_string,
|
'kpkg-subarch': schema_item_string,
|
||||||
'longclass': schema_item_string,
|
'longclass': schema_item_string,
|
||||||
'subarches': schema_item_list,
|
'subarches': schema_item_list,
|
||||||
'suggests': schema_item_string,
|
'suggests': schema_item_string,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
config_name = "defines"
|
||||||
|
|
||||||
|
def __init__(self, overlay_dir = None):
|
||||||
|
self._overlay_dir = overlay_dir
|
||||||
self._read_base()
|
self._read_base()
|
||||||
|
|
||||||
|
def _get_files(self, name):
|
||||||
|
ret = []
|
||||||
|
if self._overlay_dir is not None:
|
||||||
|
ret.append(os.path.join(self._overlay_dir, name))
|
||||||
|
ret.append(name)
|
||||||
|
return ret
|
||||||
|
|
||||||
def _read_arch(self, arch, base):
|
def _read_arch(self, arch, base):
|
||||||
file = "debian/arch/%s/%s" % (arch, config_name)
|
files = self._get_files("debian/arch/%s/%s" % (arch, self.config_name))
|
||||||
c = config_parser(self.schema)
|
c = config_parser(self.schema)
|
||||||
c.read(file)
|
c.read(files)
|
||||||
t = c.items_convert('base')
|
t = c.items_convert('base')
|
||||||
base.update(t)
|
base.update(t)
|
||||||
self[arch] = t
|
self[arch] = t
|
||||||
subarches = t.get('subarches', [])
|
subarches = t.get('subarches', [])
|
||||||
for subarch in subarches:
|
for subarch in subarches:
|
||||||
raise RuntimeError
|
try:
|
||||||
|
t2 = c.items_convert(subarch)
|
||||||
|
avail = t2.get('available', True)
|
||||||
|
except ConfigParser.NoSectionError:
|
||||||
|
t2 = {}
|
||||||
|
avail = True
|
||||||
|
if avail:
|
||||||
|
self._read_subarch(arch, subarch, t2)
|
||||||
|
else:
|
||||||
|
self['-'.join((arch, subarch))] = t2
|
||||||
flavours = t.get('flavours', None)
|
flavours = t.get('flavours', None)
|
||||||
if flavours:
|
if flavours:
|
||||||
for flavour in flavours:
|
for flavour in flavours:
|
||||||
self._read_flavour(arch, 'none', flavour, c)
|
self._read_flavour(arch, 'none', flavour, c)
|
||||||
subarches.append('none')
|
subarches.insert(0, 'none')
|
||||||
t['subarches'] = subarches
|
t['subarches'] = subarches
|
||||||
|
|
||||||
def _read_base(self):
|
def _read_base(self):
|
||||||
file = "debian/arch/%s" % config_name
|
files = self._get_files("debian/arch/%s" % self.config_name)
|
||||||
c = config_parser(self.schema)
|
c = config_parser(self.schema)
|
||||||
c.read(file)
|
c.read(files)
|
||||||
t1 = c.items_convert('base')
|
t1 = c.items_convert('base')
|
||||||
self['base'] = t1
|
self['base'] = t1
|
||||||
for arch in t1['arches']:
|
for arch in t1['arches']:
|
||||||
|
@ -87,6 +105,17 @@ class config(dict):
|
||||||
t = {}
|
t = {}
|
||||||
self["%s-%s-%s" % (arch, subarch, flavour)] = t
|
self["%s-%s-%s" % (arch, subarch, flavour)] = t
|
||||||
|
|
||||||
|
def _read_subarch(self, arch, subarch, base):
|
||||||
|
files = self._get_files("debian/arch/%s/%s/%s" % (arch, subarch, self.config_name))
|
||||||
|
c = config_parser(self.schema)
|
||||||
|
c.read(files)
|
||||||
|
t = c.items_convert('base')
|
||||||
|
base.update(t)
|
||||||
|
self['-'.join((arch, subarch))] = t
|
||||||
|
flavours = t.get('flavours', None)
|
||||||
|
for flavour in flavours:
|
||||||
|
self._read_flavour(arch, subarch, flavour, c)
|
||||||
|
|
||||||
class config_parser(object, ConfigParser.ConfigParser):
|
class config_parser(object, ConfigParser.ConfigParser):
|
||||||
def __init__(self, schema):
|
def __init__(self, schema):
|
||||||
ConfigParser.ConfigParser.__init__(self)
|
ConfigParser.ConfigParser.__init__(self)
|
||||||
|
@ -100,35 +129,48 @@ class config_parser(object, ConfigParser.ConfigParser):
|
||||||
ret[key] = convert(value)
|
ret[key] = convert(value)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
class entry(dict):
|
class _sorted_dict(dict):
|
||||||
__slots__ = ('_list')
|
__slots__ = ('_list')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(entry, self).__init__()
|
super(_sorted_dict, self).__init__()
|
||||||
self._list = []
|
self._list = []
|
||||||
|
|
||||||
def __delitem__(self, key):
|
def __delitem__(self, key):
|
||||||
super(entry, self).__delitem__(key)
|
super(_sorted_dict, self).__delitem__(key)
|
||||||
self._list.remove(key)
|
self._list.remove(key)
|
||||||
|
|
||||||
|
def iterkeys(self):
|
||||||
|
for i in iter(self._list):
|
||||||
|
yield i
|
||||||
|
|
||||||
|
def iteritems(self):
|
||||||
|
for i in iter(self._list):
|
||||||
|
yield (i, self[i])
|
||||||
|
|
||||||
|
def itervalues(self):
|
||||||
|
for i in iter(self._list):
|
||||||
|
yield self[i]
|
||||||
|
|
||||||
|
class sorted_dict(_sorted_dict):
|
||||||
|
__slots__ = ()
|
||||||
|
|
||||||
|
def __setitem__(self, key, value):
|
||||||
|
super(sorted_dict, self).__setitem__(key, value)
|
||||||
|
if key not in self._list:
|
||||||
|
self._list.append(key)
|
||||||
|
|
||||||
|
class entry(_sorted_dict):
|
||||||
|
__slots__ = ()
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
super(entry, self).__setitem__(key, value)
|
super(entry, self).__setitem__(key, value)
|
||||||
if key.startswith('_'):
|
|
||||||
return
|
|
||||||
if key not in self._list:
|
if key not in self._list:
|
||||||
if 'Description' in self._list:
|
if 'Description' in self._list:
|
||||||
self._list.insert(len(self._list)-1, key)
|
self._list.insert(len(self._list)-1, key)
|
||||||
else:
|
else:
|
||||||
self._list.append(key)
|
self._list.append(key)
|
||||||
|
|
||||||
def iterkeys(self):
|
|
||||||
for i in self._list:
|
|
||||||
yield i
|
|
||||||
|
|
||||||
def iteritems(self):
|
|
||||||
for i in self._list:
|
|
||||||
yield (i, self[i])
|
|
||||||
|
|
||||||
class wrap(textwrap.TextWrapper):
|
class wrap(textwrap.TextWrapper):
|
||||||
wordsep_re = re.compile(
|
wordsep_re = re.compile(
|
||||||
r'(\s+|' # any whitespace
|
r'(\s+|' # any whitespace
|
||||||
|
|
|
@ -1,15 +1,3 @@
|
||||||
diff -aurN a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
|
|
||||||
--- a/drivers/scsi/Kconfig 2005-06-17 15:48:29.000000000 -0400
|
|
||||||
+++ b/drivers/scsi/Kconfig 2005-06-18 15:19:35.000000000 -0400
|
|
||||||
@@ -1312,8 +1312,6 @@
|
|
||||||
To compile this driver as a module, choose M here: the
|
|
||||||
module will be called qlogicpti.
|
|
||||||
|
|
||||||
-source "drivers/scsi/qla2xxx/Kconfig"
|
|
||||||
-
|
|
||||||
config SCSI_LPFC
|
|
||||||
tristate "Emulex LightPulse Fibre Channel Support"
|
|
||||||
depends on PCI && SCSI
|
|
||||||
diff -aurN a/drivers/scsi/Makefile b/drivers/scsi/Makefile
|
diff -aurN a/drivers/scsi/Makefile b/drivers/scsi/Makefile
|
||||||
--- a/drivers/scsi/Makefile 2005-06-17 15:48:29.000000000 -0400
|
--- a/drivers/scsi/Makefile 2005-06-17 15:48:29.000000000 -0400
|
||||||
+++ b/drivers/scsi/Makefile 2005-06-18 15:19:15.000000000 -0400
|
+++ b/drivers/scsi/Makefile 2005-06-18 15:19:15.000000000 -0400
|
||||||
|
|
|
@ -250,6 +250,15 @@ install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH) $(BUIL
|
||||||
@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $(BUILD_DIR)/$$i ..; mv $(BUILD_DIR)/$$i ..; done
|
@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $(BUILD_DIR)/$$i ..; mv $(BUILD_DIR)/$$i ..; done
|
||||||
rm -rf $(DIR)
|
rm -rf $(DIR)
|
||||||
|
|
||||||
|
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)/debian
|
||||||
|
dh_installdocs $(DH_OPTIONS)
|
||||||
|
dh_installchangelogs $(DH_OPTIONS)
|
||||||
|
$(MAKE) -f debian/rules.real install-base DH_OPTIONS=$(DH_OPTIONS)
|
||||||
|
|
||||||
install-patch: PACKAGE = linux-patch-debian-$(VERSION)
|
install-patch: PACKAGE = linux-patch-debian-$(VERSION)
|
||||||
install-patch: pbase := /usr/src/kernel-patches/all/$(VERSION)
|
install-patch: pbase := /usr/src/kernel-patches/all/$(VERSION)
|
||||||
install-patch: pfull := debian/$(PACKAGE)$(pbase)
|
install-patch: pfull := debian/$(PACKAGE)$(pbase)
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
Package: linux-headers-@version@
|
||||||
|
Section: devel
|
||||||
|
Priority: optional
|
||||||
|
Provides: linux-headers-@version@-@abiname@-all
|
||||||
|
Description: Common architecture-specific header files for Linux kernel @version@
|
||||||
|
This package provides the (sub)architecture-specific common kernel header files
|
||||||
|
for Linux kernel version @version@, generally used for building out-of-tree
|
||||||
|
kernel modules.
|
|
@ -1,5 +1,4 @@
|
||||||
Package: linux-headers-@subarch@@version@-@abiname@-@flavour@
|
Package: linux-headers-@subarch@@version@-@abiname@-@flavour@
|
||||||
Architecture: @arch@
|
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: coreutils | fileutils (>= 4.0), linux-headers-@subarch@@version@-@abiname@ (= ${Source-Version})
|
Depends: coreutils | fileutils (>= 4.0), linux-headers-@subarch@@version@-@abiname@ (= ${Source-Version})
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Package: linux-headers-@subarch@@major@-@flavour@
|
Package: linux-headers-@subarch@@major@-@flavour@
|
||||||
Architecture: @arch@
|
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: linux-headers-@subarch@@version@-@abiname@-@flavour@
|
Depends: linux-headers-@subarch@@version@-@abiname@-@flavour@
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
Package: linux-headers-@version@-@abiname@
|
|
||||||
Architecture: @arch@
|
|
||||||
Section: devel
|
|
||||||
Priority: optional
|
|
||||||
Depends: coreutils | fileutils (>= 4.0)
|
|
||||||
Provides: linux-headers, linux-headers-@major@
|
|
||||||
Description: Common architecture-specific header files for Linux kernel @version@
|
|
||||||
This package provides the (sub)architecture-specific common kernel header files
|
|
||||||
for Linux kernel version @version@, generally used for building out-of-tree
|
|
||||||
kernel modules. To obtain a complete set of headers you also need to install
|
|
||||||
the linux-headers-@version@-@abiname@-(flavour) package, matching the
|
|
||||||
flavour of the kernel you intend the build for. To obtain such a set for the
|
|
||||||
currently running kernel it is sufficient to run a command
|
|
||||||
.
|
|
||||||
apt-get install linux-headers-$(uname -r)
|
|
||||||
.
|
|
||||||
and it will be unpacked in /usr/src/linux-headers-@version@-@abiname@-(flavour).
|
|
|
@ -1,5 +1,4 @@
|
||||||
Package: linux-headers-@subarch@@version@-@abiname@
|
Package: linux-headers-@subarch@@version@-@abiname@
|
||||||
Architecture: @arch@
|
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: coreutils | fileutils (>= 4.0)
|
Depends: coreutils | fileutils (>= 4.0)
|
||||||
|
@ -8,10 +7,10 @@ Description: Common architecture-specific header files for Linux kernel @version
|
||||||
This package provides the (sub)architecture-specific common kernel header files
|
This package provides the (sub)architecture-specific common kernel header files
|
||||||
for Linux kernel version @version@, generally used for building out-of-tree
|
for Linux kernel version @version@, generally used for building out-of-tree
|
||||||
kernel modules. To obtain a complete set of headers you also need to install
|
kernel modules. To obtain a complete set of headers you also need to install
|
||||||
the linux-headers-@version@-@abiname@-(flavour) package, matching the
|
the linux-headers-@subarch@@version@-@abiname@-(flavour) package, matching the
|
||||||
flavour of the kernel you intend the build for. To obtain such a set for the
|
flavour of the kernel you intend the build for. To obtain such a set for the
|
||||||
currently running kernel it is sufficient to run a command
|
currently running kernel it is sufficient to run a command
|
||||||
.
|
.
|
||||||
apt-get install linux-headers-@subarch@@version@-@abiname@-$(uname -r)
|
apt-get install linux-headers-@subarch@$(uname -r)
|
||||||
.
|
.
|
||||||
and it will be unpacked in /usr/src/linux-headers-@subarch@@version@-@abiname@-(flavour).
|
and it will be unpacked in /usr/src/linux-headers-@subarch@@version@-@abiname@-(flavour).
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Package: linux-image-@subarch@@version@-@abiname@-@flavour@
|
Package: linux-image-@subarch@@version@-@abiname@-@flavour@
|
||||||
Architecture: @arch@
|
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Provides: linux-image, linux-image-@major@
|
Provides: linux-image, linux-image-@major@
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Package: linux-image-@subarch@@flavour@
|
Package: linux-image-@subarch@@flavour@
|
||||||
Architecture: @arch@
|
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: linux-image-@subarch@@major@-@flavour@
|
Depends: linux-image-@subarch@@major@-@flavour@
|
||||||
|
@ -8,7 +7,6 @@ Description: Linux kernel image on @class@ machines
|
||||||
@longclass@ machines.
|
@longclass@ machines.
|
||||||
|
|
||||||
Package: linux-image-@subarch@@major@-@flavour@
|
Package: linux-image-@subarch@@major@-@flavour@
|
||||||
Architecture: @arch@
|
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: linux-image-@subarch@@version@-@abiname@-@flavour@
|
Depends: linux-image-@subarch@@version@-@abiname@-@flavour@
|
||||||
|
|
Loading…
Reference in New Issue