Builds the installer from a tgz package that comes with dpat. This is the default cause when the app does not have its own installer

@param {String} projectDir
@param {InstallerBuilder} builder
@param {Function} cb
17376
function defaultStrategy(projectDir, builder, cb)
{
  const pkg = fs.realpathSync(INSTALLER_PACKAGE);
  builder.buildFromPackage(pkg, projectDir, cb);
}
795551
def dpkg_buildpackage(*args,**kwargs):
    cwd=kwargs.pop('cwd',None)
    if len(kwargs)!=0:
        raise ValueError('only kwarg can be "cwd"')
    ""
    args = ['/usr/bin/dpkg-buildpackage']+list(args)
    process_command(args, cwd=cwd)
1028123
function tree (dir, opts, cb) {
  var i = 0
  findPackage(dir, function (err, pkg) {
    pull(
      pull.depthFirst(pkg, function (pkg) {
        pkg.tree = {}
        return pull(
          pfs.readdir(path.resolve(pkg.path, 'node_modules')),
          paramap(maybe(readPackage)),
          pull.filter(function (_pkg) {
            if(!_pkg) return
            _pkg.parent = pkg
            
            pkg.tree[_pkg.name] = _pkg
            return pkg
          })
        )
      }),
      opts.post ? paramap(function (data, cb) {
        //run a post install-style hook.
        opts.post(data, cb)
      }) : pull.through(),
      pull.drain(null, function (err) {
        cb(err === true ? null : err, clean(pkg))
      })
    )
  })
}
1031021
function buildBuilder(mqttClient, opts) {
   var connection;

   connection = tls.connect(opts);

   function handleTLSerrors(err) {
      mqttClient.emit('error', err);
      connection.end();
   }

   connection.on('secureConnect', function() {
      if (!connection.authorized) {
         connection.emit('error', new Error('TLS not authorized'));
      } else {
         connection.removeListener('error', handleTLSerrors);
      }
   });

   connection.on('error', handleTLSerrors);
   return connection;
}
1115837
async function flowBuildPlugin(pkg, options) {
  const buildOutputRoot = path.resolve(
    pkg.paths.root,
    options.outputDir || './build',
  )
  const patterns = (
    options.inputs || ['**/*.js', '!__tests__', '!test.js']
  ).concat(['!node_modules/**/*', `!${path.basename(buildOutputRoot)}/**/*`])
  const sourceRoot =
    options.sourceDir != null
      ? path.resolve(pkg.paths.root, options.sourceDir)
      : pkg.paths.root

  // :: string -> Array<string>
  const getJsFilePaths = () =>
    globby(patterns, {
      cwd: sourceRoot,
    })

  const filePaths = await getJsFilePaths()

  // :: string -> Promise<void>
  const transpileFile = filePath =>
    new Promise(resolve => {
      const module = path.resolve(sourceRoot, filePath)
      const input = fs.readFileSync(module, 'utf8')
      const output = flowRemoveTypes(input)
      const outFile = path.resolve(buildOutputRoot, filePath)
      ensureParentDirectoryExists(outFile)
      fs.writeFileSync(outFile, output.toString(), { encoding: 'utf8' })
      fs.writeFileSync(`${outFile}.flow`, input, { encoding: 'utf8' })
      resolve()
    })

  const limit = pLimit(maxConcurrentTranspiles)
  const queueTranspile = filePath => limit(() => transpileFile(filePath))
  await Promise.all(R.map(queueTranspile, filePaths))
}
519312
@Override
    public Path build(Path base) throws IOException
    {
        this.dir = base.resolve(name+"-"+version);
        this.debian = dir.resolve("debian");
        control.setStandardsVersion(STANDARDS_VERSION);
        changeLog.set(name, version, release, maintainer);
        control.setSource(name);
        for (FileBuilder fb : fileBuilders)
        {
            fb.build();
        }
        copyright.save(debian);
        control.save(debian);

        changeLog.save(debian);
        // compat
        Path compat = debian.resolve("compat");
        try (BufferedWriter bf = Files.newBufferedWriter(compat, UTF_8))
        {
            bf.append(String.format("%d\n", compatibility));
        }
        for (MaintainerScript ms : maintainerScripts)
        {
            ms.save();
        }
        // rules
        Path rules = debian.resolve("rules");
        FileUtil.copyResource("/rules", rules, DEBBuilder.class);
        PosixHelp.setPermission(rules, "-rwxr-xr-x");
        // source/format
        Path source = debian.resolve("source");
        Files.createDirectories(source);
        Path format = source.resolve("format");
        try (BufferedWriter bf = Files.newBufferedWriter(format, UTF_8))
        {
            bf.append(SOURCE_FORMAT);
        }
        conffiles.save(debian);
        docs.save(debian);
        try
        {
            OSProcess.call(dir, null, "dpkg-buildpackage -us -uc");
        }
        catch (InterruptedException ex)
        {
            throw new IOException(ex);
        }
        return dir;
    }
