return r
def automakeRules(config):
+ # "build" is what we are building *on*, and "host" is what we are building *for* (and GNU is weird...)
+ # also, we don't really support cross-building... ;-) (to do, we'd have to write shell code that checks whether BUILD_GNU_TYPE
+ # and HOST_GNU_TYPE are equal, and if they are not, add a --host parameter)
r = RulesFile()
r.dh += ["--buildsystem=autoconf"]
r.rules['auto_configure'] = [
'BUILD_TYPE=$$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) && ' + # doing the expansion beforehand ensures that we cancel if it fails
- 'MULTIARCH=$$(dpkg-architecture -qDEB_BUILD_MULTIARCH) && '+
+ 'MULTIARCH=$$(dpkg-architecture -qDEB_HOST_MULTIARCH) && '+
'./configure --build=$$BUILD_TYPE '+ # do the escape manually here so we can use the variables (there's no user-controlled string in here anyway)
'--prefix=/usr --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info '+
'--libdir=/usr/lib/$$MULTIARCH --libexecdir=/usr/lib/$$MULTIARCH '+
return command
def getArchitecture(config):
- cmd = commandInBuildEnv(config, ['dpkg-architecture', '-qDEB_BUILD_ARCH'])
+ cmd = commandInBuildEnv(config, ['dpkg-architecture', '-qDEB_HOST_ARCH'])
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
res = p.communicate()[0] # get only stdout
if p.returncode != 0: raise Exception("Querying dpkg for the architecture failed")
files.append(os.path.join(debDir, "%s-dbg_%s_%s.deb" % (binaryName, version, arch)))
# install file
with open('debian/'+binaryName+'.install', 'w') as f:
- for line in config.get('binaryInstall', []):
+ for line in config.get('binaryInstallFiles', []):
if line.startswith('/'): # a file from within the package, not from the source tree
line = 'debian/'+binaryName+line
print >>f, line