2007-09-10 10:40:50 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2006-01-22 18:34:58 +00:00
|
|
|
import sys
|
|
|
|
sys.path.append(sys.path[0] + "/../lib/python")
|
|
|
|
import debian_linux.gencontrol
|
2006-04-09 21:17:21 +00:00
|
|
|
from debian_linux.config import *
|
2006-03-04 17:04:46 +00:00
|
|
|
from debian_linux.debian import *
|
2006-01-22 18:34:58 +00:00
|
|
|
|
|
|
|
class gencontrol(debian_linux.gencontrol.gencontrol):
|
2006-04-09 21:17:21 +00:00
|
|
|
def __init__(self, config):
|
|
|
|
super(gencontrol, self).__init__(config)
|
2006-04-14 16:52:33 +00:00
|
|
|
self.process_config_version(config_parser({}, [sys.path[0] + "/../version"]))
|
2006-04-09 21:17:21 +00:00
|
|
|
|
2006-06-24 11:39:08 +00:00
|
|
|
def do_main_packages(self, packages, extra):
|
2006-04-14 16:52:33 +00:00
|
|
|
vars = self.vars
|
2006-01-22 18:34:58 +00:00
|
|
|
|
|
|
|
main = self.templates["control.main"]
|
|
|
|
packages.extend(self.process_packages(main, vars))
|
|
|
|
|
2006-04-14 16:59:36 +00:00
|
|
|
packages['source']['Build-Depends'].extend(
|
|
|
|
['linux-support-%s%s' % (self.version['upstream'], self.abiname)]
|
|
|
|
)
|
|
|
|
packages['source']['Build-Depends'].extend(
|
|
|
|
['linux-headers-%s%s-all-%s [%s]' % (self.version['upstream'], self.abiname, arch, arch)
|
|
|
|
for arch in self.config['base',]['arches']],
|
|
|
|
)
|
2006-03-04 17:04:46 +00:00
|
|
|
|
2006-10-01 21:10:33 +00:00
|
|
|
def do_flavour(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
|
|
|
|
config_entry = self.config.merge('base', arch, subarch, flavour)
|
|
|
|
if config_entry.get('modules', True) is False:
|
|
|
|
return
|
|
|
|
|
|
|
|
super(gencontrol, self).do_flavour(packages, makefile, arch, subarch, flavour, vars, makeflags, extra)
|
|
|
|
|
2006-01-22 18:34:58 +00:00
|
|
|
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)
|
|
|
|
|
2007-09-27 14:01:41 +00:00
|
|
|
cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags]
|
|
|
|
cmds_build = ["$(MAKE) -f debian/rules.real build %s" % makeflags]
|
|
|
|
cmds_setup = ["$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags]
|
|
|
|
makefile.add('binary-arch_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_binary_arch)
|
|
|
|
makefile.add('build_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_build)
|
|
|
|
makefile.add('setup_%s_%s_%s_real' % (arch, subarch, flavour), cmds = cmds_setup)
|
2006-01-22 18:34:58 +00:00
|
|
|
|
2006-04-14 16:52:33 +00:00
|
|
|
def process_config_version(self, config):
|
|
|
|
entry = config['version',]
|
2006-08-29 09:53:31 +00:00
|
|
|
self.version = parse_version(entry['source'])
|
|
|
|
self.abiname = entry['abiname']
|
|
|
|
self.vars = self.process_version_linux(self.version, self.abiname)
|
2006-04-09 21:17:21 +00:00
|
|
|
|
2006-01-22 18:34:58 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
gencontrol(sys.path[0] + "/../arch")()
|