[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 3e6017c35e5cc520c74930732bf8cbddcdc5c1b9

Roland Mas lolando at fusionforge.org
Thu Jul 31 14:49:08 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, Branch_5_3 has been updated
       via  3e6017c35e5cc520c74930732bf8cbddcdc5c1b9 (commit)
       via  848166f2acb32c293f28633929b7b08fae96a379 (commit)
      from  84292a4a89a83e14f603644c346a6c325cb816fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3e6017c35e5cc520c74930732bf8cbddcdc5c1b9
Author: Roland Mas <lolando at debian.org>
Date:   Thu Jul 31 14:48:32 2014 +0200

    More replacements of hardcoded paths (these ones are "backported" from the Debian packaging repository)

diff --git a/src/deb-specific/create-vhosts.sh b/src/deb-specific/create-vhosts.sh
index 0aa8e5f..614d548 100755
--- a/src/deb-specific/create-vhosts.sh
+++ b/src/deb-specific/create-vhosts.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-/usr/share/gforge/bin/prepare-vhosts-file.pl
+$(forge_get_config binary_path)/prepare-vhosts-file.pl
 
 case "$1" in
 	--norestart)
diff --git a/src/deb-specific/db-convert-to-unicode.pl b/src/deb-specific/db-convert-to-unicode.pl
index e056dab..1679a9c 100755
--- a/src/deb-specific/db-convert-to-unicode.pl
+++ b/src/deb-specific/db-convert-to-unicode.pl
@@ -22,8 +22,11 @@ use vars qw/$sys_default_domain $sys_scm_host
 sub debug ( $ ) ;
 sub convert_column_to_charset ( $$$$$ ) ;
 
-require ("/usr/share/gforge/lib/include.pl") ; # Include a few predefined functions 
-require ("/usr/share/gforge/lib/sqlparser.pm") ; # Our magic SQL parser
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+require ("$source_path/lib/sqlparser.pm") ; # Our magic SQL parser
 
 debug "You'll see some debugging info during this installation." ;
 debug "Do not worry unless told otherwise." ;
diff --git a/src/deb-specific/dns_conf.pl b/src/deb-specific/dns_conf.pl
index 6cf703f..efca3a5 100755
--- a/src/deb-specific/dns_conf.pl
+++ b/src/deb-specific/dns_conf.pl
@@ -3,7 +3,10 @@
 use DBI;
 use POSIX qw(strftime);
 
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 &db_connect;
 
diff --git a/src/deb-specific/dsf-helper.pl b/src/deb-specific/dsf-helper.pl
index bdfc9a9..57b12c9 100755
--- a/src/deb-specific/dsf-helper.pl
+++ b/src/deb-specific/dsf-helper.pl
@@ -137,7 +137,7 @@ if ($ARGV[0] && $ARGV[0] eq "--clean") {
        $dest =~ s/\@FORGENAME\@/$forge_name/g ;
        $dest =~ s:\@SOURCE_PATH\@:$source_path:g ;
        $dest =~ s:\@BINARY_PATH\@:$binary_path:g ;
-       $dest =~ s:\@PLUGIN_PATH\@:$plugin_path:g ;
+       $dest =~ s:\@PLUGINS_PATH\@:$plugin_path:g ;
        $dest =~ s:\@DATA_PATH\@:$data_path:g ;
        $dest =~ s:\@CONFIG_PATH\@:$config_path:g ;
        $dest =~ s:\@LOG_PATH\@:$log_path:g ;
diff --git a/src/deb-specific/fix-mailing-lists.pl b/src/deb-specific/fix-mailing-lists.pl
index 8fb3257..c8895b8 100755
--- a/src/deb-specific/fix-mailing-lists.pl
+++ b/src/deb-specific/fix-mailing-lists.pl
@@ -14,7 +14,10 @@ use vars qw// ;
 
 sub debug ( $ ) ;
 
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 &db_connect ;
 
diff --git a/src/deb-specific/fusionforge.rsyslog b/src/deb-specific/fusionforge.rsyslog
index 85095e3..05328be 100644
--- a/src/deb-specific/fusionforge.rsyslog
+++ b/src/deb-specific/fusionforge.rsyslog
@@ -1 +1 @@
-$AddUnixListenSocket /var/lib/gforge/chroot/dev/log
+$AddUnixListenSocket @CHROOT_PATH@/dev/log
diff --git a/src/deb-specific/gforge-inject.pl b/src/deb-specific/gforge-inject.pl
index b4119ee..02d72cb 100755
--- a/src/deb-specific/gforge-inject.pl
+++ b/src/deb-specific/gforge-inject.pl
@@ -26,7 +26,11 @@ use vars qw/$sys_default_domain $sys_scm_host
     $skill_list/ ;
 
 sub debug ( $ ) ;
-require ("/usr/share/gforge/lib/include.pl") ;
+
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 ###
 # Local customisation
diff --git a/src/deb-specific/group_dump_update.pl b/src/deb-specific/group_dump_update.pl
deleted file mode 100755
index 5ccba23..0000000
--- a/src/deb-specific/group_dump_update.pl
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/usr/bin/perl
-#
-# dump_database.pl - script to dump data from the database to flat files so the ofher perl
-#		     scripts can process it without needing to access the database.
-use DBI;
-
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
-
-# Run as gforge
-my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwnam("gforge");
-$> = $uid;
-
-my $verbose = 0;
-my $user_array = ();
-my $group_array = ();
-my $gid_add = 10000 ;
-
-&db_connect;
-
-# Dump the Groups Table information
-$query = "select group_id,group_id+".$gid_add.",unix_group_name,status,is_public from groups";
-$c = $dbh->prepare($query);
-$c->execute();
-
-while(my ($group_id, $unix_gid, $group_name, $status, $is_public) = $c->fetchrow()) {
-
-	my $new_query = "select users.user_name AS user_name FROM users,user_group WHERE users.user_id=user_group.user_id AND group_id=$group_id";
-	my $d = $dbh->prepare($new_query);
-	$d->execute();
-
-	my $user_list = "";
-
-	while($user_name = $d->fetchrow()) {
-	   $user_list .= "$user_name,";
-	}
-
-	$grouplist = "$group_name:$status:$unix_gid:$is_public:$user_list\n";
-	$grouplist =~ s/,$//;
-
-	push @group_array, $grouplist;
-}
-
-# Run as root
-$> = 0;
-
-# Now write out the files
-write_array_file($file_dir."/dumps/group_dump", @group_array);
-system("chmod o-r,g-r $file_dir/dumps/group_dump");
-
-my $group_file = $file_dir . "/dumps/group_dump";
-my ($gname, $gstatus, $gid, $is_public, $userlist);
-
-# Open up all the files that we need.
- at groupdump_array = open_array_file($group_file);
-
-#
-# Loop through @groupdump_array and deal w/ users.
-#
-if($verbose) {print ("\n\n	Processing Groups\n\n")};
-while ($ln = pop(@groupdump_array)) {
-	chop($ln);
-	($gname, $gstatus, $gid, $is_public, $userlist) = split(":", $ln);
-
-	$userlist =~ tr/A-Z/a-z/;
-
-	$group_exists = (-d $grpdir_prefix .'/'. $gname);
-
-	if ($gstatus eq 'A' && $group_exists) {
-		update_group($gid, $gname, $is_public, $userlist);
-
-	} elsif ($gstatus eq 'A' && !$group_exists) {
-		add_group($gid, $gname, $is_public, $userlist);
-
-	} elsif ($gstatus eq 'D' && $group_exists) {
-		delete_group($gname);
-
-	}
-}
-
-###############################################
-# Begin functions
-###############################################
-
-## Become this effective user (EUID/EGID) and perform this action.
-##
-## This protect against symlink attacks; they are inevitable when
-## working in a directory owned by a local user.  We could naively
-## check for the presence of symlinks, but then we'd still be
-## vulnerable to a symlink race attack.
-##
-## We'll use set_e_uid/set_e_gid for efficiency and simplicity
-## (e.g. we can get the return value directly), which is enough for
-## opening files and similar basic operations.  When calling external
-## programs, you should use fork&exec&setuid/setgid.
-##
-# arg1: username
-# arg2: a Perl sub{}
-sub SudoEffectiveUser {
-    my $user = $_[0];
-    my $sub_unprivileged = $_[1];
-
-    my ($uid,$gid) = GetUserUidGid($user);
-    if ($uid eq "" or $gid eq "") {
-	print "Unknown user: $user\n";
-	return;
-    }
-
-    my $old_GID = $GID; # save additional groups
-    $! = '';
-    $EGID = "$gid $gid"; # set egid and additional groups
-    if ($! ne '') {
-	warn "Cannot setegid($gid $gid): $!";
-	return;
-    }
-    $EUID = $uid;
-    if ($! ne '') {
-	warn "Cannot seteuid($uid): $!";
-	return;
-    }
-
-    # Perform the action under this effective user:
-    my $ret = &$sub_unprivileged();
-
-    # Back to root
-    undef($EUID);     # restore euid==uid
-    $EGID = $old_GID; # restore egid==gid + additional groups
-
-    return $ret;
-}
-
-## Get system uid/gid
-sub GetUserUidGid {
-    my $user = $_[0];
-    my ($name,$passwd,$uid,$gid,
-	$quota,$comment,$gcos,$dir,$shell,$expire) = getpwnam($user);
-    return ($uid,$gid);
-}
-
-#############################
-# Group Add Function
-#############################
-sub add_group {
-	my ($gid, $gname, $is_public, $userlist) = @_;
-	my ($log_dir, $cgi_dir, $ht_dir);
-
-	my ($default_perms) ;
-        my ($file_default_perms) ;
-        my ($default_page) ;
-
-	$group_dir = $grpdir_prefix."/".$gname;
-	$log_dir = $group_dir."/log";
-	$cgi_dir = $group_dir."/cgi-bin";
-	$ht_dir = $group_dir."/htdocs";
-	$inc_dir = $group_dir."/incoming";
-
-        if ($is_public) {
-            $default_perms = 02775 ;
-            $file_default_perms = 0664;
-        } else {
-            $default_perms = 02770 ;
-            $file_default_perms = 0660;
-        }
-	$default_page  = &forge_get_config ('custom_path') . "/project_default_page.html";
-	$incdir_perms = 02775;
-
-	if ($verbose) {print("Making a Group for : $gname\n")};
-
-	if (mkdir $group_dir, $default_perms) {
-	    chown $dummy_uid, $gid, $group_dir ;
-
-	    SudoEffectiveUser($dummy_user, sub {
-		mkdir $log_dir, $default_perms ;
-		mkdir $cgi_dir, $default_perms ;
-		mkdir $ht_dir, $default_perms ;
-		mkdir $inc_dir, $default_perms ;
-		if (-e $default_page) {
-		    my $projurl = '';
-		    if (&forge_get_config ('use_ssl')) {
-			$projurl .= 'https://';
-		    } else {
-			$projurl .= 'http://';
-		    }
-		    $projurl .= &forge_get_config ('web_host');
-		    $projurl .= &forge_get_config ('url_prefix');
-		    $projurl .= 'projects/';
-		    $projurl .= $gname;
-		    
-		    open DPT, $default_page;
-		    open DP, "> $ht_dir/index.html";
-		    while (my $l = <DPT>) {
-			chomp $l;
-			$l =~ s/PROJECTNAME/$gname/;
-			$l =~ s/PROJECTURL/$projurl/;
-			print DP "$l\n";
-		    }
-		    close DP;
-		    close DPT;
-		}
-		# perl is sometime fucked to create with right permission
-		chmod $default_perms, $group_dir;
-		chmod $default_perms, $log_dir;
-		chmod $default_perms, $cgi_dir;
-		chmod $default_perms, $ht_dir;
-		chmod $incdir_perms, $inc_dir;
-		chmod 0664, "$ht_dir/index.php";
-	    });
-	}
-}
-
-#############################
-# Group Update Function
-#############################
-sub update_group {
-	my ($gid, $gname, $is_public, $userlist) = @_;
-	my ($log_dir, $cgi_dir, $ht_dir);
-	my ($realuid, $realgid);
-	my ($default_perms);
-
-	$group_dir = $grpdir_prefix.'/'.$gname;
-	$log_dir = $group_dir."/log";
-	$cgi_dir = $group_dir."/cgi-bin";
-	$ht_dir = $group_dir."/htdocs";
-	$inc_dir = $group_dir."/incoming";
-
-	if ($is_public) {
-	    $default_perms = 02775 ;
-	} else {
-	    $default_perms = 02771 ;
-	}
-	$incdir_perms = 02775;
-
-	if ($verbose) {print("Updating Group: $gname\n")};
-
-	chown $dummy_uid, $gid, $group_dir;
-
-	SudoEffectiveUser($dummy_user, sub {
-	    chmod $default_perms, $group_dir;
-	    chmod $default_perms, $log_dir;
-	    chmod $default_perms, $cgi_dir;
-	    chmod $default_perms, $ht_dir;
-	    chmod $incdir_perms, $inc_dir;
-	});
-}
-
-#############################
-# Group Delete Function
-#############################
-sub delete_group {
-	my ($gname, $x, $gid, $userlist, $counter);
-	my $this_group = shift(@_);
-	$counter = 0;
-
-	if (substr($hostname,0,3) ne "cvs") {
-		if ($verbose) {print("Deleting Group: $this_group\n")};
-		system("/bin/mv /var/lib/gforge/chroot/home/groups/$this_group /var/lib/gforge/chroot/home/groups/deleted_group_$this_group");
-		system("/bin/tar -czf /var/lib/gforge/tmp/$this_group.tar.gz /var/lib/gforge/chroot/home/groups/deleted_group_$this_group && /bin/rm -rf /var/lib/gforge/chroot/home/groups/deleted_group_$this_group");
-	}
-}
-
-#############################
-# Get File Owner UID
-#############################
-sub get_file_owner_uid {
-	my $filename = shift(@_);
-	my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
-	return $uid;
-}
-
-#############################
-# Get File Owner GID
-#############################
-sub get_file_owner_gid {
-	my $filename = shift(@_);
-	my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
-	return $gid;
-}
diff --git a/src/deb-specific/install-chroot.sh b/src/deb-specific/install-chroot.sh
index 7863415..92c02e7 100755
--- a/src/deb-specific/install-chroot.sh
+++ b/src/deb-specific/install-chroot.sh
@@ -23,33 +23,25 @@ configure)
 	    bin \
 	    cvsroot \
 	    dev \
