[evolvis-commits] r11738: adding new deps install script↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 18:23:30 CET 2011
Author: mirabilos
Date: 2011-02-24 18:23:30 +0100 (Thu, 24 Feb 2011)
New Revision: 11738
Added:
trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-1-deps.php
trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-3.sh
Log:
adding new deps install script
Added: trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-1-deps.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-1-deps.php (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-1-deps.php 2011-02-24 17:23:30 UTC (rev 11738)
@@ -0,0 +1,115 @@
+#!/usr/bin/php -f
+<?php
+/**
+ * GForge Installation Dependency Setup
+ *
+ * Copyright 2006 GForge, LLC
+ * http://gforge.org/
+ *
+ * @version
+ *
+ * This file is part of GInstaller
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
+ * Francisco Gimeno
+ */
+
+define ("VERBOSE", TRUE);
+define ("GREEN", "\033[01;32m" );
+define ("NORMAL", "\033[00m" );
+define ("RED", "\033[01;31m" );
+
+function INFO($message)
+{
+ global $depth, $myLog;
+ if(VERBOSE) for ($i=0; $i < $depth; $i++) echo " ";
+ if(VERBOSE) echo $message;
+ for($i=0; $i < $depth; $i++ ) $myLog.=" ";
+ $myLog.=$message;
+}
+
+function installRedhat($version) {
+ if ($version == 3) {
+ INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
+ 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 ssh");
+ } else {
+ INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
+ 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 inetd");
+ }
+
+ INFO("Restarting PostgreSQL\n");
+ passthru("/etc/init.d/postgresql stop");
+ passthru("/etc/init.d/postgresql start");
+}
+
+function installRHEL() {
+
+ INFO("Installing packages: Executing UP2DATE. Please wait...\n\n\n");
+ 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");
+
+ INFO("Restarting PostgreSQL\n");
+ passthru("/etc/init.d/postgresql stop");
+ passthru("/etc/init.d/postgresql start");
+}
+
+function installDebian() {
+
+ INFO("Installing Packages with apt-get");
+ passthru("apt-get -y install apache2 php4 php4-cli php4-pgsql cvs postgresql postgresql-contrib libipc-run-perl liburi-perl libapache2-svn libapache2-mod-php4 subversion subversion-tools php4-curl curl ssh lsb-release");
+
+ INFO(RED."You Must Install Mailman Manually: apt-get install mailman postfix");
+}
+
+function installSUSE() {
+
+ INFO("Installing Packages with yast");
+ 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");
+
+ INFO("Fixing php4 installation");
+ passthru("cp /usr/lib/apache2-prefork/libphp4.so /usr/lib/apache2/mod_php.so");
+
+ INFO("Restarting APACHE");
+ passthru("/etc/init.d/apache2 start");
+ passthru("/etc/init.d/apache2 stop");
+
+ INFO("Restarting PostgreSQL");
+ passthru("/etc/init.d/postgresql stop");
+ passthru("/etc/init.d/postgresql start");
+ INFO("Starting Apache");
+ passthru("/etc/init.d/apache2 start");
+}
+
+if (count($argv) < 2) {
+ echo "Usage: pre-install.php [RHEL4|DEBIANSARGE|FC3|FC4]\n";
+ check_version();
+} else {
+ $platform = $argv[1];
+
+ if ($platform == 'FC3') {
+ installRedhat(3);
+ } elseif ($platform == 'FC4') {
+ installRedhat(4);
+ } elseif ($platform == 'RHEL4') {
+ installRHEL();
+ } elseif ($platform == 'DEBIANSARGE') {
+ installDebian(); /* Debian and friends */
+ } elseif ($platform == 'SUSE') {
+ installSUSE();
+ } else {
+ echo 'UNSUPPORTED PLATFORM';
+ }
+}
+
+?>
Property changes on: trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-1-deps.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-3.sh
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-3.sh (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-3.sh 2011-02-24 17:23:30 UTC (rev 11738)
@@ -0,0 +1,167 @@
+#!/bin/sh
+if [ $# -ne 4 ]; then
+ echo 1>&2 Usage: $0 gforge.company.com apacheuser apachegroup ip.add.re.ss
+ exit 127
+fi
+#validate hostname
+echo "$1" | egrep '^([[:alnum:].\-_])*$' -q
+found_host=$?
+if [ $found_host -ne 0 ]; then
+ echo 1>&2 "invalid hostname"
+ exit 2
+fi
+#validate apache user
+getent passwd $2 > /dev/null
+found_apacheuser=$?
+if [ $found_apacheuser -ne 0 ]; then
+ echo 1>&2 "invalid apache user"
+ exit 2
+fi
+#validate apache group
+getent group $3 > /dev/null
+found_apachegroup=$?
+if [ $found_apachegroup -ne 0 ]; then
+ echo 1>&2 "invalid apache group"
+ exit 2
+fi
+#validate IP Address
+echo "$4" | egrep '^([0-9]){1,3}\.([0-9]){1,3}\.([0-9]){1,3}\.([0-9]){1,3}$' -q
+found_ip=$?
+if [ $found_ip -ne 0 ]; then
+ echo 1>&2 "invalid IP address"
+ exit 2
+fi
+if [ -f /etc/aliases.org ]; then
+ echo 1>&2 "/etc/aliases.org already exists - clean up before starting install"
+ exit 2
+fi
+if [ -f /etc/passwd.org ]; then
+ echo 1>&2 "/etc/passwd.org already exists - clean up before starting install"
+ exit 2
+fi
+if [ -f /etc/shadow.org ]; then
+ echo 1>&2 "/etc/shadow.org already exists - clean up before starting install"
+ exit 2
+fi
+if [ -f /etc/group.org ]; then
+ echo 1>&2 "/etc/group.org already exists - clean up before starting install"
+ exit 2
+fi
+if [ -d /etc/gforge ]; then
+ echo 1>&2 "/etc/gforge already exists - clean up before starting install"
+ exit 2
+fi
+if [ -d /usr/lib/gforge ]; then
+ echo 1>&2 "/usr/lib/gforge already exists - clean up before starting install"
+ exit 2
+fi
+if [ ! -d /opt/viewvc ]; then
+ echo 1>&2 "/opt/viewvc didn't exist - error - make sure you've installed viewvc in /opt/viewvc. You can download from http://gforge.org/frs/?group_id=143"
+ exit 2
+fi
+if [ ! -f /opt/viewvc/bin/cgi/viewcvs.cgi ]; then
+ echo 1>&2 "/opt/viewvc/bin/cgi/viewcvs.cgi didn't exist - error - make sure you've installed viewvc in /opt/viewvc. You can download from http://gforge.org/frs/?group_id=143"
+ exit 2
+fi
+
+
+mkdir /usr/lib/gforge
+if [ ! -d /usr/lib/gforge ]; then
+ echo 1>&2 "/usr/lib/gforge didn't exist - error - make sure you've got permission"
+ exit 2
+fi
+mkdir /var/lib/gforge
+if [ ! -d /var/lib/gforge ]; then
+ echo 1>&2 "/var/lib/gforge didn't exist - error - make sure you've got permission"
+ exit 2
+fi
+
+mv * /usr/lib/gforge
+cd /var/lib/gforge
+mkdir uploads
+mkdir /var/lib/jpgraph
+mkdir scmtarballs
+mkdir scmsnapshots
+mkdir localizationcache
+ln -s /usr/bin/php /usr/bin/php4
+
+#project vhost space
+mkdir homedirs
+mkdir /home/groups
+ln -s /home/groups homedirs/groups
+
+#Create default location for SVN repositories
+mkdir svnroot
+ln -s /var/lib/gforge/svnroot /svnroot
+
+#Create default location for CVS repositories
+mkdir cvsroot
+ln -s /var/lib/gforge/cvsroot /cvsroot
+
+cd /usr/lib/gforge
+
+#sets up pretty xslt pages for svn when browsing with a web browser
+cp cronjobs/dav-svn/www/svnindex* www/
+
+#restricted shell for cvs accounts
+cp cronjobs/cvs-cron/cvssh.pl /bin/
+chmod 755 /bin/cvssh.pl
+
+#Create default location for gforge config files
+mkdir /etc/gforge
+cp etc/local.inc.example /etc/gforge/local.inc
+cp etc/gforge-httpd.conf.example /etc/gforge/httpd.conf
+
+#copy cvsweb and make sure it's in the local.inc sys_scmweb path
+cp plugins/scmcvs/cgi-bin/cvsweb /etc/gforge/
+
+#copy viewvc and make sure it's in the local.inc sys_scmweb path
+cp /opt/viewvc/bin/cgi/viewcvs.cgi /etc/gforge/
+
+#copy the scmcvs plugin config to /etc/gforge/
+cp -R plugins/scmcvs/etc/plugins/ /etc/gforge/
+
+#copy the scmsvn config files to /etc/gforge/
+cp -R plugins/scmsvn/etc/plugins/scmsvn/ /etc/gforge/plugins/
+
+#copy the cvstracker config files to /etc/gforge/
+cp -R plugins/cvstracker/etc/plugins/cvstracker/ /etc/gforge/plugins/
+
+#symlink plugin www's
+cd /usr/lib/gforge/www
+/bin/mkdir plugins
+cd plugins
+
+ln -s ../../plugins/cvstracker/www/ cvstracker
+ln -s ../../plugins/scmcvs/www scmcvs
+ln -s ../../plugins/scmsvn/www/ scmsvn
+cd scmsvn
+ln -s /opt/viewvc/templates/docroot/ viewcvs
+
+cd /usr/lib/gforge
+
+chown -R root:$3 /usr/lib/gforge
+chmod -R 644 /usr/lib/gforge/
+cd /usr/lib/gforge && find -type d | xargs chmod 755
+chown -R $2:$3 /var/lib/gforge/uploads
+chmod -R 755 /usr/lib/gforge/cronjobs/
+
+if [ ! -d /etc/gforge ]; then
+ echo 1>&2 "/etc/gforge didn't exist - error - make sure you've got permission"
+ exit 2
+fi
+chown -R root:$3 /etc/gforge/
+chmod -R 644 /etc/gforge/
+cd /etc/gforge && find -type d | xargs chmod 755
+cd /etc/gforge && find -type f -exec perl -pi -e "s/apacheuser/$2/" {} \;
+cd /etc/gforge && find -type f -exec perl -pi -e "s/apachegroup/$3/" {} \;
+cd /etc/gforge && find -type f -exec perl -pi -e "s/gforge\.company\.com/$1/" {} \;
+cd /etc/gforge && find -type f -exec perl -pi -e "s/192\.168\.100\.100/$4/" {} \;
+
+
+echo "noreply: /dev/null" >> /etc/aliases
+
+cp /etc/aliases /etc/aliases.org
+cp /etc/shadow /etc/shadow.org
+cp /etc/passwd /etc/passwd.org
+cp /etc/group /etc/group.org
Property changes on: trunk/gforge_base/evolvisforge-5.1/gforge/gforge-install-3.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the evolvis-commits
mailing list