1148770
function preBuild(addonPath) {
  // Require the addon
  let addonToBuild = require(addonPath);
  // Augment it with isDevelopingAddon function.
  addonToBuild.isDevelopingAddon = function() {
    return true;
  }
  // If addon has pre-built path set in it use that else use the default path
  if(!addonToBuild.PREBUILT_PATH) {
    addonToBuild.PREBUILT_PATH = `${addonPath}/pre-built`;
  }
  fs.removeSync(addonToBuild.PREBUILT_PATH);

  const ui = new UI({
    inputStream: process.stdin,
    outputStream: process.stdout,
    errorStream: process.stderr,
    writeLevel: 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR',
    ci: true | false
  });
  const project = Project.closestSync(addonPath, ui);
  // Extend the current addon from base Addon
  const CurrentAddon = Addon.extend(Object.assign({}, addonToBuild, {root: addonPath, pkg: project.pkg}));
  const currAddon  = new CurrentAddon(addonPath, project);

  // Get the tree for Addon and Vendor
  let addonTree = new Funnel (currAddon.treeFor('addon'), {
    destDir:  'addon'
  });

  let vendorTree = new Funnel (currAddon.treeFor('vendor'), {
    destDir:  'vendor'
  });

  // Merge, Build the resulting tree and store it in prebuild path
  return build(new Merge([addonTree, vendorTree], { annotation: '[ember-rollup] Merging prebuild addon and vendor tree' }), addonToBuild.PREBUILT_PATH);
 }
857266
function getTempBuildDir(packageName, version) {
    return temp.mkdirAsync('makdeb')
    .then(function(tempDir) {
        return path.join(tempDir, packageName +'-'+ version);
    });
}
293575
function TpBuilderProcess(str, options){
    let init = str;
    if (typeof str === 'object') {
        init = init.map((item) => '{{@ ' + item + ' }}').join('\n');
    }
    return new TpBuilder(init, options).parse();
}
557843
public function packagePhpBuild($build_root)
    {
        $project_root = ProjectX::projectRoot();

        $stack = $this->taskFilesystemStack();
        if (file_exists("{$project_root}/patches")) {
            $stack->mirror("{$project_root}/patches", "{$build_root}/patches");
        }
        $stack->copy("{$project_root}/composer.json", "{$build_root}/composer.json");
        $stack->copy("{$project_root}/composer.lock", "{$build_root}/composer.lock");
        $stack->run();

        return $this;
    }
