4 * FusionForge Installation Dependency Setup
6 * Copyright 2006 GForge, LLC
7 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org/
12 * This file is part of GInstaller. It is be called by install.sh.
14 * FusionForge is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * FusionForge is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with FusionForge; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
30 define ("VERBOSE", TRUE);
31 define ("GREEN", "\033[01;32m" );
32 define ("NORMAL", "\033[00m" );
33 define ("RED", "\033[01;31m" );
35 function printUsage() {
36 echo "Usage: fusionforge-install-1-deps [RHEL5|DEBIAN|FEDORA|CENTOS|ARK|SUSE|OPENSUSE]\n";
39 function INFO($message)
41 global $depth, $myLog;
42 if(VERBOSE) for ($i=0; $i < $depth; $i++) echo " ";
43 if(VERBOSE) echo $message."\n";
44 for($i=0; $i < $depth; $i++ ) $myLog.=" ";
48 function installRedhat() {
49 addFusionForgeYumRepo();
50 addDagRPMForgeYumRepo();
51 INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
52 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 php-htmlpurifier php-mbstring php-jpgraph-1.5.2 poppler-utils php-pecl-zip php-pear-HTTP_WebDAV_Server antiword");
55 function installDebian() {
57 INFO("Installing Packages with apt-get");
58 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 php-htmlpurifier");
59 passthru("a2enmod headers");
60 passthru("a2enmod proxy");
61 passthru("a2enmod ssl");
62 passthru("a2enmod rewrite");
63 passthru("a2enmod vhost_alias");
65 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix".NORMAL);
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.".NORMAL);
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.".NORMAL);
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.".NORMAL);
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 == 'DEBIAN') {
174 installDebian(); /* Debian and friends */
175 } elseif ($platform == 'SUSE') {
177 } elseif ($platform == 'OPENSUSE') {
179 } elseif ($platform == 'ARK') {
182 echo 'UNSUPPORTED PLATFORM\n';