-	    etc \
 	    etc/pam.d \
 	    etc/security \
-	    home \
 	    home/groups \
 	    home/users \
-	    lib \
 	    lib/security \
-	    lib64 \
 	    lib64/security \
-	    usr \
 	    usr/bin \
 	    usr/lib \
-	    var \
-	    var/lib \
-	    var/lib/gforge \
-	    var/run \
+	    $(forge_get_config data_path) \
 	    var/run/postgresql \
 	    var/run/sshd \
 	    ; do
-		test -d "$CHROOTDIR/$dir" || mkdir "$CHROOTDIR/$dir"
+		test -d "$CHROOTDIR/$dir" || mkdir -p "$CHROOTDIR/$dir"
 	done
 	rm -rf "$CHROOTDIR/tmp"
 	install -d -m 1777 "$CHROOTDIR/tmp"
-	[ -L "$CHROOTDIR/var/lib/gforge/chroot" ] && rm "$CHROOTDIR/var/lib/gforge/chroot"
-	[ -d "$CHROOTDIR/var/lib/gforge/chroot" ] && rmdir "$CHROOTDIR/var/lib/gforge/chroot"
-	ln -s ../../.. "$CHROOTDIR/var/lib/gforge/chroot"
+	[ -L "$CHROOTDIR$CHROOTDIR" ] && rm "$CHROOTDIR$CHROOTDIR"
+	[ -d "$CHROOTDIR$CHROOTDIR" ] && rmdir "$CHROOTDIR$CHROOTDIR"
+	ln -s ../../.. "$CHROOTDIR$CHROOTDIR"
 
 	# Copy needed binaries
 	# For testing /bin/ls /bin/su
@@ -114,9 +106,9 @@ configure)
 	# For /dev/log
 	if [ -e /etc/default/syslogd ] \
 	    && [ ! -e /etc/rsyslog.conf ] \
-	    && ! grep -q "^SYSLOGD.*/var/lib/gforge/chroot/dev/log.*" /etc/default/syslogd ; then
+	    && ! grep -q "^SYSLOGD.*$CHROOTDIR/dev/log.*" /etc/default/syslogd ; then
 		echo '######################################################################################################'
-		echo 'WARNING: you must have SYSLOGD="-p /dev/log -a /var/lib/gforge/chroot/dev/log" in /etc/default/syslogd'
+		echo 'WARNING: you must have SYSLOGD="-p /dev/log -a $CHROOTDIR/dev/log" in /etc/default/syslogd'
 		echo 'To have cvs pserver running correctly'
 		echo '######################################################################################################'
 	fi
diff --git a/src/deb-specific/install-db.sh b/src/deb-specific/install-db.sh
index 3a3dd67..3897604 100755
--- a/src/deb-specific/install-db.sh
+++ b/src/deb-specific/install-db.sh
@@ -264,14 +264,14 @@ EOF
 	fi
 
 	# Install/upgrade the database contents (tables and data)
-	/usr/share/gforge/bin/old-db-upgrade.pl 2>&1 | grep -v ^NOTICE: | grep -v ^DETAIL: | grep -v ^WARNING: \
+	$(forge_get_config source_path)/bin/old-db-upgrade.pl 2>&1 | grep -v ^NOTICE: | grep -v ^DETAIL: | grep -v ^WARNING: \
 	    && p=${PIPESTATUS[0]} \
 	    || p=${PIPESTATUS[0]}
 	if [ $p != 0 ] ; then
 	    exit $p
 	fi
 
-	/usr/share/gforge/bin/upgrade-db.php
+	$(forge_get_config source_path)/bin/upgrade-db.php
 
 	if [ "$need_admin_pw" = "true" ] ; then
 	    exit 100
@@ -297,7 +297,7 @@ EOF
 	if [ "x$2" != "x" ] ;then
 		DUMPFILE=$2
 	else
-		DUMPFILE=/var/lib/gforge/dumps/db_dump
+		DUMPFILE=$(forge_get_config data_path)/dumps/db_dump
 	fi
 	if [ "x$3" != "x" ] ;then
 		DB=$3
@@ -339,7 +339,7 @@ EOF
 	if [ "x$2" != "x" ] ;then
 		RESTFILE=$2
 	else
-		RESTFILE=/var/lib/gforge/dumps/db_dump
+		RESTFILE=$(forge_get_config data_path)/dumps/db_dump
 	fi
 	echo "Restoring $RESTFILE"
 	su -s /bin/sh postgres -c "dropdb $db_name" || true
diff --git a/src/deb-specific/install-dns.sh b/src/deb-specific/install-dns.sh
index 1990069..2c35f89 100755
--- a/src/deb-specific/install-dns.sh
+++ b/src/deb-specific/install-dns.sh
@@ -18,10 +18,11 @@ case "$1" in
 	ip_address=`forge_get_config ip_address`
 	# export domain_name=$1
 	# export ip_address=$2
+	data_path=$(forge_get_config data_path)
   	if ! grep -q "// Next line inserted by GForge install" /etc/bind/named.conf.gforge-new ; then
 	    cat >> /etc/bind/named.conf.gforge-new <<-EOF
 // Next line inserted by GForge install
-zone "$domain_name" { type master; file "/var/lib/gforge/bind/dns.zone"; };
+zone "$domain_name" { type master; file "$data_path/bind/dns.zone"; };
 EOF
   	fi
 	;;
@@ -36,17 +37,17 @@ EOF
  	done
 
 	if [ "$sys_simple_dns" = "false" ]; then
-  	    echo "Creating /var/lib/gforge/bind/dns.head"
-  	    eval "cat /var/lib/gforge/bind/dns.head.template $sedexpr > /var/lib/gforge/bind/dns.head"
-	    cp /var/lib/gforge/bind/dns.head /var/lib/gforge/bind/dns.zone
-	    chown -R gforge:gforge /var/lib/gforge/bind
+  	    echo "Creating $data_path/bind/dns.head"
+  	    eval "cat $data_path/bind/dns.head.template $sedexpr > $data_path/bind/dns.head"
+	    cp $data_path/bind/dns.head $data_path/bind/dns.zone
+	    chown -R gforge:gforge $data_path/bind
 
-	    /usr/share/gforge/bin/dns_conf.pl
+	    $(forge_get_config binary_path)/dns_conf.pl
 	else
-            [ -f /var/lib/gforge/bind/dns.head ] && echo "Removing /var/lib/gforge/bind/dns.head" && \
-	    rm /var/lib/gforge/bind/dns.head
-  	    echo "Creating /var/lib/gforge/bind/dns.zone"
-  	    eval "cat /var/lib/gforge/bind/dns.simple.template $sedexpr > /var/lib/gforge/bind/dns.zone"
+            [ -f $data_path/bind/dns.head ] && echo "Removing $data_path/bind/dns.head" && \
+	    rm $data_path/bind/dns.head
+  	    echo "Creating $data_path/bind/dns.zone"
+  	    eval "cat $data_path/bind/dns.simple.template $sedexpr > $data_path/bind/dns.zone"
 	fi
 
   	echo "DNS Config is not complete:"
