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 liberation-fonts htmlpurifier php-mbstring php-jpgraph-1.5.2 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");
64 passthru("a2enmod headers");
65 passthru("a2enmod proxy");
66 passthru("a2enmod ssl");
67 passthru("a2enmod rewrite");
69 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix");
72 function installSUSE() {
74 INFO("Installing Packages with yast");
75 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");
77 INFO("Fixing php4 installation");
78 passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
80 INFO("Restarting APACHE");
81 passthru("/etc/init.d/apache2 start");
82 passthru("/etc/init.d/apache2 stop");
84 INFO("Restarting PostgreSQL");
85 passthru("/etc/init.d/postgresql stop");
86 passthru("/etc/init.d/postgresql start");
88 INFO("Starting Apache");
89 passthru("/etc/init.d/apache2 start");
91 INFO(RED."You Must Install htmlpurifier manually.");
94 function installOPENSUSE() {
96 INFO("Installing Packages with yast");
97 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");
99 INFO("Restarting PostgreSQL...");
100 passthru("rcpostgresql restart");
101 INFO("Restarting Apache...");
102 passthru("rcapache2 restart");
104 INFO(RED."You Must Install htmlpurifier manually.");
107 function installArk() {
108 INFO("Installing packages: Executing apt-get. Please wait...\n\n\n");
109 passthru("apt-get update");
110 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");
112 INFO("Restarting PostgreSQL\n");
113 passthru("/sbin/service postgresql restart");
115 INFO(RED."You Must Install htmlpurifier manually.");
118 function addFusionForgeYumRepo() {
119 INFO("Adding FusionForge YUM repository\n");
121 if (getenv('FFORGE_RPM_REPO')) {
122 $rpm_repo = getenv('FFORGE_RPM_REPO');
124 $rpm_repo = 'http://fusionforge.fusionforge.org/rpm/5.1';
128 # Name: FusionForge RPM Repository
129 # URL: http://fusionforge.org/
131 name = Red Hat Enterprise $releasever - fusionforge.org
132 baseurl = '.$rpm_repo.'
136 file_put_contents('/etc/yum.repos.d/fusionforge.repo', $repo);
138 function addDagRPMForgeYumRepo() {
139 INFO("Adding Dag RPMForge YUM repository\n");
141 # Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
142 # URL: http://rpmforge.net/
144 name = Red Hat Enterprise $releasever - RPMforge.net - dag
145 baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
146 #mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
150 file_put_contents('/etc/yum.repos.d/dag-rpmforge.repo', $repo);
153 if (count($argv) < 2) {
154 if ( is_file('/etc/SuSE-release') ) {
155 if ( exec('grep openSUSE /etc/SuSE-release') ) {
156 $platform = 'OPENSUSE';
157 echo "detected OPENSUSE platform\n";
160 echo "detected SUSE platform\n";
166 if ($argv[1] == '-h' || $argv[1] == '--help') {
170 $platform = $argv[1];
171 echo "setting up dependencies for $platform\n";
175 if ($platform == 'FEDORA' || $platform == 'CENTOS' || $platform == 'RHEL5') {
177 } elseif ($platform == 'RHEL4') {
179 } elseif ($platform == 'DEBIAN') {
180 installDebian(); /* Debian and friends */
181 } elseif ($platform == 'SUSE') {
183 } elseif ($platform == 'OPENSUSE') {
185 } elseif ($platform == 'ARK') {
188 echo 'UNSUPPORTED PLATFORM\n';