- sourceName = config['sourceName']
- binaryName = config.get('binaryName', sourceName+'-local')
- name = config.get('name', os.getenv('USER')) # os.getlogin() fails in minimal chroots
- email = config.get('email', os.getenv('USER')+'@'+os.uname()[1]) # user@hostname
- debDir = os.path.expanduser(config['debDir'])
- buildSystem = config['buildSystem']
- version = config['version']
- dbgPackage = config.get('dbgPackage', False)
- parallelJobs = int(config.get('parallelJobs', 2))
- packageArchitecture = config.get('architecture', 'any')
+ if not isinstance(config, ConfigDict):
+ config = ConfigDict(config)
+ sourceName = config.getstr('sourceName')
+ binaryName = config.getstr('binaryName', sourceName+'-local')
+ config['binaryName'] = binaryName # make it usable by build systems
+ name = config.getstr('name', os.getenv('USER')) # os.getlogin() fails in minimal chroots
+ email = config.getstr('email', os.getenv('USER')+'@'+os.uname()[1]) # user@hostname
+ debDir = os.path.expanduser(config.getstr('debDir'))
+ buildSystem = buildSystems[config.getstr('buildSystem')] # get the data immediately
+ version = config.getstr('version') # version name excluding epoch (used for filenames)
+ fullVersion = str(config.getint('epoch'))+':'+version if 'epoch' in config else version # version name including epoch
+ dbgPackage = config.getbool('dbgPackage', False)
+ parallelJobs = config.getint('parallelJobs', 2)
+ packageArchitecture = config.getstr('architecture', 'any')
+ withPython2 = config.getbool('withPython2', False)
+ withSIP = config.getbool('withSIP', False)
+ withAutoreconf = config.getbool('withAutoreconf', False)
+ # add some build dependencies (a bit hacky adding it to the build system...)
+ if withSIP:
+ withPython2 = True
+ buildSystem.buildDepends.append("python-sip")
+ buildSystem.binaryDepends.append("${sip:Depends}")
+ if withPython2:
+ buildSystem.buildDepends.append("python")
+ buildSystem.binaryDepends.append("${python:Depends}")
+ if withAutoreconf:
+ buildSystem.buildDepends.append("dh-autoreconf")