4 * FusionForge Installation Dependency Setup
6 * Copyright 2006 GForge, LLC
11 * This file is part of GInstaller. It is be called by install.sh.
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: fusionforge-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 addFusionForgeYumRepo();
49 addDagRPMForgeYumRepo();
50 INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
51 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 which htmlpurifier php-mbstring php-jpgraph poppler-utils php-pecl-zip antiword");
54 function installRHEL4() {
55 INFO("Installing packages: Executing UP2DATE. Please wait...\n\n\n");
56 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");
57 INFO(RED."You Must Install htmlpurifier manually.");
60 function installDebian() {
62 INFO("Installing Packages with apt-get");
63 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");
65 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix");
68 function installSUSE() {
70 INFO("Installing Packages with yast");
71 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 apache2-mod_php4");
73 INFO("Fixing php4 installation");
74 passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
76 INFO("Restarting APACHE");
77 passthru("/etc/init.d/apache2 start");
78 passthru("/etc/init.d/apache2 stop");
80 INFO("Restarting PostgreSQL");
81 passthru("/etc/init.d/postgresql stop");
82 passthru("/etc/init.d/postgresql start");
84 INFO("Starting Apache");
85 passthru("/etc/init.d/apache2 start");
87 INFO(RED."You Must Install htmlpurifier manually.");
90 function installOPENSUSE() {
92 INFO("Installing Packages with yast");
93 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 viewvc");
95 INFO("Restarting PostgreSQL...");
96 passthru("rcpostgresql restart");
97 INFO("Restarting Apache...");
98 passthru("rcapache2 restart");
100 INFO(RED."You Must Install htmlpurifier manually.");
103 function installArk() {
104 INFO("Installing packages: Executing apt-get. Please wait...\n\n\n");
105 passthru("apt-get update");
106 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");
108 INFO("Restarting PostgreSQL\n");
109 passthru("/sbin/service postgresql restart");
111 INFO(RED."You Must Install htmlpurifier manually.");
114 function addFusionForgeYumRepo() {
115 INFO("Adding FusionForge YUM repository\n");
117 if (getenv('FFORGE_RPM_REPO')) {
118 $rpm_repo = getenv('FFORGE_RPM_REPO');
120 $rpm_repo = 'http://fusionforge.fusionforge.org/rpm/5.1';
124 # Name: FusionForge RPM Repository
125 # URL: http://fusionforge.org/
127 name = Red Hat Enterprise $releasever - fusionforge.org
128 baseurl = '.$rpm_repo.'
132 file_put_contents('/etc/yum.repos.d/fusionforge.repo', $repo);
134 function addDagRPMForgeYumRepo() {
135 INFO("Adding Dag RPMForge YUM repository\n");
137 # Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
138 # URL: http://rpmforge.net/
140 name = Red Hat Enterprise $releasever - RPMforge.net - dag
141 baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
142 #mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
146 file_put_contents('/etc/yum.repos.d/dag-rpmforge.repo', $repo);
149 if (count($argv) < 2) {
150 if ( is_file('/etc/SuSE-release') ) {
151 if ( exec('grep openSUSE /etc/SuSE-release') ) {
152 $platform = 'OPENSUSE';
153 echo "detected OPENSUSE platform\n";
156 echo "detected SUSE platform\n";
162 if ($argv[1] == '-h' || $argv[1] == '--help') {
166 $platform = $argv[1];
167 echo "setting up dependencies for $platform\n";
171 if ($platform == 'FEDORA' || $platform == 'CENTOS' || $platform == 'RHEL5') {
173 } elseif ($platform == 'RHEL4') {
175 } elseif ($platform == 'DEBIAN') {
176 installDebian(); /* Debian and friends */
177 } elseif ($platform == 'SUSE') {
179 } elseif ($platform == 'OPENSUSE') {
181 } elseif ($platform == 'ARK') {
184 echo 'UNSUPPORTED PLATFORM\n';