- print >>f, "Description:",sourceName,"debug smbols (auto-debuild)"
- print >>f, " Package containing debug symbols for "+sourceName+", auto-generated by auto-debuild."
- files.append(os.path.join(debDir, "%s-dbg_%s_%s.deb" % (binaryName, version, arch)))
+ print("Description:",sourceName,"shim for",shim,"(auto-debuild)", file=f)
+ print(" Package pretending to be "+shim+", auto-generated by auto-debuild.", file=f)
+ files.append(os.path.join(debDir, "{}_{}_{}.deb".format(shim, version, arch)))
+ # install file
+ with open('debian/'+binaryName+'.install', 'w') as f:
+ 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(line, file=f)
+ # maintainer scripts for alternatives
+ if 'alternatives' in config:
+ with open('debian/'+binaryName+'.postinst', 'w') as f:
+ print("#!/bin/sh", file=f)
+ print("set -e", file=f)
+ print('if [ "$1" = "configure" ]; then', file=f)
+ for alternative in config.get('alternatives'):
+ alternative = shlex.split(alternative)
+ print(safeCall('update-alternatives', '--install', alternative[0], alternative[1], alternative[2], alternative[3]), file=f)
+ print('fi', file=f)
+ print(file=f)
+ print('#DEBHELPER#', file=f)
+ print(file=f)
+ print('exit 0', file=f)
+ with open('debian/'+binaryName+'.prerm', 'w') as f:
+ print("#!/bin/sh", file=f)
+ print("set -e", file=f)
+ print('if [ "$1" = "remove" ]; then', file=f)
+ for alternative in config.get('alternatives'):
+ alternative = shlex.split(alternative)
+ print(safeCall('update-alternatives', '--remove', alternative[1], alternative[2]), file=f)
+ print('fi', file=f)
+ print(file=f)
+ print('#DEBHELPER#', file=f)
+ print(file=f)
+ print('exit 0', file=f)