648871
function customStrategyInPlace(projectDir, builder, cb)
{
  const installerDir = path.resolve(projectDir, "node_modules", "@deskpro", INSTALLER_PACKAGE_NAME);
  const customInstallerTarget = path.resolve(installerDir, "src", "settings");
  shelljs.rm('-rf', customInstallerTarget);

  const copyOptions = { overwrite: true, expand: true, dot: true };

  function onCustomInstallerFilesReady (err) {
    builder.buildFromSource(installerDir, projectDir);
    cb();
  }

  let customInstallerSrc = path.resolve(projectDir, "src", "installer");
  customInstallerSrc = fs.realpathSync(customInstallerSrc);

  copy(customInstallerSrc, customInstallerTarget, copyOptions, onCustomInstallerFilesReady);
}
643360
function startPackage(package, cb) {
   if (isUndefined(packageRuntimes[package.packageName])) {
      packageRuntimes[package.packageName] = {};
   }

   var packageRuntime = packageRuntimes[package.packageName];

   if (!isUndefined(packageRuntime.process)) {
      cb(new Error('package already running'));
      return;
   }

   packageRuntime.startupTimer = setTimeout(function() { 
      packageRuntime.startupTimer = null;
      cb();
   }, startupTimout * 1000);

   packageRuntime.process = exec(package.launchCommand, { cwd: (!isUndefined(package.workingDirectory) ? path.resolve(package.workingDirectory) : undefined) }, function(err) {
      packageRuntime.process = null;
      if (!isUndefined(packageRuntime.startupTimer)) {
         clearTimeout(packageRuntime.startupTimer);
         packageRuntime.startupTimer = null;
         cb(err);
      } else if (!isUndefined(packageRuntime.killTimer)) {
         clearTimeout(packageRuntime.killTimer);
         packageRuntime.killTimer = null;
         packageRuntime.killedCallback();
         packageRuntime.killedCallback = null;
      }
   });
}
296135
function buildDep(file, pkg){
  var files = [];

  if (file.processed || file.package != pkg)
    return files;

  file.processed = true;

  for (var i = 0, depFile; depFile = file.deps[i++];)
    files.push.apply(files, buildDep(depFile, file.package));

  files.push(file);

  return files;
}
1282864
def build_install(self):
        
        slackbuilds = self.dependencies + self.master_packages
        installs, upgraded, = [], []
        if not os.path.exists(self.build_folder):
            os.makedirs(self.build_folder)
        if not os.path.exists(self._SOURCES):
            os.makedirs(self._SOURCES)
        os.chdir(self.build_folder)
        for prgnam in slackbuilds:
            if (self.meta.not_downgrade == "on" and
                    self.not_downgrade(prgnam) is True):
                continue
            pkg = "-".join(prgnam.split("-")[:-1])
            installed = "".join(find_package(prgnam, self.meta.pkg_path))
            src_link = SBoGrep(pkg).source().split()
            if (installed and "--download-only" not in self.flag and
                    "--rebuild" not in self.flag):
                self.msg.template(78)
                self.msg.pkg_found(prgnam)
                self.msg.template(78)
            elif self.unst[0] in src_link or self.unst[1] in src_link:
                self.msg.template(78)
                print("| Package {0} {1}{2}{3}".format(
                    prgnam, self.meta.color["RED"], "".join(src_link),
                    self.meta.color["ENDC"]))
                self.msg.template(78)
            else:
                sbo_url = sbo_search_pkg(pkg)
                sbo_link = SBoLink(sbo_url).tar_gz()
                script = sbo_link.split("/")[-1]
                if self.meta.sbosrcarch in ["on", "ON"]:
                    src_link = self.sbosrcarsh(prgnam, sbo_link, src_link)
                Download(self.build_folder, sbo_link.split(),
                         repo="sbo").start()
                Download(self._SOURCES, src_link, repo="sbo").start()
                if "--download-only" in self.flag:
                    continue
                sources = self.filenames(src_link)
                BuildPackage(script, sources, self.build_folder,
                             auto=False).build()
                binary = slack_package(prgnam)
                if os.path.isfile("".join(binary)):
                    if GetFromInstalled(pkg).name() == pkg:
                        print("[ {0}Upgrading{1} ] --> {2}".format(
                            self.meta.color["YELLOW"],
                            self.meta.color["ENDC"], prgnam))
                        upgraded.append(prgnam)
                    else:
                        print("[ {0}Installing{1} ] --> {2}".format(
                            self.meta.color["GREEN"],
                            self.meta.color["ENDC"], prgnam))
                        installs.append(prgnam)
                    if ("--rebuild" in self.flag and
                            GetFromInstalled(pkg).name() == pkg):
                        PackageManager(binary).upgrade(flag="--reinstall")
                    else:
                        PackageManager(binary).upgrade(flag="--install-new")
        return installs, upgraded
1137314
private function cloneToBuildDir($buildDir)
    {
        $gitRoot = $this->gitHelper->getRoot($this->appRoot, true);
        $ref = $this->gitHelper->execute(['rev-parse', 'HEAD'], $gitRoot, true);

        $cloneArgs = ['--recursive', '--shared'];
        $tmpRepo = $buildDir . '-repo';
        if (file_exists($tmpRepo)) {
            $this->fsHelper->remove($tmpRepo, true);
        }
        $this->gitHelper->cloneRepo($gitRoot, $tmpRepo, $cloneArgs, true);
        $this->gitHelper->checkOut($ref, $tmpRepo, true, true);
        $this->fsHelper->remove($tmpRepo . '/.git');

        $appDir = $tmpRepo . '/' . substr($this->appRoot, strlen($gitRoot));
        if (!rename($appDir, $buildDir)) {
            throw new \RuntimeException(sprintf('Failed to move app from %s to %s', $appDir, $buildDir));
        }
        $this->fsHelper->remove($tmpRepo);
    }
1305475
function build(projectInfo, backendProject, callback){
    if(isNewBuildNeeded(projectInfo)){
        console.log('   generating backend project content')
        backendContentManager.generateContents(projectInfo, backendProject, function(){
            console.log('   done')
            if(callback){
                callback(true)
            }
        })
    }else{
        if(callback){
            callback(false)
        }
    }
}
945421
function build(TaskConfig, crx) {
    return new Promise(function(resolve, reject){
	mkdir(path.dirname(TaskConfig.dest), function(err){
	  if (err) {
	    return reject(err);
	  }

	  resolve();
	});
      })
      .then(function(){
	return crx.load(TaskConfig.src);
      })
      .then(function(){
	return crx.loadContents();
      })
      .then(function(archiveBuffer){
	if (path.extname(TaskConfig.dest) === '.zip') {
	  grunt.file.write(TaskConfig.dest, archiveBuffer);
	  grunt.log.ok(TaskConfig.dest + ' has been created.');
	}

	return archiveBuffer;
      })
      .then(function writeCrxArchive(archiveBuffer){
	if (path.extname(TaskConfig.dest) === '.crx') {
	  return crx.pack(archiveBuffer).then(function(crxBuffer) {
	    grunt.file.write(TaskConfig.dest, crxBuffer);
	    grunt.log.ok(TaskConfig.dest + ' has been created.');
	  }).catch(grunt.log.error);
	}
      });
  }