-def buildDebianPackage():
- subprocess.check_call(['dpkg-checkbuilddeps'])
- subprocess.check_call(['debian/rules', 'clean'])
- subprocess.check_call(['debian/rules', 'build'])
- subprocess.check_call(['fakeroot', 'debian/rules', 'binary'])
- subprocess.check_call(['debian/rules', 'clean'])
+def buildDebianPackage(config):
+ commands = ['dpkg-checkbuilddeps', 'debian/rules clean', 'debian/rules build', 'fakeroot debian/rules binary', 'debian/rules clean']
+ command = ['bash', '-c', ' && '.join(commands)]
+ subprocess.check_call(commandInBuildEnv(config, command))
+
+# all at once
+def createAndInstall(config, overwriteCheck = False):
+ # generate debian files
+ files = createDebianFiles(config)
+ # check if a file is overwritten
+ if overwriteCheck:
+ for file in files:
+ if os.path.exists(file):
+ if raw_input("Do you want to overwrite %s (y/N)? " % file).lower() != "y":
+ sys.exit(1)
+ # run compilation
+ buildDebianPackage(config)
+ # install files
+ print "Installing created deb files..."
+ subprocess.check_call(['sudo', 'dpkg', '--install'] + files)