Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 13220f5ec1
Fetching contributors…

Cannot retrieve contributors at this time

executable file 71 lines (56 sloc) 1.972 kB
#!/usr/bin/env php
require_once(dirname(__FILE__) . '/common.php');
$flags = array(
'depends' => '-d',
'postinst' => '--post-install',
'preinst' => '--pre-install',
'postrm' => '--post-uninstall',
'prerm' => '--pre-uninstall',
'debconfconfig' => '--deb-config',
'debconftemplate' => '--deb-templates',
'configfile' => '--config-files',
$configure = get_config('configure');
$filemapping = get_config('filemapping');
print 'Generating makefile... ';
$makefile = get_makefile_in();
$install_cmd = get_install_cmd();
// check if some flags are missing from the config and set them to an empty
// value. Used for backwards compatibility
foreach($flags as $key=>$value) {
if(!isset($configure[$key])) {
$configure[$key] = '';
$makefile = replace($makefile, 'INSTALLCMD', $install_cmd);
$makefile = template($makefile, $configure, $flags);
$fp = fopen('Makefile', 'w');
if($fp === false) {
die("Error: unable to open the file Makefile for writing.\n");
fputs($fp, $makefile);
function checkForCmd($cmd) {
$out = $ret = null;
print " checking for '$cmd': ";
exec('which ' . $cmd, $out, $ret);
if($ret === 0) {
print "ok\n";
} else {
print "not found!\n ***\n";
print " please make sure '$cmd' is installed and in your path before you run 'make'!\n ***\n";
print "done\n";
print "checking for prerequisites...\n";
print "You can now use `make` to create your package.\n";
print "
The package is generated from the files in your working directory. You should
make really sure that you have a clean and up-to-date working directory before
building a package. Or even better use a dedicated working directory for
building packages.
Jump to Line
Something went wrong with that request. Please try again.