[evolvis-commits] r10152: preliminary work on new RPM packages↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 17:38:49 CET 2011


Author: mirabilos
Date: 2011-02-24 17:38:49 +0100 (Thu, 24 Feb 2011)
New Revision: 10152

Added:
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/conf/
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/conf/vhost.conf
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/cron.d/
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/cron.d/gforge
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/patches/
   trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/patches/gforge-4.0-deb_rpm.patch
Log:
preliminary work on new RPM packages


Added: trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/conf/vhost.conf
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/conf/vhost.conf	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/conf/vhost.conf	2011-02-24 16:38:49 UTC (rev 10152)
@@ -0,0 +1,18 @@
+<VirtualHost *>
+	DocumentRoot /usr/share/gforge/www
+	ServerName HOST_NAME
+	ErrorDocument 404 404.php
+	php_value include_path ".:/etc/gforge:/usr/share/gforge:/usr/share/gforge/www/include"
+	AddDefaultCharset UTF-8
+	<Directory /usr/share/gforge/www>
+		Include   /etc/gforge/httpd.secrets
+	</Directory>
+	<Location /projects>
+		ForceType application/x-httpd-php
+	</Location>
+	<Location /users>
+		ForceType application/x-httpd-php
+	</Location>
+	RewriteEngine On
+	RewriteRule     ^/plugins/([^/]*)/(.*) /usr/lib/gforge/plugins/$1/www/$2 [L]
+</VirtualHost>

Added: trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/cron.d/gforge
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/cron.d/gforge	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/cron.d/gforge	2011-02-24 16:38:49 UTC (rev 10152)
@@ -0,0 +1,120 @@
+#
+# GForge
+# Copyright 1999-2001 (c) VA Linux Systems
+# Copyright 2002-2004 (c) GForge, LLC, Ognyan Kulev
+# http://gforge.org/
+#
+# @version   $Id$
+#
+
+# Change path to the GForge directory.
+GFORGE="/usr/share/gforge"
+
+# Change paths to the GForge directory.
+# Don't reference $GFORGE because this won't work!
+# You may need to change the pathname to php CLI (command line interface)
+PHP="/usr/bin/php -d include_path=.:/etc/gforge:/usr/share/gforge:/usr/share/gforge/www/include"
+
+# Don't mail command output to anyone.
+MAILTO=""
+
+#
+#       recalculate user popularity metric
+#
+10 1 * * * $PHP $GFORGE/cronjobs/calculate_user_metric.php
+
+#
+#  daily project_weekly_metric recalc
+#
+12 1 * * * $PHP $GFORGE/cronjobs/project_weekly_metric.php
+
+#
+#   daily deletion of sessions, closing jobs, etc
+#
+15 1 * * * $PHP $GFORGE/cronjobs/project_cleanup.php
+
+#
+#  daily crunching of survey data and other associated ratings
+#
+41 1 * * * $PHP $GFORGE/cronjobs/rating_stats.php
+
+#
+#  daily crunching of project summary data (counts)
+#
+45 1 * * * $PHP $GFORGE/cronjobs/db_project_sums.php
+
+#
+#   daily recalculate of the sums under the trove map
+#
+50 1 * * * $PHP $GFORGE/cronjobs/db_trove_maint.php
+
+#
+#	daily close pending artifacts
+#
+57 1 * * * $PHP $GFORGE/cronjobs/check_stale_tracker_items.php
+
+#
+#       VACUUM should be done after ALL OTHER JOBS
+#
+0 2 * * *  $PHP $GFORGE/cronjobs/vacuum.php
+
+#
+#       Stats aggregation work
+#
+15 7 * * * $PHP $GFORGE/cronjobs/db_stats_agg.php
+
+#
+#       daily rotation of the activity_log
+#
+0 0 * * *  $PHP $GFORGE/cronjobs/rotate_activity.php
+
+#
+#       daily aggregating of the numbers
+#
+15 0 * * * $PHP $GFORGE/cronjobs/site_stats.php
+
+#
+# Hourly send pending massmailings, if any
+#
+47 * * * * $PHP $GFORGE/cronjobs/massmail.php
+
+#
+#       Reporting Process
+#
+25 7 * * * $PHP $GFORGE/cronjobs/reporting_cron.php
+
+#
+#
+#	IMPORTANT!! READ THE README.root file before continuing!
+#
+#
+#
+#       Create the /etc/* files
+#
+#10 * * * * $PHP $GFORGE/cronjobs/cvs-cron/usergroup.php
+
+#
+#       Upload the SSH key files
+#
+#15 * * * * $PHP $GFORGE/cronjobs/cvs-cron/ssh_create.php
+
+#
+#       Create the blank cvs trees
+#
+#20 * * * * $PHP $GFORGE/cronjobs/cvs-cron/cvs.php
+
+#
+#       Daily stats collection
+#
+###incomplete 20 1 * * * $PHP $GFORGE/cronjobs/cvs-cron/history_parse.php
+
+#
+#       Create the new mailing lists
+#
+#06 * * * * $PHP $GFORGE/cronjobs/mail/mailing_lists_create.php
+
+#
+#       Create the /etc/aliases file
+#
+#08 * * * * $PHP $GFORGE/cronjobs/mail/mailaliases.php
+