diff --git a/src/deb-specific/install-exim.sh b/src/deb-specific/install-exim.sh
index b8e293e..79ba0e9 100755
--- a/src/deb-specific/install-exim.sh
+++ b/src/deb-specific/install-exim.sh
@@ -35,7 +35,11 @@ case "$1" in
 	tmp1=$(mktemp /tmp/$pattern)
 	# First, get the list of local domains right
 	perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 $seen_sf_domains = 0 ;
 while (($l = <>) !~ /^\s*local_domains/) {
   print $l;
@@ -51,7 +55,11 @@ while ($l = <>) { print $l; };
 	tmp2=$(mktemp /tmp/$pattern)
 	# Second, insinuate our forwarding rules in the directors section
 	perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 
 $sf_block = "# BEGIN SOURCEFORGE BLOCK -- DO NOT EDIT #
 # You may move this block around to accomodate your local needs as long as you
diff --git a/src/deb-specific/install-exim4.sh b/src/deb-specific/install-exim4.sh
index ecb528b..bff861e 100755
--- a/src/deb-specific/install-exim4.sh
+++ b/src/deb-specific/install-exim4.sh
@@ -67,7 +67,11 @@ case "$1" in
       cp -a $m $cfg_gforge_main
 
       perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 $seen_gf_domains = 0;
 while (($l = <>) !~ /^\s*domainlist\s*local_domains/) {
   print $l;
@@ -89,7 +93,10 @@ while (<>) { print unless m/^hide pgsql_servers/; };
     # Second, insinuate our forwarding rules in the directors section
 
     perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 my $gf_block = "# BEGIN GFORGE BLOCK -- DO NOT EDIT #
 # You may move this block around to accomodate your local needs as long as you
diff --git a/src/deb-specific/install-ftp.sh b/src/deb-specific/install-ftp.sh
index bf1383f..2b3a0cd 100755
--- a/src/deb-specific/install-ftp.sh
+++ b/src/deb-specific/install-ftp.sh
@@ -10,8 +10,8 @@ if [ $(id -u) != 0 ] ; then
     exec su -c "$0 $1"
 fi
 
-FTPROOT=/var/lib/gforge/chroot/ftproot
-GRPHOME=/var/lib/gforge/chroot/home/groups
+FTPROOT=$(forge_get_config chroot)/ftproot
+GRPHOME=$(forge_get_config chroot)/home/groups
 FTPCONF=/etc/proftpd/proftpd.conf
 
 case "$1" in
@@ -20,12 +20,12 @@ case "$1" in
         #
 	# This initialize FTP
 	#
-	if ! grep -q "^Include /etc/gforge/sf-proftpd.conf" ${FTPCONF}.gforge-new ; then
+	if ! grep -q "^Include $(forge_get_config config_path)/sf-proftpd.conf" ${FTPCONF}.gforge-new ; then
 	    perl -pi -e "s/^/#SF#/" ${FTPCONF}.gforge-new
 	    echo "### Previous lines commented by GForge install" >> ${FTPCONF}.gforge-new
 	    echo "### Next lines inserted by GForge install" >> ${FTPCONF}.gforge-new
 	    echo "ServerType standalone" >>${FTPCONF}.gforge-new
-	    echo "Include /etc/gforge/sf-proftpd.conf" >> ${FTPCONF}.gforge-new
+	    echo "Include $(forge_get_config config_path)/sf-proftpd.conf" >> ${FTPCONF}.gforge-new
 	fi
 	;;
 
@@ -59,7 +59,7 @@ FIN
 	if grep -q "### Next lines inserted by GForge install" ${FTPCONF}.gforge-new ; then
 	    perl -pi -e "s/### Previous lines commented by GForge install\n//"  ${FTPCONF}.gforge-new
 	    perl -pi -e "s/### Next lines inserted by GForge install\n//" ${FTPCONF}.gforge-new
-	    perl -pi -e "s:^Include /etc/gforge/sf-proftpd.conf\n::" ${FTPCONF}.gforge-new
+	    perl -pi -e "s:^Include $(forge_get_config config_path)/sf-proftpd.conf\n::" ${FTPCONF}.gforge-new
 	    perl -pi -e "s:^ServerType standalone\n::" ${FTPCONF}.gforge-new
 	    perl -pi -e "s/^#SF#//" ${FTPCONF}.gforge-new
 	fi
diff --git a/src/deb-specific/install-ldap.sh b/src/deb-specific/install-ldap.sh
index 653b2a3..e80f85b 100755
--- a/src/deb-specific/install-ldap.sh
+++ b/src/deb-specific/install-ldap.sh
@@ -196,7 +196,7 @@ configure_slapd(){
 	    /etc/ldap/schema/cosine.schema \
 	    /etc/ldap/schema/inetorgperson.schema \
 	    /etc/ldap/schema/nis.schema \
-	    /etc/gforge/gforge.schema
+	    $(forge_get_config config_path)/gforge.schema
 	  do
 	  if ! grep -q "^include[ 	]*$schema" /etc/ldap/slapd.conf.gforge-new ; then
 	      echo "include	$schema	#Added by GForge install" >> $tmpfile
@@ -358,7 +358,7 @@ EOF
     tmpldifadd=$(mktemp $tmpfile_pattern)
     tmpldifmod=$(mktemp $tmpfile_pattern)
     dc=$(echo $gforge_base_dn | cut -d, -f1 | cut -d= -f2)
-    su -s /bin/sh gforge -c /usr/share/gforge/bin/sql2ldif.pl >> $tmpldif
+    su -s /bin/sh gforge -c $(forge_get_config binary_path)/sql2ldif.pl >> $tmpldif
     # echo "Filling LDAP with database"
     if ! eval "ldapadd -r -c -D '$robot_dn' -x -w'$robot_passwd' -f $tmpldif > $tmpldifadd 2>&1" ; then
         # Some entries could not be added (already there)
@@ -590,13 +590,13 @@ case "$1" in
 	admin_regexp="^cn=admin, *$admin_regexp"
 	get_our_entries () {
 	    {		# List candidates...
-		/usr/share/gforge/bin/sql2ldif.pl \
+		$(forge_get_config binary_path)/sql2ldif.pl \
 		    | grep "^dn:" \
 		    | sed 's/^dn: *//' \
 		    | grep -v "^dc=" \
 		    | grep -v "^ou=" \
 		    | grep -v "$admin_regexp"
-		/usr/share/gforge/bin/sql2ldif.pl \
+		$(forge_get_config binary_path)/sql2ldif.pl \
 		    | grep "^dn:" \
 		    | sed 's/^dn: *//' \
 		    | grep -v "^dc=" \
diff --git a/src/deb-specific/install-postfix.sh b/src/deb-specific/install-postfix.sh
index e7299d1..92e8597 100755
--- a/src/deb-specific/install-postfix.sh
+++ b/src/deb-specific/install-postfix.sh
@@ -31,6 +31,7 @@ case "$1" in
 	    echo "gforge: $server_admin" >> /etc/aliases.gforge-new
 	fi
 
+	if [ ! -e /etc/postfix/main.cf ]; then cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf; fi
 	cp -a /etc/postfix/main.cf /etc/postfix/main.cf.gforge-new
 
 	perl -pi -e's/SOURCEFORGE_DOMAINS/GFORGE_DOMAINS/;' \
@@ -41,10 +42,14 @@ case "$1" in
 	tmp1=$(mktemp /tmp/$pattern)
 	# First, get the list of local domains right - add gforge domains to 'mydestination'
 	perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 my $l;
 while ($l = <>) { 
-  last if l =~ /^\s*mydestination/ ;
+  last if $l =~ /^\s*mydestination/ ;
   print $l;
 };
 chomp $l;
@@ -58,7 +63,11 @@ while ($l = <>) { print $l; };
 ' < /etc/postfix/main.cf.gforge-new > $tmp1
 	grep -q '^[[:space:]]*relay_domains' $tmp1 || echo 'relay_domains = $mydestination' >>$tmp1
 	perl -i -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 my $l;
 while (($l = <>) !~ /^\s*relay_domains/) { print $l; };
 chomp $l;
@@ -69,7 +78,10 @@ while ($l = <>) { print $l; };
 	tmp2=$(mktemp /tmp/$pattern)
 	# Second, insinuate our forwarding rules in the directors section
 	perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 my $gf_block;
 my $l;
@@ -95,6 +107,7 @@ mailman_destination_recipient_limit = 1
 $seen_gf_block = 0;
 $seen_alias_maps = 0;
 $seen_transport_maps = 0;
+$data_path = forge_get_config("data_path");
 while ($l = <>) {
 	if ($l =~ /^\s*virtual_alias_maps/) {
 		chomp $l;
@@ -105,7 +118,7 @@ while ($l = <>) {
 		$seen_alias_maps = 1;
 	} elsif ($l =~ /^\s*transport_maps/) {
 		chomp $l;
-		$l .= ", hash:/var/lib/gforge/etc/postfix-transport" unless ($l =~ /^[^#]*hash:\/var\/lib\/gforge\/etc\/postfix-transport/);
+		$l .= ", hash:$data_path/etc/postfix-transport" unless ($l =~ m,^[^#]*hash:$data_path/etc/postfix-transport,);
 		print "$l\n";
 		$seen_transport_maps = 1;
 	} elsif ($l =~ /^\s*\#\#\# BEGIN GFORGE BLOCK \-\- DO NOT EDIT \#\#\#/) {
@@ -136,11 +149,12 @@ if ($seen_gf_block == 0) {
 
 if ($seen_alias_maps == 0) {
 	print "### GFORGE ADDITION - The following virtual_alias_maps line can be moved and this line removed ###\n";
-	print "virtual_alias_maps = pgsql:pgsql_gforge_users\n";
+	# Using proxy: so that Postfix daemons can access PostgreSQL from within their chroot
+	print "virtual_alias_maps = proxy:pgsql:pgsql_gforge_users\n";
 };
 if ($seen_transport_maps == 0) {
 	print "### GFORGE ADDITION - The following transport_maps line can be moved and this line removed ###\n";
-	print "transport_maps = hash:/var/lib/gforge/etc/postfix-transport\n";
+	print "transport_maps = hash:$data_path/etc/postfix-transport\n";
 };
 ' < $tmp1 > $tmp2
 	rm $tmp1
@@ -150,8 +164,8 @@ if ($seen_transport_maps == 0) {
     
     configure)
 	[ -x /usr/bin/newaliases ] && newaliases
-	echo "$(forge_get_config lists_host) mailman:" > /var/lib/gforge/etc/postfix-transport
-	postmap /var/lib/gforge/etc/postfix-transport	
+	echo "$(forge_get_config lists_host) mailman:" > $(forge_get_config data_path)/etc/postfix-transport
+	postmap $(forge_get_config data_path)/etc/postfix-transport	
 	;;
     
     purge-files)
@@ -173,9 +187,13 @@ if ($seen_transport_maps == 0) {
 	tmp1=$(mktemp /tmp/$pattern)
 	# First, replace the list of local domains
 	perl -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 while ($l = <>) { 
-  last if l =~ /^\s*mydestination/ ;
+  last if $l =~ /^\s*mydestination/ ;
   print $l;
 };
 chomp $l ;
@@ -190,7 +208,11 @@ if ($l =~ /^(\s*mydestination\s*=\s*)(\S.*)/) {
 while ($l = <>) { print $l; };
 ' < /etc/postfix/main.cf.gforge-new > $tmp1
 	grep -q '^[[:space:]]*relay_domains' $tmp1 && perl -i -e '
-require ("/usr/share/gforge/lib/include.pl") ;
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 while (($l = <>) !~ /^\s*relay_domains/) {
   print $l;
 };
diff --git a/src/deb-specific/install-ssh.sh b/src/deb-specific/install-ssh.sh
index dcd2c47..a9cd088 100755
--- a/src/deb-specific/install-ssh.sh
+++ b/src/deb-specific/install-ssh.sh
@@ -10,9 +10,11 @@ if [ $(id -u) != 0 ] ; then
     exec su -c "$0 $1"
 fi
 
+CHROOTDIR=$(forge_get_config chroot)
+
 case "$1" in
     configure)
-	[ -h /cvsroot ] || ln -s /var/lib/gforge/chroot/cvsroot /cvsroot
+	[ -h /cvsroot ] || ln -s $CHROOTDIR/cvsroot /cvsroot
 	$0 purge
 	;;
 
@@ -20,28 +22,28 @@ case "$1" in
     	if [ -d /etc/ssh ]
 	then
 		invoke-rc.d ssh stop
-		[ -f /var/lib/gforge/chroot/var/run/ssh.pid ] && kill $(cat /var/lib/gforge/chroot/var/run/ssh.pid)
-		rm -f /var/lib/gforge/chroot/var/run/ssh.pid
-		if ! grep -q "start-stop-daemon --chroot /var/lib/gforge/chroot" /etc/init.d/ssh ; then
-	    	perl -pi -e "s:start-stop-daemon:start-stop-daemon --chroot /var/lib/gforge/chroot:g" /etc/init.d/ssh
+		[ -f $CHROOTDIR/var/run/ssh.pid ] && kill $(cat $CHROOTDIR/var/run/ssh.pid)
+		rm -f $CHROOTDIR/var/run/ssh.pid
+		if ! grep -q "start-stop-daemon --chroot $CHROOTDIR" /etc/init.d/ssh ; then
+	    	perl -pi -e "s:start-stop-daemon:start-stop-daemon --chroot $CHROOTDIR:g" /etc/init.d/ssh
 		fi
 		rm -f /etc/ssh/sshd_not_to_be_run
 	fi
     	if [ -d /etc/ssh-nonfree ]
 	then
 		invoke-rc.d ssh-nonfree stop
-		[ -f /var/lib/gforge/chroot/var/run/ssh-nonfree.pid ] && kill $(cat /var/lib/gforge/chroot/var/run/ssh-nonfree.pid)
-		rm -f /var/lib/gforge/chroot/var/run/ssh-nonfree.pid
-		if ! grep -q "start-stop-daemon --chroot /var/lib/gforge/chroot" /etc/init.d/ssh-nonfree ; then
-	    	perl -pi -e "s:start-stop-daemon:start-stop-daemon --chroot /var/lib/gforge/chroot:g" /etc/init.d/ssh-nonfree
+		[ -f $CHROOTDIR/var/run/ssh-nonfree.pid ] && kill $(cat $CHROOTDIR/var/run/ssh-nonfree.pid)
+		rm -f $CHROOTDIR/var/run/ssh-nonfree.pid
+		if ! grep -q "start-stop-daemon --chroot $CHROOTDIR" /etc/init.d/ssh-nonfree ; then
+	    	perl -pi -e "s:start-stop-daemon:start-stop-daemon --chroot $CHROOTDIR:g" /etc/init.d/ssh-nonfree
 		fi
 		rm -f /etc/ssh-nonfree/sshd_not_to_be_run
 	fi
 	;;
 
     purge)
-	if grep -q "start-stop-daemon --chroot /var/lib/gforge/chroot" /etc/init.d/ssh ; then
-	    perl -pi -e "s:start-stop-daemon --chroot /var/lib/gforge/chroot:start-stop-daemon:g" /etc/init.d/ssh
+	if grep -q "start-stop-daemon --chroot $CHROOTDIR" /etc/init.d/ssh ; then
+	    perl -pi -e "s:start-stop-daemon --chroot $CHROOTDIR:start-stop-daemon:g" /etc/init.d/ssh
 	    invoke-rc.d ssh restart
 	fi
 	;;
diff --git a/src/deb-specific/mailfwd_update.pl b/src/deb-specific/mailfwd_update.pl
index 3097e8f..0703704 100644
--- a/src/deb-specific/mailfwd_update.pl
+++ b/src/deb-specific/mailfwd_update.pl
@@ -9,6 +9,11 @@
 use DBI;
 use English;
 
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
 ## Become this effective user (EUID/EGID) and perform this action.
 ##
 ## This protect against symlink attacks; they are inevitable when
@@ -64,7 +69,6 @@ sub GetUserUidGid {
     return ($uid,$gid);
 }
 
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
 # Run as gforge
 my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwnam("gforge");
 $> = $uid;
diff --git a/src/deb-specific/manage-uufiles.sh b/src/deb-specific/manage-uufiles.sh
deleted file mode 100755
index 68c8f84..0000000
--- a/src/deb-specific/manage-uufiles.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-case "$1" in
-    clean)
-	UUFILES=$(find -name *.uu)
-	for i in $UUFILES ; do
-	    d=$(dirname $i)
-	    j=$(basename $i .uu)
-	    if [ -e $d/$j ] ; then
-		rm $d/$j
-	    fi
-	done
-	;;
-    decode)
-	UUFILES=$(find -name *.uu)
-	for i in $UUFILES ; do
-	    d=$(dirname $i)
-	    j=$(basename $i .uu)
-	    uudecode -o $d/$j $i
-	done
-	;;
-    *)
-	echo "Usage: $0 {decode|clean}"
-	exit 1
-	;;
-esac
diff --git a/src/deb-specific/old-db-upgrade.pl b/src/deb-specific/old-db-upgrade.pl
index 696b6ab..da207fc 100755
--- a/src/deb-specific/old-db-upgrade.pl
+++ b/src/deb-specific/old-db-upgrade.pl
@@ -23,8 +23,11 @@ use vars qw/$sys_default_domain $sys_scm_host
     $server_admin $domain_name
     $libdir $sqldir/ ;
 
-$libdir="/usr/share/gforge/lib";
-$sqldir="/usr/share/gforge/db";
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+$libdir="$source_path/lib";
+$sqldir="$source_path/db";
 require ("$libdir/sqlparser.pm") ; # Our magic SQL parser
 require ("$libdir/sqlhelper.pm") ; # Our SQL functions
 require ("$libdir/include.pl");  # Some other functions
@@ -1210,19 +1213,6 @@ eval {
     }
 
     &update_with_sql("20050115", "4.0.2-0+3") ;
-#
-# We got this at upgrade
-#
-#DBD::Pg::st execute failed: ERREUR:  la relation avec l'OID 387345 n'existe pas at /usr/share/gforge/bin/db-upgrade.pl line 1970.
-#Transaction aborted because DBD::Pg::st execute failed: ERREUR:  la relation avec l'OID 387345 n'existe pas at /usr/share/gforge/bin/db-upgrade.pl line 1970.
-#Transaction aborted because DBD::Pg::st execute failed: ERREUR:  la relation avec l'OID 387345 n'existe pas at /usr/share/gforge/bin/db-upgrade.pl line 1970.
-#Last SQL query was:
-#update project_task SET last_modified_date=EXTRACT(EPOCH FROM now())::integer;
-#(end of query)
-#Your database schema is at version 4.0.2-0+5
-#
-# This is a hack to disconnect and reconnect the DB and solve the problem
-#
     $dbh->rollback ;
     &db_disconnect ;
     &db_connect ;
diff --git a/src/deb-specific/prepare-vhosts-file.pl b/src/deb-specific/prepare-vhosts-file.pl
index aa99232..4aa150c 100755
--- a/src/deb-specific/prepare-vhosts-file.pl
+++ b/src/deb-specific/prepare-vhosts-file.pl
@@ -7,14 +7,22 @@ use File::Temp ;
 use strict ;
 use vars qw/$dbh $ifile $ofile @ilist %hash $key $val $cur $line $dbh $sys_dbname $sys_dbuser $sys_dbpasswd $token/ ;
 
-require ("/usr/share/gforge/lib/include.pl") ; 
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+my $config_path = `forge_get_config config_path`;
+chomp $config_path;
+my $data_path = `forge_get_config data_path`;
+chomp $data_path;
+
+require ("$source_path/lib/include.pl") ; 
 
 %hash = () ;
 
 &db_connect ;
 
-$ifile = '/etc/gforge/templates/httpd.vhosts' ;
-$ofile = '/var/lib/gforge/etc/templates/httpd.vhosts' ;
+
+$ifile = "$config_path/templates/httpd.vhosts" ;
+$ofile = "$data_path/etc/templates/httpd.vhosts" ;
 
 open (IFILE, $ifile)
     or die "Can't open input file '$ifile'" ;
diff --git a/src/deb-specific/register-theme b/src/deb-specific/register-theme
index 101eff4..843ca15 100755
--- a/src/deb-specific/register-theme
+++ b/src/deb-specific/register-theme
@@ -10,25 +10,28 @@ use vars qw/$dbh @reqlist $thdir $thname/ ;
 
 sub debug ( $ ) ;
 
-require ("/usr/share/gforge/lib/include.pl") ; # Include all the predefined functions 
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 &db_connect ;
 
 if ($#ARGV < 1) {
     debug "Usage: register-theme <dirname> <theme name>" ;
-    debug "The theme must be in /usr/share/gforge/www/themes/<dirname>/" ;
+    debug "The theme must be in $source_path/www/themes/<dirname>/" ;
     exit 1 ;
 }
 
 $thdir = $ARGV [0] ;
 $thname = $ARGV [1] ;
 
-unless (-d "/usr/share/gforge/www/themes/$thdir") {
-    debug "The directory /usr/share/gforge/www/themes/$thdir does not exist" ;
+unless (-d "$source_path/www/themes/$thdir") {
+    debug "The directory $source_path/www/themes/$thdir does not exist" ;
     exit 1 ;
 }
-unless (-e "/usr/share/gforge/www/themes/$thdir/Theme.class.php") {
-    debug "The file /usr/share/gforge/www/themes/$thdir/Theme.class.php does not exist" ;
+unless (-e "$source_path/www/themes/$thdir/Theme.class.php") {
+    debug "The file $source_path/www/themes/$thdir/Theme.class.php does not exist" ;
     exit 1 ;
 }
 
diff --git a/src/deb-specific/sf-add-skill b/src/deb-specific/sf-add-skill
index c47a709..ad26240 100755
--- a/src/deb-specific/sf-add-skill
+++ b/src/deb-specific/sf-add-skill
@@ -12,7 +12,10 @@ use vars qw/@skills/ ;
 
 sub debug ( $ ) ;
 
-require ("/usr/share/gforge/lib/include.pl") ; # Include all the predefined functions 
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 &db_connect ;
 
diff --git a/src/deb-specific/sf-proftpd.conf b/src/deb-specific/sf-proftpd.conf
index fe32f19..e3046e9 100644
--- a/src/deb-specific/sf-proftpd.conf
+++ b/src/deb-specific/sf-proftpd.conf
@@ -16,7 +16,7 @@ DeferWelcome			off
 DefaultRoot			~
 ServerIdent			off
 # This should be enough for SF what happens on real SF?
-#DefaultRoot			/var/lib/gforge/chroot
+#DefaultRoot			@DATA_PATH@/chroot
 # Most SF users don't have valid shell
 RequireValidShell		off
 
diff --git a/src/deb-specific/ssh_dump_update.pl b/src/deb-specific/ssh_dump_update.pl
deleted file mode 100755
index e15e98c..0000000
--- a/src/deb-specific/ssh_dump_update.pl
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/perl
-#
-# ssh_dump.pl - Script to suck data outta the database to be processed by ssh_create.pl
-#
-# Symlink attack fix Copyright (C) 2009 Sylvain Beucler / GPLv2+ / no warranty
-use DBI;
-use English;
-
-## Become this effective user (EUID/EGID) and perform this action.
-## 
-## This protect against symlink attacks; they are inevitable when
-## working in a directory owned by a local user.  We could naively
-## check for the presence of symlinks, but then we'd still be
-## vulnerable to a symlink race attack.
-## 
-## We'll use set_e_uid/set_e_gid for efficiency and simplicity
-## (e.g. we can get the return value directly), which is enough for
-## opening files and similar basic operations.  When calling external
-## programs, you should use fork&exec&setuid/setgid.
-## 
-# arg1: username
-# arg2: a Perl sub{}
-sub SudoEffectiveUser {
-    my $user = $_[0];
-    my $sub_unprivileged = $_[1];
-
-    my ($uid,$gid) = GetUserUidGid($user);
-    if ($uid eq "" or $gid eq "") {
-	print "Unknown user: $user\n";
-	return;
-    }
-
-    my $old_GID = $GID; # save additional groups
-    $! = '';
-    $EGID = "$gid $gid"; # set egid and additional groups
-    if ($! ne '') {
-	warn "Cannot setegid($gid $gid): $!";
-	return;
-    }
-    $EUID = $uid;
-    if ($! ne '') {
-	warn "Cannot seteuid($uid): $!";
-	return;
-    }
-
-    # Perform the action under this effective user:
-    my $ret = &$sub_unprivileged();
-
-    # Back to root
-    undef($EUID);     # restore euid==uid
-    $EGID = $old_GID; # restore egid==gid + additional groups
-
-    return $ret;
-}
-
-## Get system uid/gid
-sub GetUserUidGid {
-    my $user = $_[0];
-    my ($name,$passwd,$uid,$gid,
-	$quota,$comment,$gcos,$dir,$shell,$expire) = getpwnam($user);
-    return ($uid,$gid);
-}
-
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
-
-# Run as gforge
-my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwnam("gforge");
-$> = $uid;
-
-my $verbose=0;
-my $ssh_array = ();
-
-&db_connect;
-
-$dbh->{AutoCommit} = 0;
-
-# Dump the Table information
-$query = "SELECT user_name,unix_uid,authorized_keys FROM users WHERE authorized_keys != '' AND status !='D'";
-$c = $dbh->prepare($query);
-$c->execute();
-while(my ($username, $unix_uid, $ssh_key) = $c->fetchrow()) {
-	$new_list = "$username:$unix_uid:$ssh_key\n";
-	push @ssh_array, $new_list;
-}
-
-# Run as root
-$> = 0; 
-
-my ($username, $ssh_keys, $ssh_dir);
-
-if($verbose){print("\n\n	Processing Users keys creation\n\n")};
-while ($ln = pop(@ssh_array)) {
-	($username, $uid, $ssh_key) = split(":", $ln);
-
-	$ssh_key =~ s/\#\#\#/\n/g;
-	$username =~ tr/[A-Z]/[a-z]/;
-	$uid += $uid_add;
-
-	push @user_authorized_keys, $ssh_key . "\n";
-	push @user_authorized_keys, "\n# This file is automatically generated from your account settings.\n";
-
-	$ssh_dir = "$homedir_prefix/$username/.ssh";
-
-	if($verbose){print ("Processing $username\n")};
-
-	if (-d "$homedir_prefix/$username"){
-		chown $uid, $uid, ("$homedir_prefix/$username");
-	
-		SudoEffectiveUser($username, sub {
-		    if (! -d $ssh_dir) {
-			mkdir $ssh_dir, 0755;
-		    }
-		    
-		    if($verbose){print("Writing authorized_keys for $username: ")};
-		    
-		    if (write_array_file("$ssh_dir/authorized_keys", @user_authorized_keys)) {
-                        warn "Problem writing authorized_keys for $username\n";
-                        next;
-		    }
-		    chmod 0644, "$ssh_dir/authorized_keys";
-				  });
-
-		if($verbose){print ("Done\n")};
-	} else {
-		if($verbose){print ("Not yet done, waiting for home creation\n")};
-	}
-
-	undef @user_authorized_keys;
-}
-undef @ssh_array;
-
-### Phase 2: remove the files when needed
-
-# Dump the Table information
-$query = "SELECT user_name,unix_uid FROM users WHERE authorized_keys = '' OR authorized_keys IS NULL OR status = 'D'";
-$c = $dbh->prepare($query);
-$c->execute();
-while(my ($username, $unix_uid, $ssh_key) = $c->fetchrow()) {
-	$new_list = "$username:$unix_uid\n";
-	push @ssh_array, $new_list;
-}
-
-if($verbose){print("\n\n	Processing Users keys deletion\n\n")};
-while ($ln = pop(@ssh_array)) {
-	($username, $uid) = split(":", $ln);
-
-	$username =~ tr/[A-Z]/[a-z]/;
-	$uid += $uid_add;
-
-	$ssh_dir = "$homedir_prefix/$username/.ssh";
-
-	if($verbose){print ("Processing $username\n")};
-
-	if (-d $ssh_dir) {
-	    if($verbose){print("Resetting authorized_keys for $username: ")};
-
-	    SudoEffectiveUser($username, sub {
-		unlink("$ssh_dir/authorized_keys");
-			      });
-
-	    chown $uid, $uid, "$homedir_prefix/$username";
-
-	    if($verbose){print ("Done\n")};
-	}
-}
diff --git a/src/deb-specific/stats_cvs.pl b/src/deb-specific/stats_cvs.pl
index e8f4c57..7e87c28 100755
--- a/src/deb-specific/stats_cvs.pl
+++ b/src/deb-specific/stats_cvs.pl
@@ -13,8 +13,13 @@ use POSIX qw( strftime );
 
 # For the database
 use DBI;
-require("/usr/share/gforge/lib/include.pl");
-my $cvsroot = "/var/lib/gforge/chroot/cvsroot";
+
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
+
+my $cvsroot = forge_get_config("chroot")."/cvsroot";
 my $verbose = 1;
 $|=0 if $verbose;
 $|++;
diff --git a/src/deb-specific/stats_projects_logparse.pl b/src/deb-specific/stats_projects_logparse.pl
index 6196a3a..f5e26ba 100755
--- a/src/deb-specific/stats_projects_logparse.pl
+++ b/src/deb-specific/stats_projects_logparse.pl
@@ -7,7 +7,11 @@
 use DBI;
 use Time::Local;
 use POSIX qw( strftime );
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
+
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 #######################
 ##  CONF VARS
diff --git a/src/deb-specific/tmp-sf.sql b/src/deb-specific/tmp-sf.sql
deleted file mode 100644
index c435737..0000000
--- a/src/deb-specific/tmp-sf.sql
+++ /dev/null
@@ -1,1094 +0,0 @@
-CREATE SEQUENCE "bug_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug" (
-	"bug_id" integer DEFAULT nextval('bug_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"status_id" integer DEFAULT '0' NOT NULL,
-	"priority" integer DEFAULT '0' NOT NULL,
-	"category_id" integer DEFAULT '0' NOT NULL,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"assigned_to" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	"summary" text,
-	"details" text,
-	"close_date" integer,
-	"bug_group_id" integer DEFAULT '0' NOT NULL,
-	"resolution_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("bug_id")
-);
-CREATE SEQUENCE "bug_bug_dependencies_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_bug_dependencies" (
-	"bug_depend_id" integer DEFAULT nextval('bug_bug_dependencies_pk_seq'::text) NOT NULL,
-	"bug_id" integer DEFAULT '0' NOT NULL,
-	"is_dependent_on_bug_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("bug_depend_id")
-);
-CREATE SEQUENCE "bug_canned_responses_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_canned_responses" (
-	"bug_canned_id" integer DEFAULT nextval('bug_canned_responses_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"title" text,
-	"body" text,
-	PRIMARY KEY ("bug_canned_id")
-);
-CREATE SEQUENCE "bug_category_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_category" (
-	"bug_category_id" integer DEFAULT nextval('bug_category_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"category_name" text,
-	PRIMARY KEY ("bug_category_id")
-);
-CREATE SEQUENCE "bug_filter_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_filter" (
-	"filter_id" integer DEFAULT nextval('bug_filter_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"sql_clause" text DEFAULT '' NOT NULL,
-	"is_active" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("filter_id")
-);
-CREATE SEQUENCE "bug_group_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_group" (
-	"bug_group_id" integer DEFAULT nextval('bug_group_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"group_name" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("bug_group_id")
-);
-CREATE SEQUENCE "bug_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_history" (
-	"bug_history_id" integer DEFAULT nextval('bug_history_pk_seq'::text) NOT NULL,
-	"bug_id" integer DEFAULT '0' NOT NULL,
-	"field_name" text DEFAULT '' NOT NULL,
-	"old_value" text DEFAULT '' NOT NULL,
-	"mod_by" integer DEFAULT '0' NOT NULL,
-	"date" integer,
-	PRIMARY KEY ("bug_history_id")
-);
-CREATE SEQUENCE "bug_resolution_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_resolution" (
-	"resolution_id" integer DEFAULT nextval('bug_resolution_pk_seq'::text) NOT NULL,
-	"resolution_name" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("resolution_id")
-);
-CREATE SEQUENCE "bug_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_status" (
-	"status_id" integer DEFAULT nextval('bug_status_pk_seq'::text) NOT NULL,
-	"status_name" text,
-	PRIMARY KEY ("status_id")
-);
-CREATE SEQUENCE "bug_task_dependencies_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "bug_task_dependencies" (
-	"bug_depend_id" integer DEFAULT nextval('bug_task_dependencies_pk_seq'::text) NOT NULL,
-	"bug_id" integer DEFAULT '0' NOT NULL,
-	"is_dependent_on_task_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("bug_depend_id")
-);
-CREATE SEQUENCE "canned_responses_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "canned_responses" (
-	"response_id" integer DEFAULT nextval('canned_responses_pk_seq'::text) NOT NULL,
-	"response_title" character varying(25),
-	"response_text" text,
-	PRIMARY KEY ("response_id")
-);
-CREATE SEQUENCE "db_images_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "db_images" (
-	"id" integer DEFAULT nextval('db_images_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"description" text DEFAULT '' NOT NULL,
-	"bin_data" text DEFAULT '' NOT NULL,
-	"filename" text DEFAULT '' NOT NULL,
-	"filesize" integer DEFAULT '0' NOT NULL,
-	"filetype" text DEFAULT '' NOT NULL,
-	"width" integer DEFAULT '0' NOT NULL,
-	"height" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "doc_data_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "doc_data" (
-	"docid" integer DEFAULT nextval('doc_data_pk_seq'::text) NOT NULL,
-	"stateid" integer DEFAULT '0' NOT NULL,
-	"title" character varying(255) DEFAULT '' NOT NULL,
-	"data" text DEFAULT '' NOT NULL,
-	"updatedate" integer DEFAULT '0' NOT NULL,
-	"createdate" integer DEFAULT '0' NOT NULL,
-	"created_by" integer DEFAULT '0' NOT NULL,
-	"doc_group" integer DEFAULT '0' NOT NULL,
-	"description" text,
-	"language_id" integer DEFAULT '1' NOT NULL,
-	PRIMARY KEY ("docid")
-);
-CREATE SEQUENCE "doc_groups_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "doc_groups" (
-	"doc_group" integer DEFAULT nextval('doc_groups_pk_seq'::text) NOT NULL,
-	"groupname" character varying(255) DEFAULT '' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("doc_group")
-);
-CREATE SEQUENCE "doc_states_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "doc_states" (
-	"stateid" integer DEFAULT nextval('doc_states_pk_seq'::text) NOT NULL,
-	"name" character varying(255) DEFAULT '' NOT NULL,
-	PRIMARY KEY ("stateid")
-);
-CREATE SEQUENCE "filemodule_monitor_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "filemodule_monitor" (
-	"id" integer DEFAULT nextval('filemodule_monitor_pk_seq'::text) NOT NULL,
-	"filemodule_id" integer DEFAULT '0' NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "forum_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "forum" (
-	"msg_id" integer DEFAULT nextval('forum_pk_seq'::text) NOT NULL,
-	"group_forum_id" integer DEFAULT '0' NOT NULL,
-	"posted_by" integer DEFAULT '0' NOT NULL,
-	"subject" text DEFAULT '' NOT NULL,
-	"body" text DEFAULT '' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	"is_followup_to" integer DEFAULT '0' NOT NULL,
-	"thread_id" integer DEFAULT '0' NOT NULL,
-	"has_followups" integer DEFAULT '0',
-	"most_recent_date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("msg_id")
-);
-CREATE TABLE "forum_agg_msg_count" (
-	"group_forum_id" integer DEFAULT '0' NOT NULL,
-	"count" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("group_forum_id")
-);
-CREATE SEQUENCE "forum_group_list_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "forum_group_list" (
-	"group_forum_id" integer DEFAULT nextval('forum_group_list_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"forum_name" text DEFAULT '' NOT NULL,
-	"is_public" integer DEFAULT '0' NOT NULL,
-	"description" text,
-	"allow_anonymous" integer DEFAULT '0' NOT NULL,
-	"send_all_posts_to" text,
-	PRIMARY KEY ("group_forum_id")
-);
-CREATE SEQUENCE "forum_monitored_forums_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "forum_monitored_forums" (
-	"monitor_id" integer DEFAULT nextval('forum_monitored_forums_pk_seq'::text) NOT NULL,
-	"forum_id" integer DEFAULT '0' NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("monitor_id")
-);
-CREATE SEQUENCE "forum_saved_place_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "forum_saved_place" (
-	"saved_place_id" integer DEFAULT nextval('forum_saved_place_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"forum_id" integer DEFAULT '0' NOT NULL,
-	"save_date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("saved_place_id")
-);
-CREATE TABLE "foundry_data" (
-	"foundry_id" integer DEFAULT '0' NOT NULL,
-	"freeform1_html" text,
-	"freeform2_html" text,
-	"sponsor1_html" text,
-	"sponsor2_html" text,
-	"guide_image_id" integer DEFAULT '0' NOT NULL,
-	"logo_image_id" integer DEFAULT '0' NOT NULL,
-	"trove_categories" text,
-	PRIMARY KEY ("foundry_id")
-);
-CREATE SEQUENCE "foundry_news_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "foundry_news" (
-	"foundry_news_id" integer DEFAULT nextval('foundry_news_pk_seq'::text) NOT NULL,
-	"foundry_id" integer DEFAULT '0' NOT NULL,
-	"news_id" integer DEFAULT '0' NOT NULL,
-	"approve_date" integer DEFAULT '0' NOT NULL,
-	"is_approved" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("foundry_news_id")
-);
-CREATE SEQUENCE "foundry_preferred_projec_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "foundry_preferred_projects" (
-	"foundry_project_id" integer DEFAULT nextval('foundry_preferred_projec_pk_seq'::text) NOT NULL,
-	"foundry_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"rank" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("foundry_project_id")
-);
-CREATE SEQUENCE "foundry_projects_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "foundry_projects" (
-	"id" integer DEFAULT nextval('foundry_projects_pk_seq'::text) NOT NULL,
-	"foundry_id" integer DEFAULT '0' NOT NULL,
-	"project_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE TABLE "frs_dlstats_agg" (
-	"file_id" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"downloads_http" integer DEFAULT '0' NOT NULL,
-	"downloads_ftp" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "frs_dlstats_file_agg" (
-	"file_id" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "frs_dlstats_filetotal_agg" (
-	"file_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("file_id")
-);
-CREATE TABLE "frs_dlstats_filetotal_agg_old" (
-	"file_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "frs_dlstats_group_agg" (
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "frs_dlstats_grouptotal_agg" (
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE SEQUENCE "frs_file_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_file" (
-	"file_id" integer DEFAULT nextval('frs_file_pk_seq'::text) NOT NULL,
-	"filename" text,
-	"release_id" integer DEFAULT '0' NOT NULL,
-	"type_id" integer DEFAULT '0' NOT NULL,
-	"processor_id" integer DEFAULT '0' NOT NULL,
-	"release_time" integer DEFAULT '0' NOT NULL,
-	"file_size" integer DEFAULT '0' NOT NULL,
-	"post_date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("file_id")
-);
-CREATE SEQUENCE "frs_filetype_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_filetype" (
-	"type_id" integer DEFAULT nextval('frs_filetype_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("type_id")
-);
-CREATE SEQUENCE "frs_package_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_package" (
-	"package_id" integer DEFAULT nextval('frs_package_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"name" text,
-	"status_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("package_id")
-);
-CREATE SEQUENCE "frs_processor_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_processor" (
-	"processor_id" integer DEFAULT nextval('frs_processor_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("processor_id")
-);
-CREATE SEQUENCE "frs_release_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_release" (
-	"release_id" integer DEFAULT nextval('frs_release_pk_seq'::text) NOT NULL,
-	"package_id" integer DEFAULT '0' NOT NULL,
-	"name" text,
-	"notes" text,
-	"changes" text,
-	"status_id" integer DEFAULT '0' NOT NULL,
-	"preformatted" integer DEFAULT '0' NOT NULL,
-	"release_date" integer DEFAULT '0' NOT NULL,
-	"released_by" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("release_id")
-);
-CREATE SEQUENCE "frs_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "frs_status" (
-	"status_id" integer DEFAULT nextval('frs_status_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("status_id")
-);
-CREATE SEQUENCE "group_cvs_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "group_cvs_history" (
-	"id" integer DEFAULT nextval('group_cvs_history_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"user_name" character varying(80) DEFAULT '' NOT NULL,
-	"cvs_commits" integer DEFAULT '0' NOT NULL,
-	"cvs_commits_wk" integer DEFAULT '0' NOT NULL,
-	"cvs_adds" integer DEFAULT '0' NOT NULL,
-	"cvs_adds_wk" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "group_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "group_history" (
-	"group_history_id" integer DEFAULT nextval('group_history_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"field_name" text DEFAULT '' NOT NULL,
-	"old_value" text DEFAULT '' NOT NULL,
-	"mod_by" integer DEFAULT '0' NOT NULL,
-	"date" integer,
-	PRIMARY KEY ("group_history_id")
-);
-CREATE SEQUENCE "group_type_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "group_type" (
-	"type_id" integer DEFAULT nextval('group_type_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("type_id")
-);
-CREATE SEQUENCE "groups_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "groups" (
-	"group_id" integer DEFAULT nextval('groups_pk_seq'::text) NOT NULL,
-	"group_name" character varying(40),
-	"homepage" character varying(128),
-	"is_public" integer DEFAULT '0' NOT NULL,
-	"status" character(1) DEFAULT 'A' NOT NULL,
-	"unix_group_name" character varying(30) DEFAULT '' NOT NULL,
-	"unix_box" character varying(20) DEFAULT 'shell1' NOT NULL,
-	"http_domain" character varying(80),
-	"short_description" character varying(255),
-	"cvs_box" character varying(20) DEFAULT 'cvs1' NOT NULL,
-	"license" character varying(16),
-	"register_purpose" text,
-	"license_other" text,
-	"register_time" integer DEFAULT '0' NOT NULL,
-	"use_bugs" integer DEFAULT '1' NOT NULL,
-	"rand_hash" text,
-	"use_mail" integer DEFAULT '1' NOT NULL,
-	"use_survey" integer DEFAULT '1' NOT NULL,
-	"use_patch" integer DEFAULT '1' NOT NULL,
-	"use_forum" integer DEFAULT '1' NOT NULL,
-	"use_pm" integer DEFAULT '1' NOT NULL,
-	"use_cvs" integer DEFAULT '1' NOT NULL,
-	"use_news" integer DEFAULT '1' NOT NULL,
-	"use_support" integer DEFAULT '1' NOT NULL,
-	"new_bug_address" text DEFAULT '' NOT NULL,
-	"new_patch_address" text DEFAULT '' NOT NULL,
-	"new_support_address" text DEFAULT '' NOT NULL,
-	"type" integer DEFAULT '1' NOT NULL,
-	"use_docman" integer DEFAULT '1' NOT NULL,
-	"send_all_bugs" integer DEFAULT '0' NOT NULL,
-	"send_all_patches" integer DEFAULT '0' NOT NULL,
-	"send_all_support" integer DEFAULT '0' NOT NULL,
-	"new_task_address" text DEFAULT '' NOT NULL,
-	"send_all_tasks" integer DEFAULT '0' NOT NULL,
-	"use_bug_depend_box" integer DEFAULT '1' NOT NULL,
-	"use_pm_depend_box" integer DEFAULT '1' NOT NULL,
-	PRIMARY KEY ("group_id")
-);
-CREATE TABLE "intel_agreement" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"message" text,
-	"is_approved" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("user_id")
-);
-CREATE SEQUENCE "mail_group_list_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "mail_group_list" (
-	"group_list_id" integer DEFAULT nextval('mail_group_list_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"list_name" text,
-	"is_public" integer DEFAULT '0' NOT NULL,
-	"password" character varying(16),
-	"list_admin" integer DEFAULT '0' NOT NULL,
-	"status" integer DEFAULT '0' NOT NULL,
-	"description" text,
-	PRIMARY KEY ("group_list_id")
-);
-CREATE SEQUENCE "news_bytes_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "news_bytes" (
-	"id" integer DEFAULT nextval('news_bytes_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"is_approved" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	"forum_id" integer DEFAULT '0' NOT NULL,
-	"summary" text,
-	"details" text,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "patch_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "patch" (
-	"patch_id" integer DEFAULT nextval('patch_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"patch_status_id" integer DEFAULT '0' NOT NULL,
-	"patch_category_id" integer DEFAULT '0' NOT NULL,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"assigned_to" integer DEFAULT '0' NOT NULL,
-	"open_date" integer DEFAULT '0' NOT NULL,
-	"summary" text,
-	"code" text,
-	"close_date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("patch_id")
-);
-CREATE SEQUENCE "patch_category_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "patch_category" (
-	"patch_category_id" integer DEFAULT nextval('patch_category_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"category_name" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("patch_category_id")
-);
-CREATE SEQUENCE "patch_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "patch_history" (
-	"patch_history_id" integer DEFAULT nextval('patch_history_pk_seq'::text) NOT NULL,
-	"patch_id" integer DEFAULT '0' NOT NULL,
-	"field_name" text DEFAULT '' NOT NULL,
-	"old_value" text DEFAULT '' NOT NULL,
-	"mod_by" integer DEFAULT '0' NOT NULL,
-	"date" integer,
-	PRIMARY KEY ("patch_history_id")
-);
-CREATE SEQUENCE "patch_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "patch_status" (
-	"patch_status_id" integer DEFAULT nextval('patch_status_pk_seq'::text) NOT NULL,
-	"status_name" text,
-	PRIMARY KEY ("patch_status_id")
-);
-CREATE SEQUENCE "people_job_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_job" (
-	"job_id" integer DEFAULT nextval('people_job_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"created_by" integer DEFAULT '0' NOT NULL,
-	"title" text,
-	"description" text,
-	"date" integer DEFAULT '0' NOT NULL,
-	"status_id" integer DEFAULT '0' NOT NULL,
-	"category_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("job_id")
-);
-CREATE SEQUENCE "people_job_category_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_job_category" (
-	"category_id" integer DEFAULT nextval('people_job_category_pk_seq'::text) NOT NULL,
-	"name" text,
-	"private_flag" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("category_id")
-);
-CREATE SEQUENCE "people_job_inventory_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_job_inventory" (
-	"job_inventory_id" integer DEFAULT nextval('people_job_inventory_pk_seq'::text) NOT NULL,
-	"job_id" integer DEFAULT '0' NOT NULL,
-	"skill_id" integer DEFAULT '0' NOT NULL,
-	"skill_level_id" integer DEFAULT '0' NOT NULL,
-	"skill_year_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("job_inventory_id")
-);
-CREATE SEQUENCE "people_job_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_job_status" (
-	"status_id" integer DEFAULT nextval('people_job_status_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("status_id")
-);
-CREATE SEQUENCE "people_skill_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_skill" (
-	"skill_id" integer DEFAULT nextval('people_skill_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("skill_id")
-);
-CREATE SEQUENCE "people_skill_inventory_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_skill_inventory" (
-	"skill_inventory_id" integer DEFAULT nextval('people_skill_inventory_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"skill_id" integer DEFAULT '0' NOT NULL,
-	"skill_level_id" integer DEFAULT '0' NOT NULL,
-	"skill_year_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("skill_inventory_id")
-);
-CREATE SEQUENCE "people_skill_level_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_skill_level" (
-	"skill_level_id" integer DEFAULT nextval('people_skill_level_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("skill_level_id")
-);
-CREATE SEQUENCE "people_skill_year_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "people_skill_year" (
-	"skill_year_id" integer DEFAULT nextval('people_skill_year_pk_seq'::text) NOT NULL,
-	"name" text,
-	PRIMARY KEY ("skill_year_id")
-);
-CREATE SEQUENCE "project_assigned_to_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_assigned_to" (
-	"project_assigned_id" integer DEFAULT nextval('project_assigned_to_pk_seq'::text) NOT NULL,
-	"project_task_id" integer DEFAULT '0' NOT NULL,
-	"assigned_to_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("project_assigned_id")
-);
-CREATE TABLE "project_counts_tmp" (
-	"group_id" integer,
-	"type" text,
-	"count" double precision
-);
-CREATE TABLE "project_counts_weekly_tmp" (
-	"group_id" integer,
-	"type" text,
-	"count" double precision
-);
-CREATE SEQUENCE "project_dependencies_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_dependencies" (
-	"project_depend_id" integer DEFAULT nextval('project_dependencies_pk_seq'::text) NOT NULL,
-	"project_task_id" integer DEFAULT '0' NOT NULL,
-	"is_dependent_on_task_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("project_depend_id")
-);
-CREATE SEQUENCE "project_group_list_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_group_list" (
-	"group_project_id" integer DEFAULT nextval('project_group_list_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"project_name" text DEFAULT '' NOT NULL,
-	"is_public" integer DEFAULT '0' NOT NULL,
-	"description" text,
-	PRIMARY KEY ("group_project_id")
-);
-CREATE SEQUENCE "project_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_history" (
-	"project_history_id" integer DEFAULT nextval('project_history_pk_seq'::text) NOT NULL,
-	"project_task_id" integer DEFAULT '0' NOT NULL,
-	"field_name" text DEFAULT '' NOT NULL,
-	"old_value" text DEFAULT '' NOT NULL,
-	"mod_by" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("project_history_id")
-);
-CREATE SEQUENCE "project_metric_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_metric" (
-	"ranking" integer DEFAULT nextval('project_metric_pk_seq'::text) NOT NULL,
-	"percentile" double precision,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("ranking")
-);
-CREATE SEQUENCE "project_metric_tmp1_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_metric_tmp1" (
-	"ranking" integer DEFAULT nextval('project_metric_tmp1_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"value" double precision,
-	PRIMARY KEY ("ranking")
-);
-CREATE SEQUENCE "project_metric_weekly_tm_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_metric_weekly_tmp1" (
-	"ranking" integer DEFAULT nextval('project_metric_weekly_tm_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"value" double precision,
-	PRIMARY KEY ("ranking")
-);
-CREATE SEQUENCE "project_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_status" (
-	"status_id" integer DEFAULT nextval('project_status_pk_seq'::text) NOT NULL,
-	"status_name" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("status_id")
-);
-CREATE SEQUENCE "project_task_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_task" (
-	"project_task_id" integer DEFAULT nextval('project_task_pk_seq'::text) NOT NULL,
-	"group_project_id" integer DEFAULT '0' NOT NULL,
-	"summary" text DEFAULT '' NOT NULL,
-	"details" text DEFAULT '' NOT NULL,
-	"percent_complete" integer DEFAULT '0' NOT NULL,
-	"priority" integer DEFAULT '0' NOT NULL,
-	"hours" double precision DEFAULT '0.00' NOT NULL,
-	"start_date" integer DEFAULT '0' NOT NULL,
-	"end_date" integer DEFAULT '0' NOT NULL,
-	"created_by" integer DEFAULT '0' NOT NULL,
-	"status_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("project_task_id")
-);
-CREATE SEQUENCE "project_weekly_metric_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "project_weekly_metric" (
-	"ranking" integer DEFAULT nextval('project_weekly_metric_pk_seq'::text) NOT NULL,
-	"percentile" double precision,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("ranking")
-);
-CREATE TABLE "session" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"session_hash" character(32) DEFAULT '' NOT NULL,
-	"ip_addr" character(15) DEFAULT '' NOT NULL,
-	"time" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("session_hash")
-);
-CREATE SEQUENCE "snippet_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "snippet" (
-	"snippet_id" integer DEFAULT nextval('snippet_pk_seq'::text) NOT NULL,
-	"created_by" integer DEFAULT '0' NOT NULL,
-	"name" text,
-	"description" text,
-	"type" integer DEFAULT '0' NOT NULL,
-	"language" integer DEFAULT '0' NOT NULL,
-	"license" text DEFAULT '' NOT NULL,
-	"category" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("snippet_id")
-);
-CREATE SEQUENCE "snippet_package_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "snippet_package" (
-	"snippet_package_id" integer DEFAULT nextval('snippet_package_pk_seq'::text) NOT NULL,
-	"created_by" integer DEFAULT '0' NOT NULL,
-	"name" text,
-	"description" text,
-	"category" integer DEFAULT '0' NOT NULL,
-	"language" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("snippet_package_id")
-);
-CREATE SEQUENCE "snippet_package_item_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "snippet_package_item" (
-	"snippet_package_item_id" integer DEFAULT nextval('snippet_package_item_pk_seq'::text) NOT NULL,
-	"snippet_package_version_id" integer DEFAULT '0' NOT NULL,
-	"snippet_version_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("snippet_package_item_id")
-);
-CREATE SEQUENCE "snippet_package_version_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "snippet_package_version" (
-	"snippet_package_version_id" integer DEFAULT nextval('snippet_package_version_pk_seq'::text) NOT NULL,
-	"snippet_package_id" integer DEFAULT '0' NOT NULL,
-	"changes" text,
-	"version" text,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("snippet_package_version_id")
-);
-CREATE SEQUENCE "snippet_version_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "snippet_version" (
-	"snippet_version_id" integer DEFAULT nextval('snippet_version_pk_seq'::text) NOT NULL,
-	"snippet_id" integer DEFAULT '0' NOT NULL,
-	"changes" text,
-	"version" text,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL,
-	"code" text,
-	PRIMARY KEY ("snippet_version_id")
-);
-CREATE TABLE "stats_agg_logo_by_day" (
-	"day" integer,
-	"count" integer
-);
-CREATE TABLE "stats_agg_logo_by_group" (
-	"day" integer,
-	"group_id" integer,
-	"count" integer
-);
-CREATE TABLE "stats_agg_pages_by_browser" (
-	"browser" character varying(8),
-	"count" integer
-);
-CREATE TABLE "stats_agg_pages_by_day" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"count" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_agg_pages_by_day_old" (
-	"day" integer,
-	"count" integer
-);
-CREATE TABLE "stats_agg_site_by_day" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"count" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_agg_site_by_group" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"count" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_agr_filerelease" (
-	"filerelease_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_agr_project" (
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"group_ranking" integer DEFAULT '0' NOT NULL,
-	"group_metric" double precision DEFAULT '0.00000' NOT NULL,
-	"developers" integer DEFAULT '0' NOT NULL,
-	"file_releases" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL,
-	"site_views" integer DEFAULT '0' NOT NULL,
-	"logo_views" integer DEFAULT '0' NOT NULL,
-	"msg_posted" integer DEFAULT '0' NOT NULL,
-	"msg_uniq_auth" integer DEFAULT '0' NOT NULL,
-	"bugs_opened" integer DEFAULT '0' NOT NULL,
-	"bugs_closed" integer DEFAULT '0' NOT NULL,
-	"support_opened" integer DEFAULT '0' NOT NULL,
-	"support_closed" integer DEFAULT '0' NOT NULL,
-	"patches_opened" integer DEFAULT '0' NOT NULL,
-	"patches_closed" integer DEFAULT '0' NOT NULL,
-	"tasks_opened" integer DEFAULT '0' NOT NULL,
-	"tasks_closed" integer DEFAULT '0' NOT NULL,
-	"help_requests" integer DEFAULT '0' NOT NULL,
-	"cvs_checkouts" integer DEFAULT '0' NOT NULL,
-	"cvs_commits" integer DEFAULT '0' NOT NULL,
-	"cvs_adds" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_ftp_downloads" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"filerelease_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_http_downloads" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"filerelease_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_project" (
-	"month" integer DEFAULT '0' NOT NULL,
-	"week" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"group_ranking" integer DEFAULT '0' NOT NULL,
-	"group_metric" double precision DEFAULT '0.00000' NOT NULL,
-	"developers" integer DEFAULT '0' NOT NULL,
-	"file_releases" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL,
-	"site_views" integer DEFAULT '0' NOT NULL,
-	"subdomain_views" integer DEFAULT '0' NOT NULL,
-	"msg_posted" integer DEFAULT '0' NOT NULL,
-	"msg_uniq_auth" integer DEFAULT '0' NOT NULL,
-	"bugs_opened" integer DEFAULT '0' NOT NULL,
-	"bugs_closed" integer DEFAULT '0' NOT NULL,
-	"support_opened" integer DEFAULT '0' NOT NULL,
-	"support_closed" integer DEFAULT '0' NOT NULL,
-	"patches_opened" integer DEFAULT '0' NOT NULL,
-	"patches_closed" integer DEFAULT '0' NOT NULL,
-	"tasks_opened" integer DEFAULT '0' NOT NULL,
-	"tasks_closed" integer DEFAULT '0' NOT NULL,
-	"help_requests" integer DEFAULT '0' NOT NULL,
-	"cvs_checkouts" integer DEFAULT '0' NOT NULL,
-	"cvs_commits" integer DEFAULT '0' NOT NULL,
-	"cvs_adds" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_project_tmp" (
-	"month" integer DEFAULT '0' NOT NULL,
-	"week" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"group_ranking" integer DEFAULT '0' NOT NULL,
-	"group_metric" double precision DEFAULT '0.00000' NOT NULL,
-	"developers" integer DEFAULT '0' NOT NULL,
-	"file_releases" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL,
-	"site_views" integer DEFAULT '0' NOT NULL,
-	"subdomain_views" integer DEFAULT '0' NOT NULL,
-	"msg_posted" integer DEFAULT '0' NOT NULL,
-	"msg_uniq_auth" integer DEFAULT '0' NOT NULL,
-	"bugs_opened" integer DEFAULT '0' NOT NULL,
-	"bugs_closed" integer DEFAULT '0' NOT NULL,
-	"support_opened" integer DEFAULT '0' NOT NULL,
-	"support_closed" integer DEFAULT '0' NOT NULL,
-	"patches_opened" integer DEFAULT '0' NOT NULL,
-	"patches_closed" integer DEFAULT '0' NOT NULL,
-	"tasks_opened" integer DEFAULT '0' NOT NULL,
-	"tasks_closed" integer DEFAULT '0' NOT NULL,
-	"help_requests" integer DEFAULT '0' NOT NULL,
-	"cvs_checkouts" integer DEFAULT '0' NOT NULL,
-	"cvs_commits" integer DEFAULT '0' NOT NULL,
-	"cvs_adds" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "stats_site" (
-	"month" integer DEFAULT '0' NOT NULL,
-	"week" integer DEFAULT '0' NOT NULL,
-	"day" integer DEFAULT '0' NOT NULL,
-	"site_views" integer DEFAULT '0' NOT NULL,
-	"subdomain_views" integer DEFAULT '0' NOT NULL,
-	"downloads" integer DEFAULT '0' NOT NULL,
-	"uniq_users" integer DEFAULT '0' NOT NULL,
-	"sessions" integer DEFAULT '0' NOT NULL,
-	"total_users" integer DEFAULT '0' NOT NULL,
-	"new_users" integer DEFAULT '0' NOT NULL,
-	"new_projects" integer DEFAULT '0' NOT NULL
-);
-CREATE SEQUENCE "support_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support" (
-	"support_id" integer DEFAULT nextval('support_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"support_status_id" integer DEFAULT '0' NOT NULL,
-	"support_category_id" integer DEFAULT '0' NOT NULL,
-	"priority" integer DEFAULT '0' NOT NULL,
-	"submitted_by" integer DEFAULT '0' NOT NULL,
-	"assigned_to" integer DEFAULT '0' NOT NULL,
-	"open_date" integer DEFAULT '0' NOT NULL,
-	"summary" text,
-	"close_date" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("support_id")
-);
-CREATE SEQUENCE "support_canned_responses_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support_canned_responses" (
-	"support_canned_id" integer DEFAULT nextval('support_canned_responses_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"title" text,
-	"body" text,
-	PRIMARY KEY ("support_canned_id")
-);
-CREATE SEQUENCE "support_category_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support_category" (
-	"support_category_id" integer DEFAULT nextval('support_category_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"category_name" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("support_category_id")
-);
-CREATE SEQUENCE "support_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support_history" (
-	"support_history_id" integer DEFAULT nextval('support_history_pk_seq'::text) NOT NULL,
-	"support_id" integer DEFAULT '0' NOT NULL,
-	"field_name" text DEFAULT '' NOT NULL,
-	"old_value" text DEFAULT '' NOT NULL,
-	"mod_by" integer DEFAULT '0' NOT NULL,
-	"date" integer,
-	PRIMARY KEY ("support_history_id")
-);
-CREATE SEQUENCE "support_messages_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support_messages" (
-	"support_message_id" integer DEFAULT nextval('support_messages_pk_seq'::text) NOT NULL,
-	"support_id" integer DEFAULT '0' NOT NULL,
-	"from_email" text,
-	"date" integer DEFAULT '0' NOT NULL,
-	"body" text,
-	PRIMARY KEY ("support_message_id")
-);
-CREATE SEQUENCE "support_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "support_status" (
-	"support_status_id" integer DEFAULT nextval('support_status_pk_seq'::text) NOT NULL,
-	"status_name" text,
-	PRIMARY KEY ("support_status_id")
-);
-CREATE SEQUENCE "supported_languages_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "supported_languages" (
-	"language_id" integer DEFAULT nextval('supported_languages_pk_seq'::text) NOT NULL,
-	"name" text,
-	"filename" text,
-	"classname" text,
-	"language_code" character(2),
-	PRIMARY KEY ("language_id")
-);
-CREATE SEQUENCE "survey_question_types_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "survey_question_types" (
-	"id" integer DEFAULT nextval('survey_question_types_pk_seq'::text) NOT NULL,
-	"type" text DEFAULT '' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "survey_questions_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "survey_questions" (
-	"question_id" integer DEFAULT nextval('survey_questions_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"question" text DEFAULT '' NOT NULL,
-	"question_type" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("question_id")
-);
-CREATE TABLE "survey_rating_aggregate" (
-	"type" integer DEFAULT '0' NOT NULL,
-	"id" integer DEFAULT '0' NOT NULL,
-	"response" double precision DEFAULT '0' NOT NULL,
-	"count" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "survey_rating_response" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"type" integer DEFAULT '0' NOT NULL,
-	"id" integer DEFAULT '0' NOT NULL,
-	"response" integer DEFAULT '0' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "survey_responses" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"survey_id" integer DEFAULT '0' NOT NULL,
-	"question_id" integer DEFAULT '0' NOT NULL,
-	"response" text DEFAULT '' NOT NULL,
-	"date" integer DEFAULT '0' NOT NULL
-);
-CREATE SEQUENCE "surveys_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "surveys" (
-	"survey_id" integer DEFAULT nextval('surveys_pk_seq'::text) NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"survey_title" text DEFAULT '' NOT NULL,
-	"survey_questions" text DEFAULT '' NOT NULL,
-	"is_active" integer DEFAULT '1' NOT NULL,
-	PRIMARY KEY ("survey_id")
-);
-CREATE SEQUENCE "system_history_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE SEQUENCE "system_machines_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE SEQUENCE "system_news_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE SEQUENCE "system_services_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE SEQUENCE "system_status_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "theme_prefs" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"user_theme" integer DEFAULT '0' NOT NULL,
-	"body_font" character(80) DEFAULT '',
-	"body_size" character(5) DEFAULT '',
-	"titlebar_font" character(80) DEFAULT '',
-	"titlebar_size" character(5) DEFAULT '',
-	"color_titlebar_back" character(7) DEFAULT '',
-	"color_ltback1" character(7) DEFAULT '',
-	PRIMARY KEY ("user_id")
-);
-CREATE SEQUENCE "themes_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "themes" (
-	"theme_id" integer DEFAULT nextval('themes_pk_seq'::text) NOT NULL,
-	"dirname" character varying(80),
-	"fullname" character varying(80),
-	PRIMARY KEY ("theme_id")
-);
-CREATE TABLE "tmp_projs_releases_tmp" (
-	"year" integer DEFAULT '0' NOT NULL,
-	"month" integer DEFAULT '0' NOT NULL,
-	"total_proj" integer DEFAULT '0' NOT NULL,
-	"total_releases" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "top_group" (
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"group_name" character varying(40),
-	"downloads_all" integer DEFAULT '0' NOT NULL,
-	"rank_downloads_all" integer DEFAULT '0' NOT NULL,
-	"rank_downloads_all_old" integer DEFAULT '0' NOT NULL,
-	"downloads_week" integer DEFAULT '0' NOT NULL,
-	"rank_downloads_week" integer DEFAULT '0' NOT NULL,
-	"rank_downloads_week_old" integer DEFAULT '0' NOT NULL,
-	"userrank" integer DEFAULT '0' NOT NULL,
-	"rank_userrank" integer DEFAULT '0' NOT NULL,
-	"rank_userrank_old" integer DEFAULT '0' NOT NULL,
-	"forumposts_week" integer DEFAULT '0' NOT NULL,
-	"rank_forumposts_week" integer DEFAULT '0' NOT NULL,
-	"rank_forumposts_week_old" integer DEFAULT '0' NOT NULL,
-	"pageviews_proj" integer DEFAULT '0' NOT NULL,
-	"rank_pageviews_proj" integer DEFAULT '0' NOT NULL,
-	"rank_pageviews_proj_old" integer DEFAULT '0' NOT NULL
-);
-CREATE SEQUENCE "trove_cat_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "trove_cat" (
-	"trove_cat_id" integer DEFAULT nextval('trove_cat_pk_seq'::text) NOT NULL,
-	"version" integer DEFAULT '0' NOT NULL,
-	"parent" integer DEFAULT '0' NOT NULL,
-	"root_parent" integer DEFAULT '0' NOT NULL,
-	"shortname" character varying(80),
-	"fullname" character varying(80),
-	"description" character varying(255),
-	"count_subcat" integer DEFAULT '0' NOT NULL,
-	"count_subproj" integer DEFAULT '0' NOT NULL,
-	"fullpath" text DEFAULT '' NOT NULL,
-	"fullpath_ids" text,
-	PRIMARY KEY ("trove_cat_id")
-);
-CREATE SEQUENCE "trove_group_link_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "trove_group_link" (
-	"trove_group_id" integer DEFAULT nextval('trove_group_link_pk_seq'::text) NOT NULL,
-	"trove_cat_id" integer DEFAULT '0' NOT NULL,
-	"trove_cat_version" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"trove_cat_root" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("trove_group_id")
-);
-CREATE SEQUENCE "trove_treesums_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "trove_treesums" (
-	"trove_treesums_id" integer DEFAULT nextval('trove_treesums_pk_seq'::text) NOT NULL,
-	"trove_cat_id" integer DEFAULT '0' NOT NULL,
-	"limit_1" integer DEFAULT '0' NOT NULL,
-	"subprojects" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("trove_treesums_id")
-);
-CREATE SEQUENCE "user_bookmarks_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_bookmarks" (
-	"bookmark_id" integer DEFAULT nextval('user_bookmarks_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"bookmark_url" text,
-	"bookmark_title" text,
-	PRIMARY KEY ("bookmark_id")
-);
-CREATE SEQUENCE "user_diary_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_diary" (
-	"id" integer DEFAULT nextval('user_diary_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"date_posted" integer DEFAULT '0' NOT NULL,
-	"summary" text,
-	"details" text,
-	"is_public" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("id")
-);
-CREATE SEQUENCE "user_diary_monitor_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_diary_monitor" (
-	"monitor_id" integer DEFAULT nextval('user_diary_monitor_pk_seq'::text) NOT NULL,
-	"monitored_user" integer DEFAULT '0' NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("monitor_id")
-);
-CREATE SEQUENCE "user_group_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_group" (
-	"user_group_id" integer DEFAULT nextval('user_group_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"admin_flags" character(16) DEFAULT '' NOT NULL,
-	"bug_flags" integer DEFAULT '0' NOT NULL,
-	"forum_flags" integer DEFAULT '0' NOT NULL,
-	"project_flags" integer DEFAULT '2' NOT NULL,
-	"patch_flags" integer DEFAULT '1' NOT NULL,
-	"support_flags" integer DEFAULT '1' NOT NULL,
-	"doc_flags" integer DEFAULT '0' NOT NULL,
-	"cvs_flags" integer DEFAULT '1' NOT NULL,
-	"member_role" integer DEFAULT '100' NOT NULL,
-	"release_flags" integer DEFAULT '0' NOT NULL,
-	PRIMARY KEY ("user_group_id")
-);
-CREATE SEQUENCE "user_metric_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_metric" (
-	"ranking" integer DEFAULT nextval('user_metric_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"times_ranked" integer DEFAULT '0' NOT NULL,
-	"avg_raters_importance" double precision DEFAULT '0.00000000' NOT NULL,
-	"avg_rating" double precision DEFAULT '0.00000000' NOT NULL,
-	"metric" double precision DEFAULT '0.00000000' NOT NULL,
-	"percentile" double precision DEFAULT '0.00000000' NOT NULL,
-	"importance_factor" double precision DEFAULT '0.00000000' NOT NULL,
-	PRIMARY KEY ("ranking")
-);
-CREATE SEQUENCE "user_metric0_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "user_metric0" (
-	"ranking" integer DEFAULT nextval('user_metric0_pk_seq'::text) NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"times_ranked" integer DEFAULT '0' NOT NULL,
-	"avg_raters_importance" double precision DEFAULT '0.00000000' NOT NULL,
-	"avg_rating" double precision DEFAULT '0.00000000' NOT NULL,
-	"metric" double precision DEFAULT '0.00000000' NOT NULL,
-	"percentile" double precision DEFAULT '0.00000000' NOT NULL,
-	"importance_factor" double precision DEFAULT '0.00000000' NOT NULL,
-	PRIMARY KEY ("ranking")
-);
-CREATE TABLE "user_preferences" (
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"preference_name" character varying(20),
-	"preference_value" character varying(20),
-	"set_date" integer DEFAULT '0' NOT NULL
-);
-CREATE TABLE "user_ratings" (
-	"rated_by" integer DEFAULT '0' NOT NULL,
-	"user_id" integer DEFAULT '0' NOT NULL,
-	"rate_field" integer DEFAULT '0' NOT NULL,
-	"rating" integer DEFAULT '0' NOT NULL
-);
-CREATE SEQUENCE "users_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "users" (
-	"user_id" integer DEFAULT nextval('users_pk_seq'::text) NOT NULL,
-	"user_name" text DEFAULT '' NOT NULL,
-	"email" text DEFAULT '' NOT NULL,
-	"user_pw" character varying(32) DEFAULT '' NOT NULL,
-	"realname" character varying(32) DEFAULT '' NOT NULL,
-	"status" character(1) DEFAULT 'A' NOT NULL,
-	"shell" character varying(20) DEFAULT '/bin/bash' NOT NULL,
-	"unix_pw" character varying(40) DEFAULT '' NOT NULL,
-	"unix_status" character(1) DEFAULT 'N' NOT NULL,
-	"unix_uid" integer DEFAULT '0' NOT NULL,
-	"unix_box" character varying(10) DEFAULT 'shell1' NOT NULL,
-	"add_date" integer DEFAULT '0' NOT NULL,
-	"confirm_hash" character varying(32),
-	"mail_siteupdates" integer DEFAULT '0' NOT NULL,
-	"mail_va" integer DEFAULT '0' NOT NULL,
-	"authorized_keys" text,
-	"email_new" text,
-	"people_view_skills" integer DEFAULT '0' NOT NULL,
-	"people_resume" text DEFAULT '' NOT NULL,
-	"timezone" character varying(64) DEFAULT 'GMT',
-	"language" integer DEFAULT '1' NOT NULL,
-	PRIMARY KEY ("user_id")
-);
-CREATE SEQUENCE "unix_uid_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE SEQUENCE "forum_thread_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "trove_agg" (
-	"trove_cat_id" integer,
-	"group_id" integer,
-	"group_name" character varying(40),
-	"unix_group_name" character varying(30),
-	"status" character(1),
-	"register_time" integer,
-	"short_description" character varying(255),
-	"percentile" double precision,
-	"ranking" integer
-);
-CREATE TABLE "activity_log" (
-	"day" integer DEFAULT '0' NOT NULL,
-	"hour" integer DEFAULT '0' NOT NULL,
-	"group_id" integer DEFAULT '0' NOT NULL,
-	"browser" character varying(8) DEFAULT 'OTHER' NOT NULL,
-	"ver" double precision DEFAULT '0.00' NOT NULL,
-	"platform" character varying(8) DEFAULT 'OTHER' NOT NULL,
-	"time" integer DEFAULT '0' NOT NULL,
-	"page" text,
-	"type" integer DEFAULT '0' NOT NULL
-);
diff --git a/src/deb-specific/unregister-theme b/src/deb-specific/unregister-theme
index dda4528..529d42c 100755
--- a/src/deb-specific/unregister-theme
+++ b/src/deb-specific/unregister-theme
@@ -10,13 +10,16 @@ use vars qw/$dbh @reqlist $thdir/ ;
 
 sub debug ( $ ) ;
 
-require ("/usr/share/gforge/lib/include.pl") ; # Include all the predefined functions 
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 &db_connect ;
 
 if ($#ARGV < 0) {
     debug "Usage: unregister-theme <dirname>" ;
-    debug "The theme must be in /usr/share/gforge/www/themes/<dirname>/" ;
+    debug "The theme must be in $source_path/www/themes/<dirname>/" ;
     exit 1 ;
 }
 
diff --git a/src/deb-specific/update-user-group-ssh.sh b/src/deb-specific/update-user-group-ssh.sh
index 7f57227..59dd2f2 100755
--- a/src/deb-specific/update-user-group-ssh.sh
+++ b/src/deb-specific/update-user-group-ssh.sh
@@ -12,31 +12,13 @@ else
     lockfile-touch $LOCK &
     LOCKPID=$!
     trap "kill $LOCKPID ; lockfile-remove $LOCK" exit
-        
-	# Fill ldap tables
-	# Should be safe to comment this soon
-	# Be sure the system user are created before creating homes
-	# when using nss-ldap
-#	[ -x /usr/share/gforge/bin/install-ldap.sh ] && \
-#		/usr/share/gforge/bin/install-ldap.sh update > /dev/null 2>&1
 
-	[ -d /var/lib/gforge/dumps ] || \
-	mkdir /var/lib/gforge/dumps && \
-	chown gforge:gforge /var/lib/gforge/dumps
+	[ -d $(forge_get_config data_path)/dumps ] || \
+	mkdir $(forge_get_config data_path)/dumps && \
+	chown gforge:gforge $(forge_get_config data_path)/dumps
 
-	/usr/share/gforge/bin/user_dump_update.pl
-	/usr/share/gforge/bin/group_dump_update.pl
-	/usr/share/gforge/bin/ssh_dump_update.pl
-	/usr/share/gforge/bin/mailfwd_update.pl
-	#[ -f /usr/share/gforge/bin/cvs_dump.pl ] && su -s /bin/sh gforge -c /usr/share/gforge/bin/cvs_dump.pl || true
-	#[ -f /usr/share/gforge/bin/cvs_update.pl ] && /usr/share/gforge/bin/cvs_update.pl || true
-
-	#CB#su gforge -c /usr/share/gforge/bin/dump_database.pl -s /bin/sh
-	#CB#su gforge -c /usr/share/gforge/bin/ssh_dump.pl -s /bin/sh
-
-	# Create user, groups and cvs archives
-	#CB#/usr/share/gforge/bin/new_parse.pl
-
-	# Fill ssh authorized_keys
-	#CB#/usr/share/gforge/bin/ssh_create.pl
+	$(forge_get_config binary_path)/user_dump_update.pl
+	$(forge_get_config binary_path)/group_dump_update.pl
+	$(forge_get_config binary_path)/ssh_dump_update.pl
+	$(forge_get_config binary_path)/mailfwd_update.pl
 fi
diff --git a/src/deb-specific/user_dump_update.pl b/src/deb-specific/user_dump_update.pl
index 90107ae..b8ced5f 100755
--- a/src/deb-specific/user_dump_update.pl
+++ b/src/deb-specific/user_dump_update.pl
@@ -4,7 +4,10 @@
 #		     scripts can process it without needing to access the database.
 use DBI;
 
-require("/usr/share/gforge/lib/include.pl");  # Include all the predefined functions
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+require ("$source_path/lib/include.pl") ; # Include all the predefined functions 
 
 # Run as gforge
 my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwnam("gforge");
@@ -50,7 +53,7 @@ while ($ln = pop(@userdump_array)) {
 	chop($ln);
 	($uid, $gid, $status, $username, $shell, $passwd, $realname) = split(":", $ln);
 	$username =~ tr/A-Z/a-z/;
-	$user_exists = (-d $homedir_prefix .'/'. $username || -f "/var/lib/gforge/tmp/$username.tar.gz");
+	$user_exists = (-d $homedir_prefix .'/'. $username || -f (forge_get_config("data_path")."/tmp/$username.tar.gz"));
 	
 	if ($status eq 'A' && $user_exists) {
 		update_user($uid, $gid, $username, $realname, $shell, $passwd);
@@ -194,15 +197,16 @@ sub update_user {
 #############################
 sub delete_user {
 	my $username = shift(@_);
-	
-	my $alreadydone=(-f "/var/lib/gforge/tmp/$username.tar.gz");
+	my $data_path = forge_get_config("data_path");
+	my $alreadydone=(-f "$data_path/tmp/$username.tar.gz");
 	if (!$alreadydone) {
 		my $oldmask = umask(077);
 		if ($verbose) {
 			print("Deleting User : $username\n");
 		}
-		run_verbose("/bin/mv /var/lib/gforge/chroot/home/users/$username /var/lib/gforge/chroot/home/users/deleted_$username");
-		run_verbose("cd / && /bin/tar -cf - /var/lib/gforge/chroot/home/users/deleted_$username | /bin/gzip -n9 >/var/lib/gforge/tmp/$username.tar.gz && /bin/rm -rf /var/lib/gforge/chroot/home/users/deleted_$username");
+		my $chroot = forge_get_config("chroot");
+		run_verbose("/bin/mv $chroot/home/users/$username $chroot/home/users/deleted_$username");
+		run_verbose("cd / && /bin/tar -cf - $chroot/home/users/deleted_$username | /bin/gzip -n9 > $data_path/tmp/$username.tar.gz && /bin/rm -rf $chroot/home/users/deleted_$username");
 		umask($oldmask);
 	}
 }

commit 848166f2acb32c293f28633929b7b08fae96a379
Author: Roland Mas <lolando at debian.org>
Date:   Thu Jul 31 14:40:15 2014 +0200

    More replacements of hardcoded paths

diff --git a/src/plugins/forumml/bin/mail_2_DB.pl b/src/plugins/forumml/bin/mail_2_DB.pl
index 33528db..ba00590 100755
--- a/src/plugins/forumml/bin/mail_2_DB.pl
+++ b/src/plugins/forumml/bin/mail_2_DB.pl
@@ -41,15 +41,27 @@ use strict;
 # Set default path (required by taint mode)
 $ENV{'PATH'} = '/usr/bin:/bin';
 
+my $plugins_path = `forge_get_config plugins_path`;
+chomp $plugins_path;
+
+my $config_path = `forge_get_config config_path`;
+chomp $config_path;
+
+my $source_path = `forge_get_config source_path`;
+chomp $source_path;
+
+my $log_path = `forge_get_config log_path`;
+chomp $log_path;
+
 # Hook log file
-my $logfile = "/var/log/gforge/forumml/hook.log";
+my $logfile = "$log_path/forumml/hook.log";
 
 # Redirect outputs
 open STDOUT, ">>", $logfile or die "cannot append to '$logfile': $!\n";
 open STDERR, ">&STDOUT" or die "cannot append STDERR to STDOUT: $!\n";
 
 # Search if there are lists we shouldn't treat
-my $conf = '/etc/codendi/plugins/forumml/etc/forumml.inc';
+my $conf = "$config_path/plugins/forumml/etc/forumml.inc";
 if (-f $conf) {
     # Get the variable defined in forumml.inc
     my @exc_lists;
@@ -89,7 +101,7 @@ close(OUT);
 
 # Get PHP_PARAMS variable from php-laucher.sh
 my $PHP_PARAMS="";
-open(PHP_LAUNCHER, "</usr/share/codendi/src/utils/php-launcher.sh");
+open(PHP_LAUNCHER, "<$source_path/src/utils/php-launcher.sh");
 while (<PHP_LAUNCHER>) {
     if (m/^[ ]*PHP_PARAMS="(.*)"$/) {
 	$PHP_PARAMS=$1;
@@ -99,7 +111,7 @@ while (<PHP_LAUNCHER>) {
 close(PHP_LAUNCHER);
 
 # store mail in ForumML DB
-exec "/usr/bin/php $PHP_PARAMS /usr/share/codendi/plugins/forumml/bin/mail_2_DB.php $listname 1 $temp";
+exec "/usr/bin/php $PHP_PARAMS $plugins_path/forumml/bin/mail_2_DB.php $listname 1 $temp";
 
 close STDOUT;
 close STDERR;
diff --git a/src/plugins/forumml/bin/mail_2_DBFF.pl b/src/plugins/forumml/bin/mail_2_DBFF.pl
index b4a71ca..f98c2f0 100755
--- a/src/plugins/forumml/bin/mail_2_DBFF.pl
+++ b/src/plugins/forumml/bin/mail_2_DBFF.pl
@@ -47,10 +47,13 @@ chomp $config_path;
 my $source_path = `forge_get_config source_path`;
 chomp $source_path;
 
+my $log_path = `forge_get_config log_path`;
+chomp $log_path;
+
 # Set default path (required by taint mode)
 $ENV{'PATH'} = '/usr/bin:/bin';
 # Hook log file
-my $logfile = "/var/log/gforge/forumml/hook.log";
+my $logfile = "$log_path/forumml/hook.log";
 
 # Redirect outputs
 open STDOUT, ">>", $logfile or die "cannot append to '$logfile': $!\n";

-----------------------------------------------------------------------

Summary of changes:
 src/deb-specific/create-vhosts.sh           |    2 +-
 src/deb-specific/db-convert-to-unicode.pl   |    7 +-
 src/deb-specific/dns_conf.pl                |    5 +-
 src/deb-specific/dsf-helper.pl              |    2 +-
 src/deb-specific/fix-mailing-lists.pl       |    5 +-
 src/deb-specific/fusionforge.rsyslog        |    2 +-
 src/deb-specific/gforge-inject.pl           |    6 +-
 src/deb-specific/group_dump_update.pl       |  276 -------
 src/deb-specific/install-chroot.sh          |   22 +-
 src/deb-specific/install-db.sh              |    8 +-
 src/deb-specific/install-dns.sh             |   21 +-
 src/deb-specific/install-exim.sh            |   12 +-
 src/deb-specific/install-exim4.sh           |   11 +-
 src/deb-specific/install-ftp.sh             |   10 +-
 src/deb-specific/install-ldap.sh            |    8 +-
 src/deb-specific/install-postfix.sh         |   46 +-
 src/deb-specific/install-ssh.sh             |   24 +-
 src/deb-specific/mailfwd_update.pl          |    6 +-
 src/deb-specific/manage-uufiles.sh          |   26 -
 src/deb-specific/old-db-upgrade.pl          |   20 +-
 src/deb-specific/prepare-vhosts-file.pl     |   14 +-
 src/deb-specific/register-theme             |   15 +-
 src/deb-specific/sf-add-skill               |    5 +-
 src/deb-specific/sf-proftpd.conf            |    2 +-
 src/deb-specific/ssh_dump_update.pl         |  165 ----
 src/deb-specific/stats_cvs.pl               |    9 +-
 src/deb-specific/stats_projects_logparse.pl |    6 +-
 src/deb-specific/tmp-sf.sql                 | 1094 ---------------------------
 src/deb-specific/unregister-theme           |    7 +-
 src/deb-specific/update-user-group-ssh.sh   |   32 +-
 src/deb-specific/user_dump_update.pl        |   16 +-
 src/plugins/forumml/bin/mail_2_DB.pl        |   20 +-
 src/plugins/forumml/bin/mail_2_DBFF.pl      |    5 +-
 33 files changed, 207 insertions(+), 1702 deletions(-)
 delete mode 100755 src/deb-specific/group_dump_update.pl
 delete mode 100755 src/deb-specific/manage-uufiles.sh
 delete mode 100755 src/deb-specific/ssh_dump_update.pl
 delete mode 100644 src/deb-specific/tmp-sf.sql


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list