4 * FusionForge Installation Dependency Setup
6 * Copyright 2006 GForge, LLC
11 * This file is part of GInstaller
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
29 define ("VERBOSE", TRUE);
30 define ("GREEN", "\033[01;32m" );
31 define ("NORMAL", "\033[00m" );
32 define ("RED", "\033[01;31m" );
34 function INFO($message)
36 global $depth, $myLog;
37 if(VERBOSE) for ($i=0; $i < $depth; $i++) echo " ";
38 if(VERBOSE) echo $message;
39 for($i=0; $i < $depth; $i++ ) $myLog.=" ";
43 function installRedhat() {
44 INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
45 passthru("yum -y install httpd php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh inetd which liberation-fonts");
48 function installRHEL4() {
50 INFO("Installing packages: Executing UP2DATE. Please wait...\n\n\n");
51 passthru("up2date --install php php-gd php-pgsql mailman postgresql-server postgresql-contrib rcs cvs httpd subversion perl-URI mod_dav_svn ssh postfix mod_ssl wget");
54 function installDebian() {
56 INFO("Installing Packages with apt-get");
57 passthru("apt-get -y install apache2 php5 php5-cli php5-pgsql cvs postgresql postgresql-contrib libipc-run-perl liburi-perl libapache2-svn libapache2-mod-php5 subversion subversion-tools php5-curl curl ssh lsb-release");
59 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix");
62 function installSUSE() {
64 INFO("Installing Packages with yast");
65 passthru("yast -i apache2-prefork php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php4-pgsql subversion apache-mod_dav_svn ssh postfix rcs php4-gd mod_ssl perl-IPC-Run php4-curl wget subversion-server xinetd apache2-mod_php4");
67 INFO("Fixing php4 installation");
68 passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
70 INFO("Restarting APACHE");
71 passthru("/etc/init.d/apache2 start");
72 passthru("/etc/init.d/apache2 stop");
74 INFO("Restarting PostgreSQL");
75 passthru("/etc/init.d/postgresql stop");
76 passthru("/etc/init.d/postgresql start");
77 INFO("Starting Apache");
78 passthru("/etc/init.d/apache2 start");
81 function installArk() {
82 INFO("Installing packages: Executing apt-get. Please wait...\n\n\n");
83 passthru("apt-get update");
84 passthru("apt-get -y install httpd php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php-pgsql subversion subversion-server-httpd postfix rcs mod_ssl wget ssh xinetd");
86 INFO("Restarting PostgreSQL\n");
87 passthru("/sbin/service postgresql restart");
90 if (count($argv) < 2) {
91 echo "Usage: gforge-preinstall.php [RHEL4|RHEL5|DEBIAN|FEDORA|CENTOS|ARK|SUSE]\n";
96 if ($platform == 'FEDORA' || $platform == 'CENTOS' || $platform == 'RHEL5') {
98 } elseif ($platform == 'RHEL4') {
100 } elseif ($platform == 'DEBIAN') {
101 installDebian(); /* Debian and friends */
102 } elseif ($platform == 'SUSE') {
104 } elseif ($platform == 'ARK') {
107 echo 'UNSUPPORTED PLATFORM';