Пример #1
0
function install()
{
    $unix = new unix();
    $wget = $unix->find_program("wget");
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    $cp = $unix->find_program("cp");
    $targetfile = latests();
    if (!is_file("{$GLOBALS["WORKDIR"]}/{$targetfile}")) {
        echo "Downloading source file `{$targetfile}` on base `{$GLOBALS["URISRC"]}`\n";
        shell_exec("{$wget} {$GLOBALS["URISRC"]}/{$targetfile} -O {$GLOBALS["WORKDIR"]}/{$targetfile}");
    }
    if (!is_file("{$GLOBALS["WORKDIR"]}/{$targetfile}")) {
        echo "Failed downloading {$GLOBALS["URISRC"]}/{$targetfile}\n";
        return;
    }
    echo "Extracting {$targetfile}\n";
    shell_exec("{$tar} xf {$GLOBALS["WORKDIR"]}/{$targetfile} -C {$GLOBALS["WORKDIR"]}/");
    echo "Parsing directories {$GLOBALS["WORKDIR"]}\n";
    $dirs = $unix->dirdir($GLOBALS["WORKDIR"]);
    while (list($num, $line) = each($dirs)) {
        $dirname = basename($num);
        if (preg_match("#^cas-server-#", $dirname)) {
            $sourcedir = $num;
            break;
        }
    }
    echo "Source directory `{$sourcedir}`\n";
    if (!is_dir($sourcedir)) {
        echo "Failed extracting {$targetfile}\n";
        return;
    }
    if (is_dir("/usr/share/cas-server")) {
        echo "Cleaning old installation...\n";
        shell_exec("/bin/rm -rf /usr/share/cas-server");
    }
    @mkdir("/usr/share/cas-server", 0755, true);
    echo "installing `{$sourcedir}` in /usr/share/cas-server\n";
    shell_exec("{$cp} -rf {$sourcedir}/* /usr/share/cas-server/");
    if (!is_file("/usr/share/cas-server/pom.xml")) {
        echo "Failed...\n";
        return;
    }
    echo "Cleaning temp files...\n";
    shell_exec("/bin/rm -rf {$GLOBALS["WORKDIR"]}");
}
Пример #2
0
    create_package();
    exit;
}
if ($argv[1] == "--c-icap-remove") {
    die;
    exit;
}
$wget = $unix->find_program("wget");
$tar = $unix->find_program("tar");
$rm = $unix->find_program("rm");
$cp = $unix->find_program("cp");
//http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.0.13.tar.gz
$dirsrc = "squid-3.2.0.16";
$Architecture = Architecture();
if (!$GLOBALS["NO_COMPILE"]) {
    $v = latests();
    if (preg_match("#squid-(.+?)-#", $v, $re)) {
        $dirsrc = $re[1];
    }
    system_admin_events("Downloading lastest file {$v}, working directory {$dirsrc} ...", __FUNCTION__, __FILE__, __LINE__);
}
if (!$GLOBALS["FORCE"]) {
    if (is_file("/root/{$v}")) {
        if ($GLOBALS["REPOS"]) {
            echo "No updates...\n";
            die;
        }
    }
}
if (is_dir("/root/squid-builder")) {
    shell_exec("{$rm} -rf /root/squid-builder");
Пример #3
0
    $GLOBALS["FORCE"] = true;
}
if ($argv[1] == "--factorize") {
    factorize($argv[2]);
    exit;
}
if ($argv[1] == "--serialize") {
    serialize_tests();
    exit;
}
if ($argv[1] == "--latests") {
    latests();
    exit;
}
if ($argv[1] == "--latest") {
    echo "Latest:" . latests() . "\n";
    exit;
}
if ($argv[1] == "--create-package") {
    create_package();
    exit;
}
if ($argv[1] == "--parse-install") {
    parse_install($argv[2]);
    exit;
}
$wget = $unix->find_program("wget");
$tar = $unix->find_program("tar");
$rm = $unix->find_program("rm");
$cp = $unix->find_program("cp");
//http://ftp.samba.org/pub/samba/stable/
Пример #4
0
    $GLOBALS["FORCE"] = true;
}
if ($argv[1] == "--cross-packages") {
    crossroads_package();
    exit;
}
if ($argv[1] == "--factorize") {
    factorize($argv[2]);
    exit;
}
if ($argv[1] == "--serialize") {
    serialize_tests();
    exit;
}
if ($argv[1] == "--latests") {
    latests();
    exit;
}
if ($argv[1] == "--error-txt") {
    error_txt();
    exit;
}
if ($argv[1] == "--c-icap") {
    package_c_icap();
    exit;
}
if ($argv[1] == "--ufdb") {
    package_ufdbguard();
    exit;
}
if ($argv[1] == "--msmtp") {