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 printUsage() {
35 echo "Usage: gforge-install-1-deps [RHEL4|RHEL5|DEBIAN|FEDORA|CENTOS|ARK|SUSE|OPENSUSE]\n";
38 function INFO($message)
40 global $depth, $myLog;
41 if(VERBOSE) for ($i=0; $i < $depth; $i++) echo " ";
42 if(VERBOSE) echo $message;
43 for($i=0; $i < $depth; $i++ ) $myLog.=" ";
47 function installRedhat() {
48 INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
49 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");
52 function installRHEL4() {
54 INFO("Installing packages: Executing UP2DATE. Please wait...\n\n\n");
55 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");
58 function installDebian() {
60 INFO("Installing Packages with apt-get");
61 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");
63 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix");
66 function installSUSE() {
68 INFO("Installing Packages with yast");
69 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");
71 INFO("Fixing php4 installation");
72 passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
74 INFO("Restarting APACHE");
75 passthru("/etc/init.d/apache2 start");
76 passthru("/etc/init.d/apache2 stop");
78 INFO("Restarting PostgreSQL");
79 passthru("/etc/init.d/postgresql stop");
80 passthru("/etc/init.d/postgresql start");
82 INFO("Starting Apache");
83 passthru("/etc/init.d/apache2 start");
86 function installOPENSUSE() {
88 INFO("Installing Packages with yast");
89 passthru("yast -i apache2-prefork apache2-mod_php5 cvs mailman perl-IPC-Run perl-URI php5 php5-curl php5-gd php5-gettext php5-pgsql postfix postgresql postgresql-contrib postgresql-libs postgresql-server rcs openssh subversion subversion-server wget xinetd viewvc");
91 INFO("Restarting PostgreSQL...");
92 passthru("rcpostgresql restart");
93 INFO("Restarting Apache...");
94 passthru("rcapache2 restart");
97 function installArk() {
98 INFO("Installing packages: Executing apt-get. Please wait...\n\n\n");
99 passthru("apt-get update");
100 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");
102 INFO("Restarting PostgreSQL\n");
103 passthru("/sbin/service postgresql restart");
106 if (count($argv) < 2) {
107 if ( is_file('/etc/SuSE-release') ) {
108 if ( exec('grep openSUSE /etc/SuSE-release') ) {
109 $platform = 'OPENSUSE';
110 echo "detected OPENSUSE platform\n";
113 echo "detected SUSE platform\n";
119 if ($argv[1] == '-h' || $argv[1] == '--help') {
123 $platform = $argv[1];
124 echo "setting up dependencies for $platform\n";
128 if ($platform == 'FEDORA' || $platform == 'CENTOS' || $platform == 'RHEL5') {
130 } elseif ($platform == 'RHEL4') {
132 } elseif ($platform == 'DEBIAN') {
133 installDebian(); /* Debian and friends */
134 } elseif ($platform == 'SUSE') {
136 } elseif ($platform == 'OPENSUSE') {
138 } elseif ($platform == 'ARK') {
141 echo 'UNSUPPORTED PLATFORM\n';