Index: /0.8.1/pb/contrib/pbsetupqemu
===================================================================
--- /0.8.1/pb/contrib/pbsetupqemu	(revision 191)
+++ /0.8.1/pb/contrib/pbsetupqemu	(revision 191)
@@ -0,0 +1,170 @@
+#!/usr/bin/perl -w
+
+# Script to be used as pbscript to create a potentialy 
+# missing pb account on the QEMU VM, and adds it to sudo
+
+# Needs to be extented with the pb Distribution.pm module at the end externally
+# 
+# Needs to use root account to connect to the VM
+
+# You need to specify here your local public SSH key used to access
+# the pb account in the VM later on
+
+use strict;
+use File::Basename;
+
+my $file = "/tmp/pbkey";
+
+open(PBFILE,"> $file") || die "Unable to open $file";
+print PBFILE "ssh-dss AAAAB3NzaC1kc3MAAACBAMC06bNLMu8ZBJv3Hi77+fi+GUhtQScIbGKru86C/IP27EjrmYhPVccbu8kpX6SDHIouhpZ00gaefP3zHjLUmPKlXkMNUNjxx5JNLPoHhSIuUvoSTNoh9gsi31abAvzbW+RNer7rvBJO4ytNJRdsuNxBwqjxK04JEmatds+aKTQjAAAAFQDHaNmIuvYZ0RtNBVe+tzTzxxCQmQAAAIA4o89Xob2VBRtQKBjmWVAuTS14qiqnQUPNloaRkM+r2odI+NJDFc+WXOIG9QAPKKt1jvFOBOX9Mu3/xwiDLnAGhxud98FoyHevSpIWUld7rG4j1aww1WxolFWY/iPyAvDDMW3iysCoqQeSOlpRd9Mz/dq6/P/VcizhdGOKyc3JBgAAAIAA1eY+BoneiQ/tQ8j3GYbMTu6U7VzZ2OaoVeQn4NtZmPl+ZeQIj83nFpo99mYCbaBPqnZToERndl+ljp/JX5pamwj6RcLIDCyiB6MXLbQSWj0goegU1htp5aMd3NcyR2Jy8gCnf0QjDr7j23Q+CFGExtRb/nsDmaG5W9D6QSWQ/g== bruno\@victoria\n";
+close(PBFILE);
+chmod 0644,$file;
+
+$file="/etc/passwd";
+open(PBFILE,$file) || die "Unable to open $file";
+my $found = 0;
+while (<PBFILE>) {
+	$found = 1 if (/^pb:/);
+}
+close(PBFILE);
+
+if ( $found == 0 ) {
+	if ( ! -d "/home" ) {
+		mkdir "/home";
+	}
+	system "groupadd pb";
+	system "useradd pb -g pb -m -d /home/pb";
+}
+
+chdir "/home/pb";
+mkdir ".ssh",0700;
+system 'cp /tmp/pbkey .ssh/authorized_keys';
+chmod 0600,".ssh/authorized_keys";
+system 'chown -R pb:pb .ssh';
+
+# No passwd for pb only keys
+$file="/etc/shadow";
+open(PBFILE,$file) || die "Unable to open $file";
+open(PBOUT,"> $file.new") || die "Unable to open $file.new";
+while (<PBFILE>) {
+	s/^pb:\!\!:/pb:*:/;
+	s/^pb:\!:/pb:*:/;	#SLES 9 e.g.
+	print PBOUT $_;
+}
+close(PBFILE);
+close(PBOUT);
+rename("$file.new",$file);
+chmod 0640,$file;
+
+# Adapt sudoers
+$file="/etc/sudoers";
+$found = 0;
+open(PBFILE,$file) || die "Unable to open $file";
+open(PBOUT,"> $file.new") || die "Unable to open $file.new";
+while (<PBFILE>) {
+	$found = 1 if (/^pb   /);
+	s/Defaults[ \t]+requiretty//;
+	print PBOUT $_;
+}
+close(PBFILE);
+print PBOUT "pb   ALL=(ALL) NOPASSWD:ALL\n" if ( $found == 0 );
+close(PBOUT);
+rename("$file.new",$file);
+chmod 0440,$file;
+
+unlink "/tmp/pbkey";
+
+my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init(); 
+print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n";
+
+# Get and install pb
+if ( $ddir eq "fedora" ) {
+	system "yum clean all";
+	system "yum update -y";
+	my $arch=`uname -m`;
+	my $opt = "";
+	chomp($arch);
+	if ($arch eq "x86_64") {
+		$opt="--exclude=*.i?86";
+	}
+
+	my $topbuilddir=`rpmquery --eval '%{_topdir}' 2> /dev/null`;
+	chomp($topbuilddir);
+
+	my $p = `rpm -q afio`;
+	chomp($p);
+	if ($p !~ /^afio/) {
+		system "rm -f afio-* ; wget ftp://ftp.mondorescue.org/src/afio-2.4.7-1.src.rpm ; rpm -ivh afio-2.4.7-1.src.rpm ; rpmbuild -ba $topbuilddir/SPECS/afio.spec ; chmod 644 $topbuilddir/RPMS/*/*.rpm";
+	}
+	$p = `rpm -q buffer`;
+	chomp($p);
+	if ($p !~ /^buffer/) {
+		system "rm -f buffer-* ; wget ftp://ftp.mondorescue.org/src/buffer-1.19-1.src.rpm ; rpm -ivh buffer-1.19-1.src.rpm ; rpmbuild -ba $topbuilddir/SPECS/buffer.spec ; chmod 644 $topbuilddir/RPMS/*/*.rpm";
+	}
+	if ( $dver <= 4 ) {
+		# FC4 - AppConfig unavailable
+		system "yum -y $opt install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs perl-DateManip ntp ; rm -rf AppConfig-* ; wget http://search.cpan.org/CPAN/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz ; tar xvfz AppConfig-1.66.tar.gz ; cd AppConfig* ; perl Makefile.PL ; make ; make install ; cd ..";
+	} else {
+		# FC5/6/7
+		system "yum -y $opt install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs ntp perl-AppConfig perl-DateManip";
+	}
+} elsif (( $dfam eq "rh" ) || ($ddir eq "sles") || (($ddir eq "suse") && (($dver eq "10.1") || ($dver eq "10.0"))) || (($ddir eq "mandrake") && ($dver eq "10.1"))) {
+	# Suppose pkg are installed already
+	system "rpm -e lsb";
+	system "rm -rf AppConfig-* ; wget http://search.cpan.org/CPAN/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz ; tar xvfz AppConfig-1.66.tar.gz ; cd AppConfig* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf DateManip* ; wget http://search.cpan.org/CPAN/authors/id/S/SB/SBECK/Date-Manip-5.46.tar.gz ; tar xvfz Date-Manip-5.46.tar.gz ; cd Date-Manip* ; perl Makefile.PL ; make ; make install ; cd .. ";
+} elsif ($ddir eq "suse") { 
+	# New OpenSuSE
+	system "export TERM=linux ; liste=\"\" ; for i in neon newt-devel slang-devel autoconf automake libtool gcc wget gcc-c++ docbook-utils ImageMagick man patch mkisofs perl-DateManip perl-AppConfig perl-File-HomeDir xntp; do rpm -q \$i 1> /dev/null 2> /dev/null ; if [ \$\? != 0 ]; then liste=\"\$liste \$i\"; fi; done; echo \"Liste: \$liste\" ; if [ \"\$liste\" != \"\" ]; then yast2 -i \$liste ; fi";
+} elsif ( $dfam eq "md" ) {
+	if (( $dver eq "2006.0" ) || ( $dver eq "10.2" )) {
+		# mondo not available
+		system "urpmi.update -a ; urpmi --auto neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch mkisofs cdrecord ntp-client perl-AppConfig perl-DateManip";
+	} else {
+		system "urpmi.update -a ; urpmi --auto neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch mondo mkisofs cdrecord ntp-client perl-AppConfig perl-DateManip";
+	}
+} elsif ( $dfam eq "du" ) {
+	system "apt-get update; apt-get -y install autoconf automake libtool g++ wget patch mondo groff imagemagick docbook-utils docbook2x docbook-to-man openssh-server dpkg-dev debian-builder dh-make fakeroot libnewt-dev ntpdate libncurses5-dev libdate-manip-perl libappconfig-perl";
+} elsif ( $dfam eq "gen" ) {
+	system "emerge neon newt slang autoconf automake subversion libtool gcc wget vim man groff lynx grub afio buffer mindi mondo-rescue cdrecord mkisofs ntp-client";
+} else {
+	print "No pkg to install\n";
+}
+
+# Sync date
+system "/usr/sbin/ntpdate ntp.home.musique-ancienne.org";
+
+# Patch AppConfig 
+my $module=`find /usr/*/perl5 -type f -name File.pm | grep AppConfig/File.pm`;
+chomp($module);
+$found = 0;
+open(PBFILE,$module) || die "Unable to open $module";
+while (<PBFILE>) {
+	$found = 1 if (/Fix a bug if the variable is a hash/);
+}
+close(PBFILE);
+
+if ( $found == 0 ) {
+	chdir basename($module);
+	open(PBFILE,$module) || die "Unable to open $module";
+	my $module1 = $module."new";
+	open(PBOUT," > $module1") || die "Unable to open $module1";
+	while (<PBFILE>) {
+			s/^use AppConfig;/use AppConfig qw(:argcount);/;
+			if (/# variables prefixed '-' are reset to their default values/) {
+print PBOUT << 'EOF';
+                 # Fix a bug if the variable is a hash - 1 has been created as a key
+                 if ($nargs eq AppConfig::ARGCOUNT_HASH) {
+                     delete $state->{ VARIABLE }->{ $variable }{1};
+                 }
+
+EOF
+			}
+			print PBOUT "$_";
+	}
+	close(PBFILE);
+	close(PBOUT);
+	rename($module1,$module);
+}
+
+system "rm -rf project-builder-* ; wget ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz ; tar xvfz project-builder-latest.tar.gz ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd ..";
+
Index: /0.8.1/pb/AUTHORS
===================================================================
--- /0.8.1/pb/AUTHORS	(revision 15)
+++ /0.8.1/pb/AUTHORS	(revision 15)
@@ -0,0 +1,2 @@
+Project Builder or pb is copyrighted under the GPL v2 by 
+Bruno Cornec <bruno@hyper-linux.org>
Index: /0.8.1/pb/INSTALL
===================================================================
--- /0.8.1/pb/INSTALL	(revision 15)
+++ /0.8.1/pb/INSTALL	(revision 15)
@@ -0,0 +1,7 @@
+Basic Installation
+==================
+
+tar xvfz pb-1.0.tar.gz
+cd pb-1.0
+make 
+make install
Index: /0.8.1/pb/lib/ProjectBuilder/Version.pm
===================================================================
--- /0.8.1/pb/lib/ProjectBuilder/Version.pm	(revision 74)
+++ /0.8.1/pb/lib/ProjectBuilder/Version.pm	(revision 74)
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+#
+# Declare versions that will be used in pb
+# Those are filtered with pb mecanism
+# and have been isolated here to avoid unrelated effects
+#
+use strict;
+
+sub pb_version_init {
+
+my $projectbuilderver = "PBVER";
+my $projectbuilderrev = "PBREV";
+
+return($projectbuilderver,$projectbuilderrev);
+}
+1;
Index: /0.8.1/pb/lib/ProjectBuilder/Changelog.pm
===================================================================
--- /0.8.1/pb/lib/ProjectBuilder/Changelog.pm	(revision 194)
+++ /0.8.1/pb/lib/ProjectBuilder/Changelog.pm	(revision 194)
@@ -0,0 +1,114 @@
+#!/usr/bin/perl -w
+#
+# Creates changelog for packages from Changelog files in the apps
+#
+# $Id$
+#
+
+use strict;
+use Date::Manip;
+use File::Basename;
+use English;
+use ProjectBuilder::Base qw (pb_conf_get);
+
+sub pb_changelog {
+
+my $dtype = shift;
+my $pkg = shift;
+my $pbtag = shift;
+my $dsuf = shift;
+my $path = shift;
+my $OUTPUT = shift;
+
+my $log = "";
+
+# For date handling
+$ENV{LANG}="C";
+
+return("\n") if ((not (defined $dtype)) || ($dtype eq "") || 
+		(not (defined $pkg)) || ($pkg eq "") || 
+		(not (defined $pbtag)) || ($pbtag eq "") || 
+		(not (defined $dsuf)) || ($dsuf eq "") || 
+		(not (defined $path)) || ($path eq "") || 
+		(not (defined $OUTPUT)) || ($OUTPUT eq ""));
+
+my $chglog = "$ENV{'PBROOT'}/$path/ChangeLog";
+if (! -f $chglog) {
+	print "No ChangeLog file ($chglog) for $pkg\n";
+	return("\n");
+}
+
+open(INPUT,"$chglog") || die "Unable to open $chglog (read)";
+
+# Skip first 4 lines
+my $tmp = <INPUT>;
+$tmp = <INPUT>;
+$tmp = <INPUT>;
+if ($dtype eq "announce") {
+	print $OUTPUT $tmp;
+}
+$tmp = <INPUT>;
+if ($dtype eq "announce") {
+	print $OUTPUT $tmp;
+}
+
+my $first=1;
+
+# Handle each block separated by newline
+while (<INPUT>) {
+	my ($ver, $date) = split(/ /);
+	my $ver2;
+	$ver =~ s/^v//;
+	chomp($date);
+	$date =~ s/\(([0-9-]+)\)/$1/;
+	#print "**$date**\n";
+	my $ndate = UnixDate($date,"%a", "%b", "%d", "%Y");
+	my $n2date = &UnixDate($date,"%a, %d %b %Y %H:%M:%S %z");
+	#print "**$ndate**\n";
+	my ($packager) = pb_conf_get("packager");
+
+	if (($dtype eq "rpm") || ($dtype eq "fc")) {
+		if ($ver !~ /-/) {
+			if ($first eq 1) {
+				$ver2 = "$ver-$pbtag$dsuf";
+				$first=0;
+			} else {
+				$ver2 = "$ver-1$dsuf";
+			}
+		} else {
+			$ver2 = "$ver$dsuf";
+		}
+		print $OUTPUT "* $ndate $packager->{$ENV{'PBPROJ'}} $ver2\n";
+		print $OUTPUT "- Updated to $ver\n";
+		}
+	if ($dtype eq "deb") {
+		print $OUTPUT "$pkg ($ver) unstable; urgency=low\n";
+		print $OUTPUT "\n";
+		}
+
+	$tmp = <INPUT>;	
+	while ($tmp !~ /^$/) {
+		if ($dtype eq "deb") {
+			$tmp =~ s/^- //;
+			print $OUTPUT "  * $tmp";
+		} elsif ($dtype eq "rpm") {
+			print $OUTPUT "$tmp";
+		} else {
+			print $OUTPUT "$tmp";
+		}
+		last if (eof(INPUT));
+		$tmp = <INPUT>;
+	}
+	print $OUTPUT "\n";
+
+	if ($dtype eq "deb") {
+		# Cf: http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog
+		print $OUTPUT " -- $packager->{$ENV{'PBPROJ'}}  $n2date\n\n\n";
+		}
+
+	last if (eof(INPUT));
+	last if ($dtype eq "announce");
+}
+close(INPUT);
+}
+1;
Index: /0.8.1/pb/lib/ProjectBuilder/Base.pm
===================================================================
--- /0.8.1/pb/lib/ProjectBuilder/Base.pm	(revision 174)
+++ /0.8.1/pb/lib/ProjectBuilder/Base.pm	(revision 174)
@@ -0,0 +1,520 @@
+#!/usr/bin/perl -w
+#
+# Base subroutines for the Project-Builder project
+#
+# $Id$
+#
+
+use strict;
+use lib qw (lib);
+use File::Basename;
+use File::Path;
+use File::Temp qw /tempdir/;
+use AppConfig qw(ARGCOUNT_HASH);
+use Data::Dumper;
+
+$ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc";
+
+sub pb_env_init {
+
+my $proj=shift;
+my $ver;
+my $tag;
+
+# For the moment not dynamic
+my $debug = 0;					# Debug level
+my $LOG = *STDOUT;				# Where to log
+
+#
+# Check project name
+# Could be with env var PBPROJ
+# or option -p
+# if not define take the first in conf file
+#
+if ((defined $ENV{'PBPROJ'}) &&
+	(not (defined $proj))) {
+	$proj = $ENV{'PBPROJ'};
+}
+
+#
+# We get the pbrc file for that project 
+# and use its content
+#
+my ($pbrc) = pb_conf_read("$ENV{'PBETC'}","pbrc");
+print "DEBUG pbrc: ".Dumper($pbrc)."\n" if ($debug >= 1);
+
+my %pbrc = %$pbrc;
+if (not defined $proj) {
+	# Take the first as the default project
+	$proj = (keys %pbrc)[0];
+	print $LOG "Using $proj as default project as none has been specified\n" if (($debug >= 0) and (defined $proj));
+}
+die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj));
+
+#
+# Set delivery directory
+#
+my $topdir=dirname($pbrc{$proj});
+# Expand potential env variable in it
+eval { $topdir =~ s/(\$ENV.+\})/$1/eeg };
+chdir $topdir || die "Unable to change directory to $topdir";
+$pbrc{$proj} = $topdir."/pbrc";
+$ENV{'PBDESTDIR'}=$topdir."/delivery";
+
+#
+# Use project configuration file if needed
+#
+if (not defined $ENV{'PBROOT'}) {
+	if (-f $pbrc{$proj}) {
+		my ($pbroot) = pb_conf_read($pbrc{$proj},"pbroot");
+		my %pbroot = %$pbroot;
+		# All lines should point to the same pbroot so take the first
+		$ENV{'PBROOT'} = (values %$pbroot)[0] if (defined $pbroot); 
+		print $LOG "Using $ENV{'PBROOT'} as default pbroot from $pbrc{$proj}\n" if (($debug >= 0) and (defined $ENV{'PBROOT'}));
+	}
+	die "No pbroot defined - use env var PBROOT or -r pbroot " if (not defined $ENV{'PBROOT'});
+}
+
+#
+# Check pb conf compliance
+#
+$ENV{'PBCONF'} = "$ENV{'PBROOT'}/pbconf";
+die "Project $proj not Project-Builder compliant. Please populate $ENV{'PBCONF'}" if ( not -d "$ENV{'PBCONF'}");
+
+my %version = ();
+my %defpkgdir = ();
+my %extpkgdir = ();
+my %filteredfiles = ();
+
+if (-f "$ENV{'PBCONF'}/$proj.pb") {
+	# List of pkg to build by default (mandatory)
+	# List of additional pkg to build when all is called (optional)
+	# Valid version names (optional)
+	# List of files to filter (optional)
+	my ($defpkgdir, $extpkgdir, $version, $filteredfiles, $pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$proj.pb","defpkgdir","extpkgdir","version","filteredfiles","projver","projtag");
+	print "DEBUG: defpkgdir: ".Dumper($defpkgdir)."\n" if ($debug >= 1);
+	print "DEBUG: extpkgdir: ".Dumper($extpkgdir)."\n" if ($debug >= 1);
+	print "DEBUG: version: ".Dumper($version)."\n" if ($debug >= 1);
+	print "DEBUG: filteredfiles: ".Dumper($filteredfiles)."\n" if ($debug >= 1);
+	die "Unable to find defpkgdir in $ENV{'PBCONF'}/$proj.pb" if (not defined $defpkgdir);
+	# Global
+	%defpkgdir = %$defpkgdir;
+	# Global
+	%extpkgdir = %$extpkgdir if (defined $extpkgdir);
+	%version = %$version if (defined $version);
+	# Global
+	%filteredfiles = %$filteredfiles if (defined $filteredfiles);
+	#
+	# Get global Version/Tag
+	#
+
+	if (not defined $ENV{'PBVER'}) {
+		if ((defined $pkgv) && (defined $pkgv->{$proj})) {
+			$ENV{'PBVER'}=$pkgv->{$proj};
+		} else {
+			die "No projver found in $ENV{'PBCONF'}/$proj.pb";
+		}
+	}
+	die "Invalid version name $ENV{'PBVER'} in $ENV{'PBCONF'}/$proj.pb" if (($ENV{'PBVER'} !~ /[0-9.]+/) && (not exists $version{$ENV{'PBVER'}}));
+	
+	if (not defined $ENV{'PBTAG'}) {
+		if ((defined $pkgt) && (defined $pkgt->{$proj})) {
+			$ENV{'PBTAG'}=$pkgt->{$proj};
+		} else {
+			die "No projtag found in $ENV{'PBCONF'}/$proj.pb";
+		}
+	}
+	die "Invalid tag name $ENV{'PBTAG'} in $ENV{'PBCONF'}/$proj.pb" if ($ENV{'PBTAG'} !~ /[0-9.]+/);
+} else {
+	die "Unable to open $ENV{'PBCONF'}/$proj.pb";
+}
+
+#
+# Set temp directory
+#
+if (not defined $ENV{'TMPDIR'}) {
+	$ENV{'TMPDIR'}="/tmp";
+}
+$ENV{'PBTMP'} = tempdir( "pb.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => 1 );
+
+#
+# Removes all directory existing below the delivery dir 
+# as they are temp dir only
+# Files stay and have to be cleaned up manually
+#
+if (-d $ENV{'PBDESTDIR'}) {
+	opendir(DIR,$ENV{'PBDESTDIR'}) || die "Unable to open directory $ENV{'PBDESTDIR'}: $!";
+	foreach my $d (readdir(DIR)) {
+		next if ($d =~ /^\./);
+		next if (-f "$ENV{'PBDESTDIR'}/$d");
+		pb_rm_rf("$ENV{'PBDESTDIR'}/$d") if (-d "$ENV{'PBDESTDIR'}/$d");
+	}
+	closedir(DIR);
+}
+if (! -d "$ENV{'PBDESTDIR'}") {
+	pb_mkdir_p($ENV{'PBDESTDIR'}) || die "Unable to recursively create $ENV{'PBDESTDIR'}";
+}
+
+#
+# Set build directory
+#
+$ENV{'PBBUILDDIR'}=$topdir."/build";
+if (! -d "$ENV{'PBBUILDDIR'}") {
+	pb_mkdir_p($ENV{'PBBUILDDIR'}) || die "Unable to recursively create $ENV{'PBBUILDDIR'}";
+}
+
+umask 0022;
+return($proj,$debug,$LOG,\%pbrc, \%filteredfiles, \%defpkgdir, \%extpkgdir);
+}
+
+# Internal mkdir -p function
+sub pb_mkdir_p {
+my @dir = @_;
+my $ret = mkpath(@dir, 0, 0755);
+return($ret);
+}
+
+# Internal rm -rf function
+sub pb_rm_rf {
+my @dir = @_;
+my $ret = rmtree(@dir, 0, 0);
+return($ret);
+}
+
+# Internal system function
+sub pb_system {
+
+my $cmd=shift;
+my $cmt=shift || $cmd;
+
+print "$cmt... ";
+#system("$cmd 2>&1 > $ENV{'PBTMP'}/system.log");
+system("$cmd");
+if ($? == -1) {
+	print "failed to execute ($cmd) : $!\n";
+	pb_display_file("$ENV{'PBTMP'}/system.log");
+} elsif ($? & 127) {
+	printf "child ($cmd) died with signal %d, %s coredump\n", ($? & 127),  ($? & 128) ? 'with' : 'without';
+	pb_display_file("$ENV{'PBTMP'}/system.log");
+} elsif ($? == 0) {
+	print "OK\n";
+} else {
+	printf "child ($cmd) exited with value %d\n", $? >> 8;
+	pb_display_file("$ENV{'PBTMP'}/system.log");
+}
+}
+
+sub pb_display_file {
+
+my $file=shift;
+
+return if (not -f $file);
+open(FILE,"$file");
+while (<FILE>) {
+	print $_;
+}
+close(FILE);
+}
+
+# Function which returns a pointer on a hash
+# corresponding to a declaration (arg2) in the main conf file
+# and test the returned vaue as they need to exist in that case
+sub pb_conf_get {
+
+my @param = @_;
+
+my @ptr = pb_conf_read("$ENV{'PBETC'}", @param);
+
+foreach my $i (0..$#param) {
+	die "No $param[$i] defined for $ENV{'PBPROJ'}" if (not defined $ptr[$i]);
+	my $p = $ptr[$i];
+	$p->{$ENV{'PBPROJ'}} = $p->{'default'} if (not defined $p->{$ENV{'PBPROJ'}});
+	die "No $param[$i] defined for $ENV{'PBPROJ'}" if (not defined $p->{$ENV{'PBPROJ'}});
+}
+#print "DEBUG: param: ".Dumper(@ptr)."\n" if ($debug >= 1);
+return(@ptr);
+}
+
+# Function which returns a pointer on a hash
+# corresponding to a declaration (arg2) in a conf file (arg1)
+sub pb_conf_read {
+
+my $conffile = shift;
+my @param = @_;
+my $trace;
+my @ptr;
+
+my $debug = 0;
+
+if ($debug > 0) {
+	$trace = 1;
+} else {
+	$trace = 0;
+}
+
+
+my $config = AppConfig->new({
+							# Auto Create variables mentioned in Conf file
+							CREATE => 1,
+							DEBUG => $trace,
+							GLOBAL => {
+								# Each conf item is a hash
+								ARGCOUNT => ARGCOUNT_HASH,
+							},
+						});
+$config->file($conffile);
+for my $param (@param) {
+	push @ptr,$config->get($param);
+}
+print "DEBUG: params: ".Dumper(@param)." ".Dumper(@ptr)."\n" if ($debug >= 1);
+return(@ptr);
+}
+
+# Setup environment for CMS system
+sub pb_cms_init {
+
+my $proj = shift || undef;
+my $ret;
+
+my ($cms) = pb_conf_get("cms");
+# This one is optional
+my ($cvsroot,$cvsrsh) = pb_conf_read($ENV{'PBETC'},"cvsroot","cvsrsh");
+
+if ($cms->{$proj} eq "svn") {
+	$ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; svnversion .)`;
+	chomp($ENV{'PBREVISION'});
+	$ENV{'PBCMSLOG'}="svn log";
+	$ENV{'PBCMSLOGFILE'}="svn.log";
+} elsif ($cms->{$proj} eq "cvs") {
+	# Way too slow
+	#$ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; cvs rannotate  -f . 2>&1 | awk '{print \$1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
+	#chomp($ENV{'PBREVISION'});
+	$ENV{'PBREVISION'}="CVS";
+	$ENV{'PBCMSLOG'}="cvs log";
+	$ENV{'PBCMSLOGFILE'}="cvs.log";
+	#
+	# Export content if needed
+	#
+	$ENV{'CVSROOT'} = $cvsroot->{$proj} if (defined $cvsroot->{$proj});
+	$ENV{'CVSRSH'} = $cvsrsh->{$proj} if (defined $cvsrsh->{$proj});
+} else {
+	die "cms $cms->{$proj} unknown";
+}
+return($cms);
+}
+
+sub pb_cms_export {
+my $cms = shift;
+my $pbdate = shift || undef;
+my $source = shift;
+my $destdir = shift;
+my $tmp;
+my $tmp1;
+
+if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
+	if (-d $source) {
+		$tmp = $destdir;
+	} else {
+		$tmp = $destdir."/".basename($source);
+	}
+	pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp");
+} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
+	my $dir=dirname($destdir);
+	my $base=basename($destdir);
+	if (-d $source) {
+		$tmp1 = $source;
+		$tmp1 =~ s|$ENV{'PBROOT'}/||;
+	} else {
+		$tmp1 = dirname($source);
+		$tmp1 =~ s|$ENV{'PBROOT'}/||;
+		$tmp1 = $tmp1."/".basename($source);
+	}
+	# CVS needs a relative path !
+	pb_system("cd $dir ; cvs export -D \"$pbdate\" -d $base $tmp1","Exporting $source from CVS to $destdir");
+} else {
+	die "cms $cms->{$ENV{'PBPROJ'}} unknown";
+}
+}
+
+sub pb_cms_log {
+my $cms = shift;
+my $pkgdir = shift;
+my $destfile = shift;
+
+if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
+	pb_system("svn log -v $pkgdir > $destfile","Extracting log info from SVN");
+} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
+	my $tmp=basename($pkgdir);
+	# CVS needs a relative path !
+	pb_system("cvs log $tmp > $destfile","Extracting log info from CVS");
+} else {
+	die "cms $cms->{$ENV{'PBPROJ'}} unknown";
+}
+}
+	
+
+
+# Get all filters to apply
+# They're cumulative from less specific to most specific
+# suffix is .pbf
+
+sub pb_get_filters {
+
+# For the moment not dynamic
+my $debug = 0;					# Debug level
+my $LOG = *STDOUT;				# Where to log
+
+my @ffiles;
+my ($ffile0, $ffile1, $ffile2, $ffile3);
+my ($mfile0, $mfile1, $mfile2, $mfile3);
+my $pbpkg = shift || die "No package specified";
+my $dtype = shift || die "No dtype specified";
+my $dfam = shift || die "No dfam specified";
+my $ddir = shift || die "No ddir specified";
+my $dver = shift || die "No dver specified";
+my $ptr; # returned value pointer on the hash of filters
+my %ptr;
+
+# Global filter files first, then package specificities
+if (-d "$ENV{'PBCONF'}/pbfilter") {
+	$mfile0 = "$ENV{'PBCONF'}/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$dtype.pbf");
+	$mfile1 = "$ENV{'PBCONF'}/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$dfam.pbf");
+	$mfile2 = "$ENV{'PBCONF'}/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$ddir.pbf");
+	$mfile3 = "$ENV{'PBCONF'}/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/pbfilter/$ddir-$dver.pbf");
+
+	push @ffiles,$mfile0 if (defined $mfile0);
+	push @ffiles,$mfile1 if (defined $mfile1);
+	push @ffiles,$mfile2 if (defined $mfile2);
+	push @ffiles,$mfile3 if (defined $mfile3);
+}
+
+if (-d "$ENV{'PBCONF'}/$pbpkg/pbfilter") {
+	$ffile0 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dtype.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dtype.pbf");
+	$ffile1 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dfam.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$dfam.pbf");
+	$ffile2 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir.pbf");
+	$ffile3 = "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf" if (-f "$ENV{'PBCONF'}/$pbpkg/pbfilter/$ddir-$dver.pbf");
+
+	push @ffiles,$ffile0 if (defined $ffile0);
+	push @ffiles,$ffile1 if (defined $ffile1);
+	push @ffiles,$ffile2 if (defined $ffile2);
+	push @ffiles,$ffile3 if (defined $ffile3);
+}
+if (@ffiles) {
+	print $LOG "DEBUG ffiles: ".Dumper(\@ffiles)."\n" if ($debug >= 1);
+
+	my $config = AppConfig->new({
+		# Auto Create variables mentioned in Conf file
+		CREATE => 1,
+		DEBUG => 0,
+		GLOBAL => {
+			# Each conf item is a hash
+			ARGCOUNT => AppConfig::ARGCOUNT_HASH
+		}
+	});
+
+	$config->file(@ffiles);
+	$ptr = $config->get("filter");
+	print $LOG "DEBUG f:".Dumper($ptr)."\n" if ($debug >= 1);
+} else {
+	$ptr = { };
+}
+%ptr = %$ptr;
+return(\%ptr);
+}
+
+# Function which applies filter on files (only for pb)
+sub pb_filter_file_pb {
+
+my $f=shift;
+my $ptr=shift;
+my %filter=%$ptr;
+my $destfile=shift;
+my $dtype=shift;
+my $pbsuf=shift;
+my $pbpkg=shift;
+my $pbver=shift;
+my $pbtag=shift;
+my $pbrev=shift;
+my $pbdate=shift;
+my $defpkgdir = shift;
+my $extpkgdir = shift;
+my $pbpackager = shift;
+
+# For the moment not dynamic
+my $debug = 0;					# Debug level
+my $LOG = *STDOUT;				# Where to log
+
+print $LOG "DEBUG: From $f to $destfile\n" if ($debug >= 1);
+pb_mkdir_p(dirname($destfile)) if (! -d dirname($destfile));
+open(DEST,"> $destfile") || die "Unable to create $destfile";
+open(FILE,"$f") || die "Unable to open $f: $!";
+while (<FILE>) {
+	my $line = $_;
+	foreach my $s (keys %filter) {
+		# Process single variables
+		print $LOG "DEBUG filter{$s}: $filter{$s}\n" if ($debug >= 1);
+		my $tmp = $filter{$s};
+		next if (not defined $tmp);
+		# Expand variables if any single one found
+		print $LOG "DEBUG tmp: $tmp\n" if ($debug >= 1);
+		if ($tmp =~ /\$/) {
+			eval { $tmp =~ s/(\$\w+)/$1/eeg };
+		# special case for ChangeLog only for pb
+		} elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/) && ($line =~ /^PBLOG$/)) {
+			$tmp = "";
+			my $p = $defpkgdir->{$pbpkg};
+			$p = $extpkgdir->{$pbpkg} if (not defined $p);
+			pb_changelog($dtype, $pbpkg, $pbtag, $pbsuf, $p, \*DEST);
+		}
+		$line =~ s|$s|$tmp|;
+	}
+	print DEST $line;
+}
+close(FILE);
+close(DEST);
+}
+
+# Function which applies filter on files (external call)
+sub pb_filter_file {
+
+my $f=shift;
+my $ptr=shift;
+my %filter=%$ptr;
+my $destfile=shift;
+my $pbsuf=shift;
+my $pbpkg=shift;
+my $pbver=shift;
+my $pbtag=shift;
+my $pbrev=shift;
+my $pbdate=shift;
+my $pbpackager=shift;
+
+# For the moment not dynamic
+my $debug = 0;					# Debug level
+my $LOG = *STDOUT;				# Where to log
+
+print $LOG "DEBUG: From $f to $destfile\n" if ($debug >= 1);
+pb_mkdir_p(dirname($destfile)) if (! -d dirname($destfile));
+open(DEST,"> $destfile") || die "Unable to create $destfile";
+open(FILE,"$f") || die "Unable to open $f: $!";
+while (<FILE>) {
+	my $line = $_;
+	foreach my $s (keys %filter) {
+		# Process single variables
+		print $LOG "DEBUG filter{$s}: $filter{$s}\n" if ($debug > 1);
+		my $tmp = $filter{$s};
+		next if (not defined $tmp);
+		# Expand variables if any single one found
+		if ($tmp =~ /\$/) {
+			eval { $tmp =~ s/(\$\w+)/$1/eeg };
+		}
+		$line =~ s|$s|$tmp|;
+	}
+	print DEST $line;
+}
+close(FILE);
+close(DEST);
+}
+
+
+1;
Index: /0.8.1/pb/lib/ProjectBuilder/Distribution.pm
===================================================================
--- /0.8.1/pb/lib/ProjectBuilder/Distribution.pm	(revision 191)
+++ /0.8.1/pb/lib/ProjectBuilder/Distribution.pm	(revision 191)
@@ -0,0 +1,252 @@
+#!/usr/bin/perl -w
+#
+# Creates common environment for distributions
+#
+# $Id$
+#
+
+use strict;
+
+sub pb_distro_init {
+
+my $ddir = shift || undef;
+my $dver = shift || undef;
+my $dfam = "unknown";
+my $dtype = "unknown";
+my $dsuf = "unknown";
+
+# If we don't know which distribution we're on, then guess it
+($ddir,$dver) = pb_get_distro() if ((not defined $ddir) || (not defined $dver));
+
+# There should be unicity of names between ddir dfam and dtype
+# In case of duplicate, bad things can happen
+if (($ddir =~ /debian/) ||
+	($ddir =~ /ubuntu/)) {
+	$dfam="du";
+	$dtype="deb";
+	$dsuf=".$ddir$dver";
+} elsif ($ddir =~ /gentoo/) {
+	$dfam="gen";
+	$dtype="ebuild";
+	my $dver1 = $dver;
+	$dver1 =~ s/\.//;
+	$dsuf=".$ddir$dver1";
+} elsif ($ddir =~ /slackware/) {
+	$dfam="slack";
+	$dtype="tgz";
+	$dsuf=".$dfam$dver";
+} elsif (($ddir =~ /suse/) ||
+		($ddir =~ /sles/)) {
+	if ($ddir =~ /opensuse/) {
+		$ddir = "suse";
+	}
+	$dfam="novell";
+	$dtype="rpm";
+	$dsuf=".$ddir$dver";
+} elsif (($ddir =~ /redhat/) ||
+		($ddir =~ /rhel/) ||
+		($ddir =~ /fedora/) ||
+		($ddir =~ /vmware/) ||
+		($ddir =~ /centos/)) {
+	$dfam="rh";
+	$dtype="rpm";
+	my $dver1 = $dver;
+	$dver1 =~ s/\.//;
+	if ($ddir =~ /fedora/) {
+		$dsuf=".fc$dver1";
+	} elsif ($ddir =~ /redhat/) {
+		$dsuf=".rh$dver1";
+	} elsif ($ddir =~ /vmware/) {
+		$dsuf=".vwm$dver1";
+	} else {
+		$dsuf=".$ddir$dver1";
+	}
+} elsif (($ddir =~ /mandrake/) ||
+		($ddir =~ /mandrakelinux/) ||
+		($ddir =~ /mandriva/)) {
+	$dfam="md";
+	$dtype="rpm";
+	if ($ddir =~ /mandrakelinux/) {
+		$ddir = "mandrake";
+	}
+	if ($ddir =~ /mandrake/) {
+		my $dver1 = $dver;
+		$dver1 =~ s/\.//;
+		$dsuf=".mdk$dver1";
+	} else {
+		$dsuf=".mdv$dver";
+	}
+} elsif ($ddir =~ /freebsd/) {
+	$dfam="bsd";
+	$dtype="port";
+	my $dver1 = $dver;
+	$dver1 =~ s/\.//;
+	$dsuf=".$dfam$dver1";
+} else {
+	$dfam="unknown";
+	$dtype="unknown";
+	$dsuf="unknown";
+}
+
+return($ddir, $dver, $dfam, $dtype, $dsuf);
+}
+
+sub pb_get_distro {
+
+# Cf: http://linuxmafia.com/faq/Admin/release-files.html
+# Ideas taken from 
+# http://search.cpan.org/~kerberus/Linux-Distribution-0.14/lib/Linux/Distribution.pm
+
+my $base="/etc";
+
+# List of files that unambiguously indicates what distro we have
+my %single_rel_files = (
+# Tested
+	'gentoo'			=>	'gentoo-release',		# >= 1.6
+	'debian'			=>	'debian_version',		# >= 3.1
+	'slackware'			=>	'slackware-version',	# >= 10.2
+	'mandriva'			=>	'mandriva-release',		# >=2006.0
+	'mandrakelinux'		=>	'mandrakelinux-release',# = 10.2
+	'fedora'			=>	'fedora-release',		# >= 4
+	'vmware'			=>	'vmware-release',		# >= 3
+	'sles'				=>	'sles-release',			# Doesn't exist as of 10
+# Untested
+	'knoppix'			=>	'knoppix_version',		#
+	'yellowdog'			=>	'yellowdog-release',	#
+	'esmith'			=>	'e-smith-release',		#
+	'turbolinux'		=>	'turbolinux-release',	#
+	'blackcat'			=>	'blackcat-release',		#
+	'aurox'				=>	'aurox-release',		#
+	'annvix'			=>	'annvix-release',		#
+	'cobalt'			=>	'cobalt-release',		#
+	'redflag'			=>	'redflag-release',		#
+	'ark'				=>	'ark-release',			#
+	'pld'				=>	'pld-release',			#
+	'nld'				=>	'nld-release',			#
+	'lfs'				=>	'lfs-release',			#
+	'mk'				=>	'mk-release',			#
+	'conectiva'			=>	'conectiva-release',	#
+	'immunix'			=>	'immunix-release',		#
+	'tinysofa'			=>	'tinysofa-release',		#
+	'trustix'			=>	'trustix-release',		#
+	'adamantix'			=>	'adamantix_version',	#
+	'yoper'				=>	'yoper-release',		#
+	'arch'				=>	'arch-release',			#
+	'libranet'			=>	'libranet_version',		#
+	'valinux'			=>	'va-release',			#
+	'yellowdog'			=>	'yellowdog-release',	#
+	'ultrapenguin'		=>	'ultrapenguin-release',	#
+	);
+
+# List of files that ambiguously indicates what distro we have
+my %ambiguous_rel_files = (
+	'mandrake'			=>	'mandrake-release',		# <= 10.1
+	'suse'				=>	'SuSE-release',			# >= 10.0
+	'redhat'			=>	'redhat-release',		# >= 7.3
+	'lsb'				=>	'lsb-release',			# ???
+	);
+
+# Should have the same keys as the previous one.
+# If ambiguity, which other distributions should be checked
+my %distro_similar = (
+	'mandrake'			=> ['mandrake', 'mandrakelinux'],
+	'suse'				=> ['suse', 'sles', 'opensuse'],
+	'redhat'			=> ['redhat', 'rhel', 'centos', 'mandrake', 'vmware'],
+	'lsb'				=> ['ubuntu', 'debian', 'lsb'],
+	);
+
+my %distro_match = (
+# Tested
+	'gentoo'				=> '.* version (.+)',
+	'debian'				=> '(.+)',
+	'slackware'			 	=> 'S[^ ]* (.+)$',
+# There should be no ambiguity between potential ambiguous distro
+	'mandrakelinux'			=> 'Mandrakelinux release (.+) \(',
+	'mandrake'				=> 'Mandr[^ ]* release (.+) \(',
+	'mandriva'				=> 'Mandr[^ ]* [^ ]* release (.+) \(',
+	'fedora'				=> 'Fedora .*release (\d+) \(',
+	'vmware'				=> 'VMware ESX Server (\d+) \(',
+	'rhel'					=> 'Red Hat Enterprise Linux .*release (.+) \(',
+	'centos'				=> '.*CentOS .*release (.+) ',
+	'redhat'				=> 'Red Hat Linux release (.+) \(',
+	'sles'					=> 'SUSE .* Enterprise Server (\d+) \(',
+	'suse'					=> 'SUSE LINUX (\d.+) \(',
+	'opensuse'				=> 'openSUSE (\d.+) \(',
+	'lsb'					=> '.*[^Ubunt].*\nDISTRIB_RELEASE=(.+)',
+	'ubuntu'				=> '.*Ubuntu.*\nDISTRIB_RELEASE=(.+)',
+# Not tested
+	'arch'					=> '.* ([0-9.]+) .*',
+	'redflag'				=> 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)',
+);
+
+my $release;
+my $distro;
+
+# Begin to test presence of non-amiguous files
+# that way we reduce the choice
+my ($d,$r);
+while (($d,$r) = each %single_rel_files) {
+	if (-f "$base/$r" && ! -l "$base/$r") {
+		my $tmp=pb_get_content("$base/$r");
+		# Found the only possibility. 
+		# Try to get version and return
+		if (defined ($distro_match{$d})) {
+			($release) = $tmp =~ m/$distro_match{$d}/m;
+		} else {
+			print STDERR "Unable to find $d version in $r\n";
+			print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
+			$release = "unknown";
+		}
+		return($d,$release);
+	}
+}
+
+while (($d,$r) = each %ambiguous_rel_files) {
+	if (-f "$base/$r" && !-l "$base/$r"){
+		# Found one possibility. 
+		# Get all distros concerned by that file
+		my $tmp=pb_get_content("$base/$r");
+		my $found = 0;
+		my $ptr = $distro_similar{$d};
+		#print $LOG "amb: ".Dumper($ptr)."\n" if ($debug >= 1);
+		$release = "unknown";
+		foreach my $dd (@$ptr) {
+			#print $LOG "check $dd\n" if ($debug >= 1);
+			# Try to check pattern
+			if (defined $distro_match{$dd}) {
+				#print $LOG "cmp: $distro_match{$dd} - vs - $tmp\n" if ($debug >= 1);
+				($release) = $tmp =~ m/$distro_match{$dd}/m;
+				if ((defined $release) && ($release ne "unknown")) {
+					$distro = $dd;
+					$found = 1;
+					last;
+				}
+			}
+		}
+		if ($found == 0) {
+			print STDERR "Unable to find $d version in $r\n";
+			print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
+			$release = "unknown";
+		} else {
+			return($distro,$release);
+		}
+	}
+}
+return("unknown","unknown");
+}
+
+# get content of a file in a variable
+sub pb_get_content {
+
+my $file=shift;
+
+my $bkp = $/;
+undef $/;
+open(R,$file) || die "Unable to open $file: $!";
+my $content=<R>;
+close(R);
+chomp($content);
+$/ = $bkp;
+return($content);
+}
+1;
Index: /0.8.1/pb/ChangeLog
===================================================================
--- /0.8.1/pb/ChangeLog	(revision 15)
+++ /0.8.1/pb/ChangeLog	(revision 15)
@@ -0,0 +1,6 @@
+# $Id$
+
+PB CHANGES
+
+1.0 (2007-07-26)
+- Creation of the project based on mondorescue build tools
Index: /0.8.1/pb/Makefile.PL
===================================================================
--- /0.8.1/pb/Makefile.PL	(revision 176)
+++ /0.8.1/pb/Makefile.PL	(revision 176)
@@ -0,0 +1,19 @@
+use 5.008000;
+use ExtUtils::MakeMaker;
+
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    NAME         => 'pb',
+    DISTNAME     => 'project-builder',
+    VERSION      => 'PBVER',
+    INSTALLDIRS  => 'vendor',
+    INST_SCRIPT  => 'blib/bin',
+    PREREQ_PM    => {
+			#HTTP::Headers                    => 1.59,
+			#Template                         => 0,
+    },    # e.g., Module::Name => 1.1
+	#ABSTRACT_FROM => 'bin/pb',   # retrieve abstract from module
+    AUTHOR        => 'Bruno Cornec <bruno#project-builder.org>',
+	EXE_FILES     => [ qw( bin/pb bin/pbg bin/pbvi bin/pbdistrocheck ) ],
+);
Index: /0.8.1/pb/COPYING
===================================================================
--- /0.8.1/pb/COPYING	(revision 15)
+++ /0.8.1/pb/COPYING	(revision 15)
@@ -0,0 +1,280 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
Index: /0.8.1/pb/bin/pbvi
===================================================================
--- /0.8.1/pb/bin/pbvi	(revision 155)
+++ /0.8.1/pb/bin/pbvi	(revision 155)
@@ -0,0 +1,3 @@
+#!/bin/bash
+export LANGUAGE=C
+gvim `egrep -r $* . | egrep -vi '\.svn|~:|binary' | cut -d: -f1 | sort -u`
Index: /0.8.1/pb/bin/pb
===================================================================
--- /0.8.1/pb/bin/pb	(revision 194)
+++ /0.8.1/pb/bin/pb	(revision 194)
@@ -0,0 +1,823 @@
+#!/usr/bin/perl -w
+#
+# Project Builder main application
+#
+# $Id$
+#
+# Copyright B. Cornec 2007
+# Provided under the GPL v2
+
+# Syntax: see at end
+
+use strict 'vars';
+use Getopt::Std;
+use Data::Dumper;
+use English;
+use AppConfig qw(:argcount :expand);
+use File::Basename;
+use File::Copy;
+use Time::localtime qw(localtime);
+use POSIX qw(strftime);
+
+# Global variables
+use lib qw (lib);
+use ProjectBuilder::Distribution qw (pb_distro_init);
+use ProjectBuilder::Version qw (pb_version_init);
+use ProjectBuilder::Base qw (pb_conf_read pb_conf_get pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_cms_export pb_cms_log);
+
+my %opts;					# CLI Options
+my $action;					# action to realize
+my $test = "FALSE";
+my $option = "";
+my @pkgs;
+my $pbtag;					# Global Tag variable
+my $pbver;					# Global Version variable
+my $pbscript;				# Name of the script
+my %pbver;					# per package
+my %pbtag;					# per package
+my $pbrev;					# Global REVISION variable
+my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst());
+my $pbdate = strftime("%Y-%m-%d", @date);
+my $pbdatecvs = strftime("%Y-%m-%d %H:%M:%S", @date);
+my $debug = 0;
+my $pbaccount;				# Login to use to connect to the VM
+my $pbport;					# Port to use to connect to the VM
+my $LOG = \*STDOUT;
+
+getopts('a:hl:m:P:p:qr:s:tv',\%opts);
+
+my ($projectbuilderver,$projectbuilderrev) = pb_version_init();
+if (defined $opts{'h'}) {
+	pb_syntax();
+	exit(0);
+}
+if (defined $opts{'v'}) {
+	$debug++;
+}
+if (defined $opts{'q'}) {
+	$debug=-1;
+}
+if (defined $opts{'l'}) {
+	open(LOG,"> $opts{'l'}") || die "Unable to log to $opts{'l'}: $!";
+	$LOG = *LOG;
+	$debug = 0  if ($debug == -1);
+	}
+# Handles test option
+if (defined $opts{'t'}) {
+	$test = "TRUE";
+	# Works only for SVN
+	$option = "-r BASE";
+}
+
+# Handle root of the project if defined
+if (defined $opts{'r'}) {
+	$ENV{'PBROOT'} = $opts{'r'};
+}
+# Handle virtual machines if any
+if (defined $opts{'m'}) {
+	$ENV{'PBVM'} = $opts{'m'};
+}
+if (defined $opts{'s'}) {
+	$pbscript = $opts{'s'};
+}
+if (defined $opts{'a'}) {
+	$pbaccount = $opts{'a'};
+}
+if (defined $opts{'P'}) {
+	$pbport = $opts{'P'};
+}
+
+# Get Action
+$action = shift @ARGV;
+die pb_syntax() if (not defined $action);
+
+my ($pbrc, $filteredfiles, $defpkgdir, $extpkgdir);
+
+# Handles project name if any
+# And get global params
+if (defined $opts{'p'}) {
+	($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir) 
+	= pb_env_init($opts{'p'});
+} else {
+	($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir) 
+	= pb_env_init();
+}
+
+print $LOG "Project: $ENV{'PBPROJ'}\n" if ($debug >= 0);
+print $LOG "Action: $action\n" if ($debug >= 0);
+
+# Keep those project values to store them at the end each time
+my $pbprojtag = $ENV{'PBTAG'};
+my $pbprojver = $ENV{'PBVER'};
+
+# Act depending on action
+if ($action =~ /^cms2build$/) {
+	pb_cms2build();
+} elsif ($action =~ /^build2pkg$/) {
+	pb_build2pkg();
+} elsif ($action =~ /^cms2pkg$/) {
+	pb_cms2build();
+	pb_build2pkg();
+} elsif ($action =~ /^build2ssh$/) {
+	pb_build2ssh();
+} elsif ($action =~ /^pkg2ssh$/) {
+	pb_pkg2ssh();
+} elsif ($action =~ /^build2vm$/) {
+	pb_build2vm();
+} elsif ($action =~ /^cms2vm$/) {
+	pb_cms2build();
+	pb_build2vm();
+} elsif ($action =~ /^launchvm$/) {
+	pb_launchvm($ENV{'PBVM'});
+} elsif ($action =~ /^script2vm$/) {
+	pb_script2vm($pbscript);
+} elsif ($action =~ /^clean$/) {
+} else {
+	print $LOG "'$action' is not available\n";
+	pb_syntax();
+}
+
+sub pb_cms2build {
+
+	my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
+	@pkgs = @$ptr;
+	my $cms=pb_cms_init($ENV{'PBPROJ'});
+
+	my ($pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb","pkgver","pkgtag");
+
+	# declare packager for filtering
+	my ($tmp) = pb_conf_get("packager");
+	my $pbpackager = $tmp->{$ENV{'PBPROJ'}};
+
+	foreach my $pbpkg (@pkgs) {
+		$ENV{'PBPKG'} = $pbpkg;
+		if ((defined $pkgv) && (defined $pkgv->{$pbpkg})) {
+			$pbver = $pkgv->{$pbpkg};
+			$ENV{'PBVER'} = $pbver;
+		} else {
+			$pbver = $ENV{'PBVER'};
+		}
+		if ((defined $pkgt) && (defined $pkgt->{$pbpkg})) {
+			$pbtag = $pkgt->{$pbpkg};
+			$ENV{'PBTAG'} = $pbtag;
+		} else {
+			$pbtag = $ENV{'PBTAG'};
+		}
+
+		$pbrev = $ENV{'PBREVISION'};
+		print $LOG "\n";
+		print $LOG "Management of $pbpkg $pbver-$pbtag (rev $pbrev)\n";
+		die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
+		# Clean up dest if necessary. The export will recreate it
+		my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver";
+		pb_rm_rf($dest) if (-d $dest);
+
+		# Export CMS tree for the concerned package to dest
+		# And generate some additional files
+		$OUTPUT_AUTOFLUSH=1;
+
+		# computes in which dir we have to work
+		my $dir = $defpkgdir->{$pbpkg};
+		$dir = $extpkgdir->{$pbpkg} if (not defined $dir);
+		print "def:".Dumper($defpkgdir)." ext: ".Dumper($extpkgdir)." \n" if ($debug >= 1);
+		pb_cms_export($cms,$pbdatecvs,"$ENV{'PBROOT'}/$dir",$dest);
+
+		# Extract cms log history and store it
+		pb_cms_log($cms,"$ENV{'PBROOT'}/$dir","$dest/$ENV{'PBCMSLOGFILE'}");
+
+		my %build;
+
+		my ($ptr) = pb_conf_get("vmlist");
+		foreach my $d (split(/,/,$ptr->{$ENV{'PBPROJ'}})) {
+			my ($name,$ver) = split(/_/,$d);
+			chomp($ver);
+			my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver);
+			print $LOG "DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf)."\n" if ($debug >= 1);
+			print $LOG "DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n" if ($debug >= 1);
+
+			# Filter build files from the less precise up to the most with overloading
+			# Filter all files found, keeping the name, and generating in dest
+
+			# Find all build files first relatively to PBROOT
+			my %bfiles;
+			print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pbpkg\n" if ($debug >= 1);
+			$build{"$ddir-$dver"} = "yes";
+			if (-d "$ENV{'PBCONF'}/$pbpkg/$dtype") {
+				opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dtype") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dtype: $!";
+				foreach my $f (readdir(BDIR)) {
+					next if ($f =~ /^\./);
+					$bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f";
+					$bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
+				}
+				closedir(BDIR);
+			} elsif (-d "$ENV{'PBCONF'}/$pbpkg/$dfam") {
+				opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dfam") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dfam: $!";
+				foreach my $f (readdir(BDIR)) {
+					next if ($f =~ /^\./);
+					$bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f";
+					$bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
+				}
+				closedir(BDIR);
+			} elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir") {
+				opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir: $!";
+				foreach my $f (readdir(BDIR)) {
+					next if ($f =~ /^\./);
+					$bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f";
+					$bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
+				}
+				closedir(BDIR);
+			} elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") {
+				opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir-$dver: $!";
+				foreach my $f (readdir(BDIR)) {
+					next if ($f =~ /^\./);
+					$bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f";
+					$bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
+				}
+				closedir(BDIR);
+			} else {
+				$build{"$ddir-$dver"} = "no";
+				next;
+			}
+			print $LOG "DEBUG bfiles: ".Dumper(\%bfiles)."\n" if ($debug >= 1);
+
+			# Get all filters to apply
+			my $ptr = pb_get_filters($pbpkg, $dtype, $dfam, $ddir, $dver);
+
+			# Apply now all the filters on all the files concerned
+			# destination dir depends on the type of file
+			if (defined $ptr) {
+				foreach my $f (values %bfiles) {
+					pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir,$pbpackager);
+				}
+				if (defined $filteredfiles->{$pbpkg}) {
+					foreach my $f (split(/,/,$filteredfiles->{$pbpkg})) {
+						pb_filter_file("$ENV{'PBROOT'}/$dir/$f",$ptr,"$dest/$f",$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
+					}
+				}
+			}
+		}
+		if ($debug >= 0) {
+			my @found;
+			my @notfound;
+			foreach my $b (keys %build) {
+				push @found,$b if ($build{$b} =~ /yes/);
+				push @notfound,$b if ($build{$b} =~ /no/);
+			}
+			print $LOG "Build files generated for ".join(',',@found)."\n";
+			print $LOG "No Build files found for ".join(',',@notfound)."\n";
+		}
+		# Prepare the dest directory for archive
+		if (-x "$ENV{'PBCONF'}/$pbpkg/pbinit") {
+			#pb_system("cd $dest ; $ENV{'PBCONF'}/$pbpkg/pbinit","Executing init script $ENV{'PBCONF'}/$pbpkg/pbinit");
+			print $LOG "Executing init script $ENV{'PBCONF'}/$pbpkg/pbinit\n";
+			system("cd $dest ; $ENV{'PBCONF'}/$pbpkg/pbinit");
+		}
+
+		# Archive dest dir
+		chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}";
+		# Possibility to look at PBSRC to guess more the filename
+		pb_system("tar cfz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed");
+		print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0);
+
+		# Keep track of what is generated for default
+		open(LAST,"> $pbrc->{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc->{$ENV{'PBPROJ'}}";
+		print LAST "pbroot $pbprojver-$pbprojtag = $ENV{'PBROOT'}\n";
+		close(LAST);
+
+		# Keep track of per package version
+		if (! -f "$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") {
+			open(PKG,">$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
+			print PKG "# Empty\n";
+			close(PKG);
+		}
+		my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
+		$pkg = { } if (not defined $pkg);
+		if ((not defined $pkg->{$pbpkg}) || ($pkg->{$pbpkg} ne "$pbver-$pbtag")) {
+			$pkg->{$pbpkg} = "$pbver-$pbtag";
+		}
+
+		print $LOG "DEBUG pkg: ".Dumper($pkg)."\n" if ($debug >= 1);
+		open(PKG,"> $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
+		foreach my $p (keys %$pkg) {
+			print PKG "pbpkg $p = $pkg->{$p}\n";
+		}
+		close(PKG);
+	}
+}
+
+sub pb_build2pkg {
+
+	# Get list of packages to build
+	my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
+	@pkgs = @$ptr;
+
+	# Get the running distro to build on
+	my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
+	print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
+
+	# Get content saved in cms2build
+	my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
+	$pkg = { } if (not defined $pkg);
+
+	# declare packager
+	my ($tmp) = pb_conf_get("packager");
+	my $pbpackager = $tmp->{$ENV{'PBPROJ'}};
+
+	chdir "$ENV{'PBBUILDDIR'}";
+	my $made = ""; # pkgs made during build
+	foreach my $pbpkg (@pkgs) {
+		my $vertag = $pkg->{$pbpkg};
+		# get the version of the current package - maybe different
+		($pbver,$pbtag) = split(/-/,$vertag);
+
+		my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
+		# Suse < 10.2 forces tar.bz2 usage :-(
+		if ($ddir eq "suse") {
+			print "SuSE needs bz2 type of packages so recompressing...\n";
+			my $newsrc="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.bz2";
+			system "gzip -cd $src | bzip2 -c6 > $newsrc";
+			$src = $newsrc;
+		}
+		print $LOG "Source file: $src\n" if ($debug >= 0);
+
+		print $LOG "Working directory: $ENV{'PBBUILDDIR'}\n" if ($debug >= 0);
+		if ($dtype eq "rpm") {
+			foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
+				if (! -d "$ENV{'PBBUILDDIR'}/$d") {
+				pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d") || die "Please ensure that you can write into $ENV{'PBBUILDDIR'} to create $d\nchown the $ENV{'PBBUILDDIR'} directory to your uid";
+				}
+			}
+
+			symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || die "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES";
+			# We need to first extract the spec file
+			my @specfile;
+			@specfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/SPECS");
+
+			print $LOG "specfile: ".Dumper(\@specfile)."\n" if ($debug >= 1);
+			# set LANGUAGE to check for correct log messages
+			$ENV{'LANGUAGE'}="C";
+			#system("ls -R $ENV{'PBBUILDDIR'}") if ($debug >= 1);
+			foreach my $f (@specfile) {
+				if ($f =~ /\.spec$/) {
+					pb_system("rpmbuild --define \"packager $pbpackager\" --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}");
+					last;
+				}
+			}
+			$made="$made RPMS/*/$pbpkg-$pbver-$pbtag$pbsuf.*.rpm SRPMS/$pbpkg-$pbver-$pbtag$pbsuf.src.rpm";
+			if (-f "/usr/bin/rpmlint") {
+				pb_system("rpmlint $made","Checking validity of rpms with rpmlint");
+			}
+		} elsif ($dtype eq "deb") {
+			chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}";
+			pb_system("tar xfz $src","Extracting sources");
+
+			chdir "$pbpkg-$pbver" || die "Unable to chdir to $pbpkg-$pbver";
+			symlink "pbconf/$ddir-$dver","debian" || die "Unable to symlink to pbconf/$ddir-$dver";
+			pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package");
+			$made="$made $pbpkg"."_*.deb $pbpkg"."_*.dsc $pbpkg"."_*.tar.gz";
+		} elsif ($dtype eq "ebuild") {
+			my @ebuildfile;
+			# For gentoo we need to take pb as subsystem name
+			pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg") if (! -d "$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
+
+			# We need to first extract the ebuild file
+			@ebuildfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
+
+			# Prepare the build env for gentoo
+			my $found = 0;
+			my $pbbd = $ENV{'PBBUILDDIR'};
+			$pbbd =~ s|/|\\/|g;
+			open(MAKE,"/etc/make.conf") || die "Unable to open /etc/make.conf";
+			while (<MAKE>) {
+				$found = 1 if (/$pbbd\/portage/);
+			}
+			close(MAKE);
+			if ($found == 0) {
+				pb_system("sudo \'echo \"$ENV{'PBBUILDDIR'}/portage\" >> /etc/make.conf\'");
+			}
+			$found = 0;
+			open(KEYW,"/etc/portage/package.keywords") || die "Unable to open /etc/portage/package.keywords";
+			while (<KEYW>) {
+				$found = 1 if (/portage\/pb/);
+			}
+			close(KEYW);
+			if ($found == 0) {
+				pb_system("sudo \'echo \"portage/pb\" >> /etc/portage/package.keywords\'");
+			}
+
+			# Build
+			foreach my $f (@ebuildfile) {
+				if ($f =~ /\.ebuild$/) {
+					pb_system("ebuild $f digest ; ebuild $f package");
+				}
+			}
+			print $LOG "ebuild file: ".Dumper(\@ebuildfile)."\n" if ($debug >= 1);
+
+			$made="$made portage/pb/$pbpkg/$pbpkg-$pbver.ebuild";
+		} elsif ($dtype eq "slackware") {
+			$made="$made build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz";
+			pb_mkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install");
+		} else {
+			die "Unknown dtype format $dtype";
+		}
+	}
+	# Keep track of what is generated so that we can get them back from VMs
+	open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to create $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
+	print KEEP "$made\n";
+	close(KEEP);
+}
+
+sub pb_build2ssh {
+	pb_send2ssh("Sources");
+}
+
+sub pb_pkg2ssh {
+	pb_send2ssh("Packages");
+}
+
+# By default deliver to the the public site hosting the 
+# ftp structure (or whatever) or a VM
+sub pb_send2ssh {
+
+	my $cmt = shift;
+	my $vm = shift || undef;
+	my $vmexist = shift || 0;			# 0 is FALSE
+	my $host = shift || "sshhost";
+	my $login = shift || "sshlogin";
+	my $dir = shift || "sshdir";
+	my $port = shift || "sshport";
+	my $cmd = "";
+
+	# Get list of packages to build
+	my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
+	@pkgs = @$ptr;
+
+	# Get the running distro to consider
+	my ($odir,$over) = (undef, undef);
+	if (defined $vm) {
+		($odir,$over) = split(/_/,$vm);
+	}
+	my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($odir,$over);
+	print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
+
+	# Get content saved in cms2build
+	my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
+	$pkg = { } if (not defined $pkg);
+
+	my $src = "";
+	chdir "$ENV{'PBBUILDDIR'}";
+	foreach my $pbpkg (@pkgs) {
+		my $vertag = $pkg->{$pbpkg};
+		# get the version of the current package - maybe different
+		($pbver,$pbtag) = split(/-/,$vertag);
+
+		if (($cmt eq "Sources") || ($cmt eq "VMs")) {
+			$src = "$src $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
+			if ($cmd eq "") {
+				$cmd = "ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
+			} else {
+				$cmd = "$cmd ; ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
+			}
+		}
+	}
+	if ($cmt eq "VMs") {
+		$src="$src $ENV{'PBDESTDIR'}/pbscript $ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb $ENV{'PBETC'}";
+	} elsif ($cmt eq "Script") {
+		$src="$src $ENV{'PBDESTDIR'}/pbscript";
+	} elsif ($cmt eq "Packages") {
+		# Get package list from file made during build2pkg
+		open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
+		$src = <KEEP>;
+		chomp($src);
+		close(KEEP);
+		if ($dtype eq "rpm") {
+			# Also make a pbscript to generate yum/urpmi bases
+			# $src = "$src $ENV{'PBDESTDIR'}/pbscript"
+		} elsif ($dtype eq "deb") {
+			# Also make a pbscript to generate apt bases
+			# $src = "$src $ENV{'PBDESTDIR'}/pbscript"
+		}
+	}
+	# Remove potential leading spaces (cause pb with basename)
+	$src =~ s/^ *//;
+	my $basesrc = "";
+	foreach my $i (split(/ +/,$src)) {
+		$basesrc .= " ".basename($i);
+	}
+
+	print $LOG "Sources handled ($cmt): $src\n" if ($debug >= 0);
+	my ($sshhost,$sshlogin,$sshdir,$sshport) = pb_conf_get($host,$login,$dir,$port);
+	my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}";
+	# Overwrite account value if passed as parameter
+	$mac = "$pbaccount\@$sshhost->{$ENV{'PBPROJ'}}" if (defined $pbaccount);
+	$port = "$pbport" if (defined $pbport);
+	my $tdir;
+	my $bdir;
+	if (($cmt eq "Sources") || ($cmt eq "Script")) {
+		$tdir = "$sshdir->{$ENV{'PBPROJ'}}/src";
+	} elsif ($cmt eq "VMs") {
+		$tdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/delivery";
+		$bdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/build";
+		# Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
+		$bdir =~ s|\$ENV.+\}/||;
+	} elsif ($cmt eq "Packages") {
+		$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$ddir/$dver";
+	} else {
+		return;
+	}
+	# Remove a potential $ENV{'HOME'} as tdir should be relative to pb's home
+	$tdir =~ s|\$ENV.+\}/||;
+
+	$port = $sshport->{$ENV{'PBPROJ'}};
+	pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; echo \'for i in $basesrc; do if [ -f \$i ]; then rm -f \$i; fi; done\ ; $cmd' | bash\"","Preparing $tdir on $mac");
+	pb_system("cd $ENV{'PBBUILDDIR'} ; scp -p -P $port $src $mac:$tdir 2> /dev/null","$cmt delivery in $tdir on $mac");
+	pb_system("ssh -q -p $port $mac \"echo \'cd $tdir ; if [ -f pbscript ]; then ./pbscript; fi\' | bash\"","Executing pbscript on $mac  if needed");
+	if ($cmt eq "VMs") {
+		# Get back info on pkg produced, compute their name and get them from the VM
+		pb_system("scp -p -P $port $mac:$bdir/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'} 2> /dev/null","Get package names in $tdir on $mac");
+		open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
+		my $src = <KEEP>;
+		chomp($src);
+		close(KEEP);
+		$src =~ s/^ *//;
+		pb_mkdir_p("$ENV{'PBBUILDDIR'}/$odir/$over");
+		# Change pgben to make the next send2ssh happy
+		my $made = "";
+		open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to write $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
+		foreach my $p (split(/ +/,$src)) {
+			my $j = basename($p);
+			pb_system("scp -p -P $port $mac:\'$bdir/$p\' $ENV{'PBBUILDDIR'}/$odir/$over 2> /dev/null","Package recovery of $j in $tdir from $mac");
+			$made="$made $odir/$over/$j" if (($dtype ne "rpm") || ($j !~ /.src.rpm$/));
+		}
+		print KEEP "$made\n";
+		close(KEEP);
+		pb_system("ssh -q -p $port $mac \"rm -rf $tdir\"","VM cleanup on $mac");
+		if (! $vmexist) {
+			pb_system("ssh -q -p $port $mac \"sudo /usr/bin/poweroff \"; sleep 120 ; echo \'if [ -d /proc/$vmexist ]; then kill $vmexist; fi \' | bash ; sleep 10","VM halt on $mac");
+		}
+		pb_send2ssh("Packages","$odir"."_"."$over");
+		pb_rm_rf("$ENV{'PBBUILDDIR'}/$odir");
+	}
+}
+
+sub pb_script2vm {
+	my $pbscript=shift;
+
+	# Prepare the script to be executed on the VM
+	# in $ENV{'PBDESTDIR'}/pbscript
+	if ((defined $pbscript ) && ($pbscript ne "$ENV{'PBDESTDIR'}/pbscript")) {
+		copy($pbscript,"$ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript";
+		chmod 0755,"$ENV{'PBDESTDIR'}/pbscript";
+	}
+
+	my ($vm,$all) = pb_get_vm();
+
+	foreach my $v (@$vm) {
+		# Launch the VM
+		my $vmexist = pb_launchvm($v);
+		if (! $vmexist) {
+			pb_system("sleep 300","Waiting for it to come up");
+		}
+
+		# Gather all required files to send them to the VM 
+		# and launch the build thourgh pbscript
+		pb_send2ssh("Script","$v",$vmexist,"vmhost","vmlogin","pbrc","vmport");
+
+	}
+}
+
+sub pb_launchvm {
+	my $vm = shift;
+
+	die "No VM defined, unable to launch" if (not defined $vm);
+	# Keep only the first VM in case many were given
+	$vm =~ s/,.*//;
+
+	# Launch the VMs
+	my ($ptr,$vmopt,$vmport,$vmpath) = pb_conf_get("vmtype","vmopt","vmport","vmpath");
+	my $vmtype = $ptr->{$ENV{'PBPROJ'}};
+	if (defined $vmopt->{$ENV{'PBPROJ'}}) {
+		$ENV{'PBVMOPT'} = $vmopt->{$ENV{'PBPROJ'}};
+	} else {
+		$ENV{'PBVMOPT'} = "";
+	}
+	$vmport->{$ENV{'PBPROJ'}} = "$pbport" if (defined $pbport);
+
+	my $cmd;
+	my $vmcmd;		# has to be used for pb_check_ps
+	my $vmm;		# has to be used for pb_check_ps
+	if ($vmtype eq "qemu") {
+		my $arch = `uname -m`;
+		chomp($arch);
+		my $qemucmd32;
+		my $qemucmd64;
+		if ($arch eq "x86_64") {
+			$qemucmd32 = "/usr/bin/qemu-system-i386";
+			$qemucmd64 = "/usr/bin/qemu";
+		} else {
+			$qemucmd32 = "/usr/bin/qemu";
+			$qemucmd64 = "/usr/bin/qemu-system-x86_64";
+		}
+		if ($vm =~ /_64/) {
+			$vmcmd = "$qemucmd64 -no-kqemu";
+		} else {
+			$vmcmd = "$qemucmd32";
+		}
+		$vmm = "$vmpath->{$ENV{'PBPROJ'}}/$vm.qemu";
+		if (! -f "$vmm") {
+			print "Unable to find VM $vmm";
+			return;
+		}
+		$cmd = "$vmcmd $ENV{'PBVMOPT'} -redir tcp:$vmport->{$ENV{'PBPROJ'}}:10.0.2.15:22 $vmm"
+	} elsif ($vmtype eq "xen") {
+	} elsif ($vmtype eq "vmware") {
+	} else {
+		die "VM of type $vmtype not supported. Report to the dev team";
+	}
+	my $vmexist = pb_check_ps($vmcmd,$vmm);
+	if (! $vmexist) {
+		pb_system("$cmd &","Launching the VM");
+	}
+	return($vmexist);
+}
+
+sub pb_build2vm {
+	# Prepare the script to be executed on the VM
+	# in $ENV{'PBDESTDIR'}/pbscript
+	open(SCRIPT,"> $ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript";
+	print SCRIPT "#!/bin/bash\n";
+	print SCRIPT "echo ... Execution needed\n";
+	print SCRIPT "# This is in directory delivery\n";
+	print SCRIPT "# Setup the variables required for building\n";
+	print SCRIPT "export PBPROJ=$ENV{'PBPROJ'}\n";
+	print SCRIPT "# Preparation for pb\n";
+	print SCRIPT "mkdir -p ../pbconf\n";
+	print SCRIPT "mv $ENV{'PBPROJ'}.pb ../pbconf\n";
+	print SCRIPT "mv .pbrc \$HOME\n";
+	print SCRIPT "cd ..\n";
+	print SCRIPT "export PBROOT=\`pwd\`\n";
+	print SCRIPT "# Build\n";
+	my $p = "";
+	$p = $ARGV[0] if (defined $ARGV[0]);
+	print SCRIPT "echo Building packages on VM...\n";
+	print SCRIPT "pb -p $ENV{'PBPROJ'} build2pkg $p\n";
+	close(SCRIPT);
+	chmod 0755,"$ENV{'PBDESTDIR'}/pbscript";
+
+	my ($vm,$all) = pb_get_vm();
+
+	# Send tar files when we do a global generation
+	pb_build2ssh() if ($all == 1);
+
+	foreach my $v (@$vm) {
+		# Launch the VM
+		my $vmexist = pb_launchvm($v);
+		if (! $vmexist) {
+			pb_system("sleep 300","Waiting for it to come up");
+		}
+
+		# Gather all required files to send them to the VM 
+		# and launch the build thourgh pbscript
+		pb_send2ssh("VMs","$v",$vmexist,"vmhost","vmlogin","pbrc","vmport");
+	}
+}
+
+sub pb_get_pkg {
+
+my @pkgs;
+my $defpkgdir = shift;
+my $extpkgdir = shift;
+
+# Get packages list
+if (not defined $ARGV[0]) {
+	@pkgs = keys %$defpkgdir;
+} elsif ($ARGV[0] =~ /^all$/) {
+	@pkgs = keys %$defpkgdir;
+	push(@pkgs, keys %$extpkgdir);
+} else {
+	@pkgs = @ARGV;
+}
+print $LOG "Packages: ".join(',',@pkgs)."\n" if ($debug >= 0);
+return(\@pkgs);
+}
+
+#
+# Return the list of VMs we are working on
+# $all is a flag to know if we return all of them 
+# or only some (if all we publish also tar files in addition to pkgs
+#
+sub pb_get_vm {
+
+my @vm;
+my $all = 0;
+
+# Get VM list
+if ((not defined $ENV{'PBVM'}) || ($ENV{'PBVM'} =~ /^all$/)) {
+	my ($ptr) = pb_conf_get("vmlist");
+	$ENV{'PBVM'} = $ptr->{$ENV{'PBPROJ'}};
+	$all = 1;
+}
+@vm = split(/,/,$ENV{'PBVM'});
+print $LOG "VMs: ".join(',',@vm)."\n";
+return(\@vm,$all);
+}
+
+# Returns the pid of a running VM command using a specific VM file
+sub pb_check_ps {
+	my $vmcmd = shift;
+	my $vmm = shift;
+	my $vmexist = 0;		# FALSE by default
+
+	open(PS, "ps auxhww|") || die "Unable to call ps";
+	while (<PS>) {
+		next if (! /$vmcmd/);
+		next if (! /$vmm/);
+		my ($void1, $void2);
+		($void1, $vmexist, $void2) = split(/ +/);
+		last;
+	}
+	return($vmexist);
+}
+
+
+sub pb_extract_build_files {
+
+my $src=shift;
+my $dir=shift;
+my $ddir=shift;
+my @files;
+
+if ($src =~ /tar\.gz$/) {
+	pb_system("tar xfpz $src $dir","Extracting build files");
+} elsif ($src =~ /tar\.bz2$/) {
+	pb_system("tar xfpj $src $dir","Extracting build files");
+} else {
+	die "Unknown compression algorithm for $src";
+}
+opendir(DIR,"$dir") || die "Unable to open directory $dir";
+foreach my $f (readdir(DIR)) {
+	next if ($f =~ /^\./);
+	move("$dir/$f","$ddir") || die "Unable to move $dir/$f to $ddir";
+	print $LOG "mv $dir/$f $ddir\n" if ($debug >= 1);
+	push @files,"$ddir/$f";
+}
+closedir(DIR);
+# Not enough but still a first cleanup
+pb_rm_rf("$dir");
+return(@files);
+}
+
+sub pb_syntax {
+
+	print "pb (aka project-builder) Version $projectbuilderver-$projectbuilderrev\n";
+	print "\n";
+	print "Syntax: pb [-vhqt][-r pbroot][-p project][[-s script -a account -P port] -m \"mach-1[,...]\"] <action> [<pkg1>...]\n";
+	print "\n";
+	print "-h : This help file\n";
+	print "-q : Quiet mode\n";
+	print "-t : Test mode (not done yet)\n";
+	print "-v : Verbose mode\n";
+	print "\n";
+	print "-m machine : Name of the Virtual Machines (VM) you want\n";
+	print "             to build on (coma separated). All if none precised\n";
+	print "             (or use the env variable PBVM)       \n";
+	print "\n";
+	print "-s script  : Name of the script you want\n";
+	print "             to execute on the related VMs.\n";
+	print "\n";
+	print "-a account : Name of the account to use\n";
+	print "             to connect on the related VMs.\n";
+	print "\n";
+	print "-p project : Name of the project you're working on\n";
+	print "             (or use the env variable PBPROJ)     \n";
+	print "\n";
+	print "-r pbroot  : Path Name of project under the CMS \n";
+	print "             (or use the env variable PBROOT)   \n";
+	print "\n";
+	print "<action> can be:\n";
+	print "\n";
+	print "\tcms2build: Create tar files for the project under your CMS\n";
+	print "\t           CMS supported are SVN and CVS\n";
+	print "\t           parameters are packages to build\n";
+	print "\t           if not using default list\n";
+	print "\n";
+	print "\tbuild2pkg: Create packages for your running distribution  \n";
+	print "\n";
+	print "\tcms2pkg:   cms2build + build2pkg\n";
+	print "\n";
+	print "\tbuild2ssh: Send the tar files to a SSH host               \n";
+	print "\n";
+	print "\tpkg2ssh:   Send the packages built to a SSH host          \n";
+	print "\n";
+	print "\tbuild2vm:  Create packages in VMs, launching them if needed\n";
+	print "\t           and send those packages to a SSH host once built\n";
+	print "\t           VM type supported are QEMU            \n";
+	print "\n";
+	print "\tcms2vm:    cms2build + build2vm\n";
+	print "\n";
+	print "\tlaunchvm:  Launch one virtual machine\n";
+	print "\n";
+	print "\tscript2vm: Launch one virtual machine if needed        \n";
+	print "\t			and executes a script on it                 \n";
+	print "\n";
+}
Index: /0.8.1/pb/bin/mknewshtml.pl
===================================================================
--- /0.8.1/pb/bin/mknewshtml.pl	(revision 5)
+++ /0.8.1/pb/bin/mknewshtml.pl	(revision 5)
@@ -0,0 +1,126 @@
+#!/usr/bin/perl -w
+#
+# Creates news html pages
+# 
+# $Id$
+#
+# Syntax : mknewshtml.pl dir
+#
+
+use strict;
+use Date::Manip;
+use File::Basename;
+use DBI;
+use English;
+
+
+# For date handling
+$ENV{LANG}="C";
+
+my $PBROOT;
+my $tmp = dirname($PROGRAM_NAME);
+if ($tmp =~ /^\//) {
+	$PBROOT = $tmp;
+	}
+else {
+	$PBROOT = "$ENV{PWD}/$tmp";
+	}
+
+my $lastnews="$ARGV[0]/latest-news.html";
+my $news="$ARGV[0]/news.shtml";
+my $db="$PBROOT/../website/announces3.sql";
+
+print "Using Database $db\n";
+
+my $dbh = DBI->connect("dbi:SQLite:dbname=$db","","") 
+			|| die "Unable to connect to $db";
+
+open(NEWS,"> $news") || die "Unable to open $news (write)";
+print NEWS << 'EOF';
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en" lang="en">
+  <head>
+<!--#include virtual="/head.shtml" -->
+  </head>
+  <body>
+                  <!--#set var="curpage" value="news.shtml" -->
+<!--#include virtual="/top.shtml" -->
+
+                <h1>Mondo Rescue News</h1>
+  <div class="h2-1">
+    <h2>This year's News</h2>
+  </div>
+
+EOF
+
+my $today = &UnixDate("today","%Y-%m-%d");
+my $firstjan = &UnixDate("1st January","%Y-%m-%d");
+#print "today: $today - First: $firstjan\n";
+
+my $all = $dbh->selectall_arrayref("SELECT id,date,announce FROM announces ORDER BY date DESC");
+  foreach my $row (@$all) {
+    my ($id, $date, $announce) = @$row;
+    print NEWS "<p><B>$date</B> $announce\n" if ((Date_Cmp($date,$today) <= 0) && (Date_Cmp($firstjan,$date) <= 0));
+  }
+
+print NEWS << 'EOF';
+
+  <div class="h2-2">
+    <h2>Last year's News</h2>
+  </div>
+
+EOF
+
+my $oldfirst = &UnixDate(DateCalc("1st January","1 year ago"),"%Y-%m-%d");
+#print "oldfirst: $oldfirst - First: $firstjan\n";
+
+$all = $dbh->selectall_arrayref("SELECT id,date,announce FROM announces ORDER BY date DESC");
+  foreach my $row (@$all) {
+    my ($id, $date, $announce) = @$row;
+    print NEWS "<p><B>$date</B> $announce\n" if ((Date_Cmp($date,$firstjan) <= 0) && (Date_Cmp($oldfirst,$date) <= 0));
+  }
+
+
+print NEWS << 'EOF';
+
+  <div class="h2-3">
+    <h2>Older News</h2>
+  </div>
+
+EOF
+
+$all = $dbh->selectall_arrayref("SELECT id,date,announce FROM announces ORDER BY date DESC");
+  foreach my $row (@$all) {
+    my ($id, $date, $announce) = @$row;
+    print NEWS "<p><B>$date</B> $announce\n" if ((Date_Cmp($oldfirst,$date) >= 0));
+  }
+
+
+print NEWS << 'EOF';
+
+  <div class="h2-4">
+    <h2>Oldest News</h2>
+  </div>
+
+   <p>look at these pages for old News concerning the project</p>
+  <p><a href="gossip.html">Hugo's diary preserved (2001-2003)</a>
+  </p>
+
+<!--#include virtual="/bottom.shtml" -->
+  </body>
+</html>
+EOF
+
+close(NEWS);
+
+my $cpt = 4;
+open(NEWS,"> $lastnews") || die "Unable to open $lastnews (write)";
+$all = $dbh->selectall_arrayref("SELECT id,date,announce FROM announces ORDER BY date DESC");
+  foreach my $row (@$all) {
+    my ($id, $date, $announce) = @$row;
+    print NEWS "<p><B>$date</B> $announce\n" if ($cpt > 0);
+	$cpt--
+  }
+
+$dbh->disconnect;
Index: /0.8.1/pb/bin/pbdistrocheck
===================================================================
--- /0.8.1/pb/bin/pbdistrocheck	(revision 176)
+++ /0.8.1/pb/bin/pbdistrocheck	(revision 176)
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+#
+# Project Builder Distribution Checker
+#
+# $Id$
+#
+# Copyright B. Cornec 2007
+# Provided under the GPL v2
+
+use strict 'vars';
+use Data::Dumper;
+use lib qw (lib);
+use ProjectBuilder::Distribution qw (pb_distro_init);
+
+my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
+print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n";
Index: /0.8.1/pb/bin/mdv-changelog.pl
===================================================================
--- /0.8.1/pb/bin/mdv-changelog.pl	(revision 5)
+++ /0.8.1/pb/bin/mdv-changelog.pl	(revision 5)
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+#
+# Remove changelog from official mdv package and 
+# prepare the comment for the commit
+
+use strict;
+use File::Copy;
+
+open(FILE, $ARGV[0]) || die "Unable to open $ARGV[0]";
+open(OUT, "> $ENV{'PBTMP'}/out.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";
+open(CMT, "> $ENV{'PBTMP'}/cmt.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";
+while (<FILE>) {
+	if ($_ !~ /^\%changelog/) {
+		print OUT "$_";
+	} else {
+		# We found %changelog, that's the end for the spec
+		print OUT "$_";
+		close(OUT);
+		# Next line is the date + ver => unneeded
+		my $tmp = <FILE>;
+
+		# Get the first changelog set into the comment for SVN
+		while (<FILE>) {
+			if ($_ !~ /^[ 	]*$/) {
+				print CMT "$_";
+			} else {
+				# We found an empty line, that's the end for the cmt
+				close (CMT);
+				close (FILE);
+
+				move("$ENV{'PBTMP'}/out.spec", $ARGV[0]);
+				exit(0);
+			}
+		}
+	}
+
+}
Index: /0.8.1/pb/bin/mkannounce.pl
===================================================================
--- /0.8.1/pb/bin/mkannounce.pl	(revision 5)
+++ /0.8.1/pb/bin/mkannounce.pl	(revision 5)
@@ -0,0 +1,53 @@
+#!/usr/bin/perl -w
+#
+# Creates announces for new mondorescue version/tag
+# 
+# $Id$
+#
+# Syntax : mkannounce announce-file
+#
+
+use strict;
+use Date::Manip;
+use File::Basename;
+use DBI;
+use English;
+
+
+# For date handling
+$ENV{LANG}="C";
+
+my $PBROOT;
+my $tmp = dirname($PROGRAM_NAME);
+print "$tmp\n";
+if ($tmp =~ /^\//) {
+	$PBROOT = $tmp;
+	}
+else {
+	$PBROOT = "$ENV{PWD}/$tmp";
+	}
+
+my $db="$PBROOT/../website/announces3.sql";
+
+my $dbh = DBI->connect("dbi:SQLite:dbname=$db","","",
+			{ RaiseError => 1, AutoCommit => 1 }) 
+			|| die "Unable to connect to $db";
+
+my $date = &UnixDate("today","%Y-%m-%d");
+
+# To read whole file
+local $/;
+open(ANNOUNCE,$ARGV[0]) || die "Unable to open $ARGV[0] (read)";
+my $announce = <ANNOUNCE>;
+#$announce =~ s/\"/\"\"/g;
+#$announce =~ s/!//g;
+close(ANNOUNCE);
+
+print "INSERT INTO announces VALUES (NULL, $date, $announce)\n";
+my $sth = $dbh->prepare(qq{INSERT INTO announces VALUES (NULL,?,?)}) 
+		|| die "Unable to insert into $db";
+$sth->execute($date, $announce);
+#$dbh->do(qq(INSERT INTO announces VALUES (NULL, '$date', '$announce'))) 
+#|| die "Unable to insert into $db";
+
+$dbh->disconnect;
Index: /0.8.1/pb/bin/pbg
===================================================================
--- /0.8.1/pb/bin/pbg	(revision 155)
+++ /0.8.1/pb/bin/pbg	(revision 155)
@@ -0,0 +1,3 @@
+#!/bin/bash
+export LANGUAGE=C
+egrep -r $* . | egrep -v '\.svn|~:|binary' 
Index: /0.8.1/pb/bin/mkchangelog.pl
===================================================================
--- /0.8.1/pb/bin/mkchangelog.pl	(revision 5)
+++ /0.8.1/pb/bin/mkchangelog.pl	(revision 5)
@@ -0,0 +1,140 @@
+#!/usr/bin/perl -w
+#
+# Creates changelog for packages from Changelog files in the apps
+#
+# $Id$
+#
+# Syntax : mkchangelog dtype package-name output-file
+#
+
+use strict;
+use Date::Manip;
+use File::Basename;
+use English;
+
+my $log = "";
+my $dtype = $ARGV[0];
+my $pkg = $ARGV[1];
+my $pkg2;
+my $outfile = $ARGV[2];
+my $chglog = "";
+my $ndate = "";
+my $n2date = "";
+my $tmp = "";
+my $ver = "";
+my $ver2 = "";
+my $date = "";
+my $tag = "";
+
+# For date handling
+$ENV{LANG}="C";
+
+die "Syntax : mkchangelog dtype package-name output-file" 
+	if ((not (defined $dtype)) || ($dtype eq "") || 
+		(not (defined $pkg)) || ($pkg eq "") || 
+		(not (defined $outfile)) || ($outfile eq ""));
+
+my $PBROOT;
+$tmp = dirname($PROGRAM_NAME);
+if ($tmp =~ /^\//) {
+	$PBROOT = $tmp;
+	}
+else {
+	$PBROOT = "$ENV{PWD}/$tmp";
+	}
+
+die "PBROOT doesn't exist" if (not (defined $PBROOT));
+
+if (-f "$PBROOT/../$pkg/ChangeLog") {
+	$chglog = "$PBROOT/../$pkg/ChangeLog";
+	}
+else {
+	$pkg2 = $pkg;
+	$pkg2 =~ s/-..*//;
+	if (-f "$PBROOT/../$pkg2/ChangeLog") {
+		$chglog = "$PBROOT/../$pkg2/ChangeLog";
+		}
+	else {
+		die "Unable to find a ChangeLog file for $pkg\n";
+	}
+}
+$tmp="$PBROOT/../$pkg/TAG";
+if (-f "$tmp") {
+	open(TAG,"$tmp") || die "Unable to open $tmp";
+	$tag = <TAG>;
+	chomp($tag);
+} else {
+	die "Unable to find a TAG file for $pkg\n";
+}
+#print "Using $chglog as input ChangeLog file for $pkg\n";
+
+open(INPUT,"$chglog") || die "Unable to open $chglog (read)";
+open(OUTPUT,"> $outfile") || die "Unable to open $outfile (write)";
+
+# Skip first 4 lines
+$tmp = <INPUT>;
+$tmp = <INPUT>;
+$tmp = <INPUT>;
+if ($dtype eq "announce") {
+	print OUTPUT $tmp;
+}
+$tmp = <INPUT>;
+if ($dtype eq "announce") {
+	print OUTPUT $tmp;
+}
+
+my $first=1;
+
+# Handle each block separated by newline
+while (<INPUT>) {
+	($ver, $date) = split(/ /);
+	$ver =~ s/^v//;
+	chomp($date);
+	$date =~ s/\(([0-9-]+)\)/$1/;
+	#print "**$date**\n";
+	$ndate = UnixDate($date,"%a", "%b", "%d", "%Y");
+	$n2date = &UnixDate($date,"%a, %d %b %Y %H:%M:%S %z");
+	#print "**$ndate**\n";
+	if (($dtype eq "rpm") || ($dtype eq "fc")) {
+		if ($ver !~ /-/) {
+			if ($first eq 1) {
+				$ver2 = "$ver-$tag"."$ENV{suf}";
+				$first=0;
+			} else {
+				$ver2 = "$ver-1"."$ENV{suf}";
+			}
+		} else {
+			$ver2 = "$ver"."$ENV{suf}";
+		}
+		print OUTPUT "* $ndate Bruno Cornec <bruno\@mondorescue.org> $ver2\n";
+		print OUTPUT "- Updated to $ver\n";
+		}
+	if ($dtype eq "deb") {
+		print OUTPUT "$pkg ($ver) unstable; urgency=low\n";
+		print OUTPUT "\n";
+		}
+
+	$tmp = <INPUT>;	
+	while ($tmp !~ /^$/) {
+		if ($dtype eq "deb") {
+			print OUTPUT "  * $tmp";
+		} elsif ($dtype eq "rpm") {
+			print OUTPUT "$tmp";
+		} else {
+			print OUTPUT "$tmp";
+		}
+		last if (eof(INPUT));
+		$tmp = <INPUT>;
+	}
+	print OUTPUT "\n";
+
+	if ($dtype eq "deb") {
+		print OUTPUT " -- Bruno Cornec <bruno\@mondorescue.org>  $n2date\n\n";
+		print OUTPUT "\n";
+		}
+
+	last if (eof(INPUT));
+	last if ($dtype eq "announce");
+}
+close(OUTPUT);
+close(INPUT);
Index: /0.8.1/pb/bin/ptest.pl
===================================================================
--- /0.8.1/pb/bin/ptest.pl	(revision 2)
+++ /0.8.1/pb/bin/ptest.pl	(revision 2)
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Data::Dumper;
+
+sub get_cmds {
+
+	my $dumb;
+	my $f;
+
+	open (FILE,"/bin/busybox --help 2>&1|") or die "Unable to call busybox";
+	undef $/;
+	($dumb,$f) = split /functions:/,<FILE>;
+	close(FILE);
+	$f =~ s/\s//g;
+return (split /,/,$f);
+}
+
+# Should probably be an absolute path
+my $basedir = "symlinks";
+my $tarfile = "$basedir.tgz";
+
+print "Making tarfile $tarfile ...\n";
+
+system ("rm -rf $basedir");
+unlink $tarfile;
+
+mkdir $basedir,0755;
+mkdir "$basedir/usr",0755;
+mkdir "$basedir/usr/bin",0755;
+
+chdir "$basedir/usr/bin";
+for my $l (get_cmds) {
+	symlink "../../bin/busybox",$l;
+}
+
+chdir "../..";
+system("tar cfz ../$tarfile .");
+print "Done.\n";
+
Index: /0.8.1/pb/README
===================================================================
--- /0.8.1/pb/README	(revision 15)
+++ /0.8.1/pb/README	(revision 15)
@@ -0,0 +1,3 @@
+Introduction
+============
+
Index: /0.8.1/pb-doc/AppConfig::File.patch
===================================================================
--- /0.8.1/pb-doc/AppConfig::File.patch	(revision 39)
+++ /0.8.1/pb-doc/AppConfig::File.patch	(revision 39)
@@ -0,0 +1,23 @@
+--- /usr/lib/perl5/vendor_perl/5.8.8/AppConfig/File.pm.orig	2007-08-09 17:44:26.000000000 +0200
++++ /usr/lib/perl5/vendor_perl/5.8.8/AppConfig/File.pm	2007-08-09 18:04:46.000000000 +0200
+@@ -20,7 +20,7 @@
+ 
+ require 5.005;
+ 
+-use AppConfig;
++use AppConfig qw(:argcount);
+ use AppConfig::State;
+ use File::HomeDir;
+ 
+@@ -227,6 +227,11 @@
+ 
+ 		my $nargs = $state->_argcount($variable);
+ 
++		# Fix a bug if the variable is a hash - 1 has been created as a key
++		if ($nargs eq AppConfig::ARGCOUNT_HASH) {
++			delete $state->{ VARIABLE }->{ $variable }{1};
++		}
++
+ 		# variables prefixed '-' are reset to their default values
+ 		if ($flag eq '-') {
+ 		    $state->_default($variable);
Index: /0.8.1/pbconf/pb.pb
===================================================================
--- /0.8.1/pbconf/pb.pb	(revision 99)
+++ /0.8.1/pbconf/pb.pb	(revision 99)
@@ -0,0 +1,35 @@
+#
+# Project Builder configuration file
+# For project pb ;-)
+#
+# $Id$
+#
+#
+
+#
+# Global version/tag for the project
+#
+projver pb = devel
+projtag pb = 1
+
+# Adapt to your needs:
+# Optional if you need to overwrite the global values above
+#
+#pkgver project-builder = devel
+#pkgtag project-builder = 1
+pkgver nil
+pkgtag nil
+
+# Hash of default package/package directory
+defpkgdir project-builder = pb
+
+# Hash of additional package/package directory
+extpkgdir project-builder-doc = pb-doc
+
+# Hash of valid version names
+version devel
+version stable
+
+# List of files per pkg on which to apply filters
+# Files are mentioned relatively to pbroot/defpkgdir
+filteredfiles project-builder = Makefile.PL,lib/ProjectBuilder/Version.pm
Index: /0.8.1/pbconf/project-builder/pbfilter/rh.pbf
===================================================================
--- /0.8.1/pbconf/project-builder/pbfilter/rh.pbf	(revision 32)
+++ /0.8.1/pbconf/project-builder/pbfilter/rh.pbf	(revision 32)
@@ -0,0 +1,9 @@
+#
+# $Id$
+# 
+# Filter for redhat build
+#
+
+# PBGRP is replaced by the RPM group of apps
+filter PBGRP = Applications/Archiving
+
Index: /0.8.1/pbconf/project-builder/pbfilter/rpm.pbf
===================================================================
--- /0.8.1/pbconf/project-builder/pbfilter/rpm.pbf	(revision 174)
+++ /0.8.1/pbconf/project-builder/pbfilter/rpm.pbf	(revision 174)
@@ -0,0 +1,37 @@
+#
+# $Id$
+# 
+# Filter for rpm build
+#
+# PBSRC is replaced by the source package format
+filter PBSRC = ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.gz
+
+# PBGRP is replaced by the RPM group of apps
+filter PBGRP = System/Configuration/Packaging
+
+# PBDEP is replaced by the list of dependencies
+filter PBDEP = 
+
+# PBVER is replaced by the version ($pbver in code)
+filter PBVER = $pbver
+
+# PBDATE is replaced by the date ($pbdate in code)
+filter PBDATE = $pbdate
+
+# PBLOG is replaced by the changelog if value is yes
+filter PBLOG = yes
+
+# PBTAG is replaced by the tag ($pbtag in code)
+filter PBTAG = $pbtag
+
+# PBREV is replaced by the revision ($pbrev in code)
+filter PBREV = $pbrev
+
+# PBPKG is replaced by the package name ($pbpkg in code)
+filter PBPKG = $pbpkg
+
+# PBSUF is replaced by the package name ($pbpkg in code)
+filter PBSUF = $pbsuf
+
+# PBPACKAGER is replaced by the packager name ($pbpackager in code)
+filter PBPACKAGER = $pbpackager
Index: /0.8.1/pbconf/project-builder/pbfilter/suse.pbf
===================================================================
--- /0.8.1/pbconf/project-builder/pbfilter/suse.pbf	(revision 32)
+++ /0.8.1/pbconf/project-builder/pbfilter/suse.pbf	(revision 32)
@@ -0,0 +1,10 @@
+#
+# $Id$
+# 
+# Filter for redhat build
+#
+# PBSRC is replaced by the source package format
+filter PBSRC = ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.bz2
+
+# PBGRP is replaced by the RPM group of apps
+filter PBGRP = Applications/Archiving
Index: /0.8.1/pbconf/project-builder/rpm/project-builder.spec
===================================================================
--- /0.8.1/pbconf/project-builder/rpm/project-builder.spec	(revision 175)
+++ /0.8.1/pbconf/project-builder/rpm/project-builder.spec	(revision 175)
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+
+Summary:	Project Builder aka pb is a tool to produce packages for multiple distributions
+Summary(fr):	Project Builder ou pb est un programme pour produire des paquets pour diverses distributions
+
+Name:		PBPKG
+Version:	PBVER
+Release:	PBTAGPBSUF
+License:	GPL
+Group:		PBGRP
+Url:		http://www.mondorescue.org
+Source:		PBSRC
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
+BuildArch:	noarch
+Requires:	perl >= 5.8.4, perl-DateManip, perl-AppConfig, PBDEP
+Provides:	perl(ProjectBuilder::Changelog), perl(ProjectBuilder::Base), perl(ProjectBuilder::Distribution), perl(ProjectBuilder::Version)
+
+%description
+Project Builder aka pb is a tool to produce packages for multiple 
+distributions.
+It does that by minimizing the duplication of information required 
+and a set a very simple configuration files.
+
+%description -l fr
+Project Builder ou pb est un programme pour produire des paquets pour 
+diverses distributions.
+Il rÃ©alise cela en minimisant la duplication des informations requises 
+et par un jeu de fichiers de configuration trÃšs simples.
+
+%prep
+%setup -q
+
+%build
+%{__perl} Makefile.PL
+%make
+
+%install
+%{__rm} -rf %{buildroot}
+%makeinstall_std
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%doc ChangeLog svn.log
+%doc INSTALL COPYING README AUTHORS contrib/pbsetupqemu
+
+%{perl_vendorlib}
+#%{_mandir}/*/*
+%{_bindir}/*
+
+%changelog
+PBLOG
