From: Ralf Jung Date: Tue, 31 Jul 2012 11:12:18 +0000 (+0200) Subject: fix usgae of host and build architecture; rename binaryInstall -> binaryInstallFiles X-Git-Url: https://git.ralfj.de/auto-debuild.git/commitdiff_plain/a3a4796a2966d282b2d08475a8ad3a3d9027e312?ds=inline fix usgae of host and build architecture; rename binaryInstall -> binaryInstallFiles --- diff --git a/auto_debuild.py b/auto_debuild.py index cb2d840..ab04dc0 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -53,11 +53,14 @@ def cmakeRules(config): 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 '+ @@ -74,7 +77,7 @@ def commandInBuildEnv(config, command): 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") @@ -148,7 +151,7 @@ def createDebianFiles(config): 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