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 along
25 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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 [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."\n";
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 --skip-broken 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");
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 php-htmlpurifier");
58 passthru("a2enmod headers");
59 passthru("a2enmod proxy");
60 passthru("a2enmod ssl");
61 passthru("a2enmod rewrite");
62 passthru("a2enmod vhost_alias");
64 INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix".NORMAL);
67 function installSUSE() {
69 INFO("Installing Packages with yast");
70 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");
72 INFO("Fixing php4 installation");
73 passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
75 INFO("Restarting APACHE");
76 passthru("/etc/init.d/apache2 start");
77 passthru("/etc/init.d/apache2 stop");
79 INFO("Restarting PostgreSQL");
80 passthru("/etc/init.d/postgresql stop");
81 passthru("/etc/init.d/postgresql start");
83 INFO("Starting Apache");
84 passthru("/etc/init.d/apache2 start");
86 INFO(RED."You Must Install htmlpurifier manually.".NORMAL);
89 function installOPENSUSE() {
91 INFO("Installing Packages with yast");
92 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");
94 INFO("Restarting PostgreSQL...");
95 passthru("rcpostgresql restart");
96 INFO("Restarting Apache...");
97 passthru("rcapache2 restart");
99 INFO(RED."You Must Install htmlpurifier manually.".NORMAL);
102 function installArk() {
103 INFO("Installing packages: Executing apt-get. Please wait...\n\n\n");
104 passthru("apt-get update");
105 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");
107 INFO("Restarting PostgreSQL\n");
108 passthru("/sbin/service postgresql restart");
110 INFO(RED."You Must Install htmlpurifier manually.".NORMAL);
113 function addFusionForgeYumRepo() {
114 INFO("Adding FusionForge YUM repository\n");
116 if (getenv('FFORGE_RPM_REPO')) {
117 $rpm_repo = getenv('FFORGE_RPM_REPO');
119 $rpm_repo = 'http://fusionforge.fusionforge.org/rpm/5.1';
123 # Name: FusionForge RPM Repository
124 # URL: http://fusionforge.org/
126 name = Red Hat Enterprise $releasever - fusionforge.org
127 baseurl = '.$rpm_repo.'
131 file_put_contents('/etc/yum.repos.d/fusionforge.repo', $repo);
133 function addDagRPMForgeYumRepo() {
134 INFO("Adding Dag RPMForge YUM repository\n");
136 if (getenv('DAG_RPMFORGE_REPO')) {
137 $rpm_repo = getenv('DAG_RPMFORGE_REPO');
139 $rpm_repo = 'http://apt.sw.be/redhat';
143 # Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
144 # URL: http://rpmforge.net/
146 name = Red Hat Enterprise $releasever - RPMforge.net - dag
147 baseurl = '.$rpm_repo.'/el5/en/$basearch/dag
148 #mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
152 file_put_contents('/etc/yum.repos.d/dag-rpmforge.repo', $repo);
155 if (count($argv) < 2) {
156 if ( is_file('/etc/SuSE-release') ) {
157 if ( exec('grep openSUSE /etc/SuSE-release') ) {
158 $platform = 'OPENSUSE';
159 echo "detected OPENSUSE platform\n";
162 echo "detected SUSE platform\n";
168 if ($argv[1] == '-h' || $argv[1] == '--help') {
172 $platform = $argv[1];
173 echo "setting up dependencies for $platform\n";
177 if ($platform == 'FEDORA' || $platform == 'CENTOS' || $platform == 'RHEL5') {
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';