Added: trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/patches/gforge-4.0-deb_rpm.patch
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/patches/gforge-4.0-deb_rpm.patch	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/rpm-specific/patches/gforge-4.0-deb_rpm.patch	2011-02-24 16:38:49 UTC (rev 10152)
@@ -0,0 +1,298 @@
+diff -u gforge/deb-specific/db-upgrade.pl gforge-rpm/deb-specific/db-upgrade.pl
+--- gforge/deb-specific/db-upgrade.pl	2004-10-31 20:12:10.000000000 +0100
++++ gforge-rpm/deb-specific/db-upgrade.pl	2004-11-01 19:44:21.000000000 +0100
+@@ -1595,7 +1595,7 @@
+     $target = "3.3.0-2+1" ;
+     if (&is_lesser ($version, $target)) {
+         &debug ("Upgrading with migrateforum.php") ;
+-	system("/usr/lib/gforge/db/20040826_migrateforum.php -d include_path=/usr/share/gforge/:/usr/share/gforge/www/include") == 0 
++	system("php -q -d include_path=/usr/share/gforge/:/usr/share/gforge/www/include /usr/lib/gforge/db/20040826_migrateforum.php") == 0 
+ 	or die "system call of 20040826_migrateforum.php failed: $?" ;
+         &update_db_version ($target) ;
+         &debug ("Committing.") ;
+@@ -1606,32 +1606,32 @@
+     $target = "3.3.0-2+2" ;
+     if (&is_lesser ($version, $target)) {
+         &debug ("Upgrading with migraterbac.php") ;
+-	system("/usr/lib/gforge/db/20040826_migraterbac.php -d include_path=/usr/share/gforge/:/usr/share/gforge/www/include") == 0
++	system("php -q -d include_path=/usr/share/gforge/:/usr/share/gforge/www/include /usr/lib/gforge/db/20040826_migraterbac.php") == 0
+ 	or die "system call of 20040826_migraterbac.php failed: $?" ;
+         &update_db_version ($target) ;
+         &debug ("Committing.") ;
+         $dbh->commit () ;
+     }
+ 
+-    $version = &get_db_version ;
+-    $target = "3.3.0-2+3" ;
+-    if (&is_lesser ($version, $target)) {
+-        &debug ("Upgrading with 20041001.sql") ;
+-
+-        @reqlist = @{ &parse_sql_file ("/usr/lib/gforge/db/20041001.sql") } ;
+-        foreach my $s (@reqlist) {
+-            $query = $s ;
+-            # debug $query ;
+-            $sth = $dbh->prepare ($query) ;
+-            $sth->execute () ;
+-            $sth->finish () ;
+-        }
+-        @reqlist = () ;
+-
+-        &update_db_version ($target) ;
+-        &debug ("Committing.") ;
+-        $dbh->commit () ;
+-    }
++#    $version = &get_db_version ;
++#    $target = "3.3.0-2+3" ;
++#    if (&is_lesser ($version, $target)) {
++#        &debug ("Upgrading with 20041001.sql") ;
++#
++#        @reqlist = @{ &parse_sql_file ("/usr/lib/gforge/db/20041001.sql") } ;
++#        foreach my $s (@reqlist) {
++#            $query = $s ;
++#            # debug $query ;
++#            $sth = $dbh->prepare ($query) ;
++#            $sth->execute () ;
++#            $sth->finish () ;
++#        }
++#        @reqlist = () ;
++#
++#        &update_db_version ($target) ;
++#        &debug ("Committing.") ;
++#        $dbh->commit () ;
++#    }
+ 
+     $version = &get_db_version ;
+     $target = "3.3.0-2+4" ;
+@@ -1755,62 +1755,62 @@
+         $dbh->commit () ;
+     }
+ 
+-    $version = &get_db_version ;
+-    $target = "4.0.0-0+1" ;
+-    if (&is_lesser ($version, $target)) {
+-        &debug ("Granting read access permissions to NSS") ;
+-
+-        @reqlist = ( "GRANT SELECT ON nss_passwd TO gforge_nss",
+-		     "GRANT SELECT ON nss_groups TO gforge_nss",
+-		     "GRANT SELECT ON nss_usergroups TO gforge_nss",
+-		    ) ;
+-        foreach my $s (@reqlist) {
+-            $query = $s ;
+-            # debug $query ;
+-            $sth = $dbh->prepare ($query) ;
+-            $sth->execute () ;
+-            $sth->finish () ;
+-        }
+-        @reqlist = () ;
+-
+-        &update_db_version ($target) ;
+-        &debug ("Committing.") ;
+-        $dbh->commit () ;
+-    }
+-
+-    $version = &get_db_version ;
+-    $target = "4.0.0-0+2" ;
+-    if (&is_lesser ($version, $target)) {
+-        &debug ("Upgrading with 20041031.sql") ;
+-
+-        @reqlist = @{ &parse_sql_file ("/usr/lib/gforge/db/20041031.sql") } ;
+-        foreach my $s (@reqlist) {
+-            $query = $s ;
+-            # debug $query ;
+-            $sth = $dbh->prepare ($query) ;
+-            $sth->execute () ;
+-            $sth->finish () ;
+-        }
+-        @reqlist = () ;
+-
+-        &debug ("Granting read access permissions to NSS") ;
+-
+-        @reqlist = ( "GRANT SELECT ON mta_users TO gforge_mta",
+-		     "GRANT SELECT ON mta_lists TO gforge_mta",
+-		    ) ;
+-        foreach my $s (@reqlist) {
+-            $query = $s ;
+-            # debug $query ;
+-            $sth = $dbh->prepare ($query) ;
+-            $sth->execute () ;
+-            $sth->finish () ;
+-        }
+-        @reqlist = () ;
+-
+-        &update_db_version ($target) ;
+-        &debug ("Committing.") ;
+-        $dbh->commit () ;
+-    }
++#    $version = &get_db_version ;
++#    $target = "4.0.0-0+1" ;
++#    if (&is_lesser ($version, $target)) {
++#        &debug ("Granting read access permissions to NSS") ;
++#
++#        @reqlist = ( "GRANT SELECT ON nss_passwd TO gforge_nss",
++#		     "GRANT SELECT ON nss_groups TO gforge_nss",
++#		     "GRANT SELECT ON nss_usergroups TO gforge_nss",
++#		    ) ;
++#        foreach my $s (@reqlist) {
++#            $query = $s ;
++#            # debug $query ;
++#            $sth = $dbh->prepare ($query) ;
++#            $sth->execute () ;
++#            $sth->finish () ;
++#        }
++#        @reqlist = () ;
++#
++#        &update_db_version ($target) ;
++#        &debug ("Committing.") ;
++#        $dbh->commit () ;
++#    }
++
++#    $version = &get_db_version ;
++#    $target = "4.0.0-0+2" ;
++#    if (&is_lesser ($version, $target)) {
++#        &debug ("Upgrading with 20041031.sql") ;
++#
++#        @reqlist = @{ &parse_sql_file ("/usr/lib/gforge/db/20041031.sql") } ;
++#        foreach my $s (@reqlist) {
++#            $query = $s ;
++#            # debug $query ;
++#            $sth = $dbh->prepare ($query) ;
++#            $sth->execute () ;
++#            $sth->finish () ;
++#        }
++#        @reqlist = () ;
++#
++#        &debug ("Granting read access permissions to NSS") ;
++#
++#        @reqlist = ( "GRANT SELECT ON mta_users TO gforge_mta",
++#		     "GRANT SELECT ON mta_lists TO gforge_mta",
++#		    ) ;
++#        foreach my $s (@reqlist) {
++#            $query = $s ;
++#            # debug $query ;
++#            $sth = $dbh->prepare ($query) ;
++#            $sth->execute () ;
++#            $sth->finish () ;
++#        }
++#        @reqlist = () ;
++#
++#        &update_db_version ($target) ;
++#        &debug ("Committing.") ;
++#        $dbh->commit () ;
++#    }
+ 
+     &debug ("It seems your database $action went well and smoothly.  That's cool.") ;
+     &debug ("Please enjoy using Gforge.") ;
+@@ -1843,7 +1843,7 @@
+ $dbh->disconnect ;
+ 
+ sub get_pg_version () {
+-    my $command = q(dpkg -s postgresql | awk '/^Version: / { print $2 }') ;
++    my $command = q(rpm -q --qf %{VERSION} postgresql) ;
+     my $version = qx($command) ;
+     chomp $version ;
+     return $version ;
+diff -u gforge/deb-specific/sqlhelper.pm gforge-rpm/deb-specific/sqlhelper.pm
+--- gforge/deb-specific/sqlhelper.pm	2004-05-16 18:54:58.000000000 +0200
++++ gforge-rpm/deb-specific/sqlhelper.pm	2004-11-01 19:37:26.000000000 +0100
+@@ -264,18 +264,98 @@
+     my $v1 = shift || 0 ;
+     my $v2 = shift || 0 ;
+ 
+-    my $rc = system "dpkg --compare-versions $v1 lt $v2" ;
++    my $rc = cmp_version($v1, $v2, 0);
+ 
+-    return (! $rc) ;
++    return ($rc) ;
+ }
+ 
+ sub is_greater ( $$ ) {
+     my $v1 = shift || 0 ;
+     my $v2 = shift || 0 ;
+ 
+-    my $rc = system "dpkg --compare-versions $v1 gt $v2" ;
++    my $rc = cmp_version($v1, $v2, 1);
+ 
+     return (! $rc) ;
+ }
+ 
++#-------------------------------------------------------
++# FUNCTION: cmp_version (STRING, STRING)
++#
++# Compares complete version numbers ala epoch:upstream-debian
++# and returns true if the first version string is greater
++# than the second.
++#
++# Copyright (C) 2001 Christoph Martin
++# http://www.uni-mainz.de/~martin/apt-show-versions
++#--------------------------------------------------------
++
++# recursive function to compare upstream or debian version part
++
++sub compare {
++    my ($first, $last) = @_;
++
++    # equal if both are empty
++    return (0) unless ($first ne "" || $last ne "");
++
++    # parse next version string part and set numerical part to 0 if empty
++    my ($nondig1, $dig1, $remainder1) = ($first =~ /^(\D*)?(\d*)(.*)?/);
++    $dig1 = 0 unless ($dig1 ne "");
++    my ($nondig2, $dig2, $remainder2) = ($last =~ /^(\D*)?(\d*)(.*)?/);
++    $dig2 = 0 unless ($dig2 ne "");
++
++    return ($nondig1 cmp $nondig2) unless ($nondig1 eq $nondig2);
++    return ($dig1 <=> $dig2) unless ($dig1 == $dig2);
++    return compare($remainder1, $remainder2);
++}
++
++sub cmp_version {
++    my ($first, $last, $strict) = @_;
++
++    # parse version number in epoch:upstream-debian and set to 0 if empty
++    my ($first_epoch,
++	$first_upstream,
++	$first_debian) = ($first =~ /^(.*:)?(.*?)(-.*)?$/);
++    $first_epoch = "0:" unless defined $first_epoch;
++    $first_debian = "-0" unless defined $first_debian;
++    $first_epoch =~ s/:$//;
++    $first_debian =~ s/^-//;
++
++    my ($last_epoch,
++	$last_upstream,
++	$last_debian) = ($last =~ /^(.*:)?(.*?)(-.*)?$/);
++    $last_epoch = "0:" unless defined $last_epoch;
++    $last_debian = "-0" unless defined $last_debian;
++    $last_epoch =~ s/:$//;
++    $last_debian =~ s/^-//;
++
++    my $ret;
++    if ($first_epoch == $last_epoch) {
++	$ret = compare($first_upstream, $last_upstream);
++	if ($ret == 0) {
++	    $ret = compare($first_debian, $last_debian);
++	}
++    } else {
++	$ret = ($first_epoch <=> $last_epoch);
++    }
++
++    # give the same return codes like 'dpkg --compare-versions .. ge ..'
++    if ($strict == 1 and $ret == 0) {
++        $ret = 256;
++    }
++    if ($ret == -1) {
++	$ret = 256;
++    } elsif ($ret == 1) {
++	$ret = 0;
++    }
++
++    return $ret;
++
++    # this will never be reached, but should give the same
++    # result as $ret
++    
++    my $ret2 = system("dpkg --compare-versions $first ge $last");
++    print "** $ret <> $ret2 ** \n" unless $ret == $ret2;
++    return $ret2;
++}
++
+ 1 ;



More information about the evolvis-commits mailing list