[Koha-cvs] CVS: koha/misc barcodes.pl,NONE,1.1 buildrelease,NONE,1.1 installer-lite.pl,NONE,1.1 installer.pl,NONE,1.1 install-sh,NONE,1.1 koha.conf,NONE,1.1 koha.mysql,NONE,1.1 sampledata-1.2,NONE,1.1 testKoha.pl,NONE,1.1

Paul POULAIN tipaul at users.sourceforge.net
Fri Nov 22 10:05:20 CET 2002


Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv1830

Added Files:
	barcodes.pl buildrelease installer-lite.pl installer.pl 
	install-sh koha.conf koha.mysql sampledata-1.2 testKoha.pl 
Log Message:
moving non koha-running files to misc dir

--- NEW FILE ---
#!/usr/bin/perl



####################
# Variable Section #
####################

# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

my $pretext='T ';
my $startnumber=1000;
my $pages=2;
my $libraryname='Copper Mountain Elementary';

# Shifts are given in millimeters. Positive numbers move up and to the right.
# These variables shift the whole page to account for printer differences.
my $shiftx=0;
my $shifty=0;

####################



my $leftmargin=5;
my $rightmargin=3;
my $topmargin=18;
my $botmargin=10;


my $rightside=215;
my $topside=280;


my $barcodewidth=length("$pretext$startnumber")+2;

my $bcwidthfactor=8-$barcodewidth/2;
print STDERR "$barcodewidth $bcwidthfactor\n";

my $width=$rightside-($leftmargin+$rightmargin);
my $height=$topside-$topmargin-$botmargin;

print << "EOF";
%!PS-Adobe-2.0
%%Title: barcode.ps
%%Creator: Willem van Schaik
%%CreationDate: aug 1992
%%Pages: 1
%%DocumentFonts: Helvetica Code39
%%BoundingBox: 0 0 595 842
%%EndComments

/newfont 10 dict def
newfont begin
/FontType 3 def
/FontMatrix [0.01 0 0 0.01 0 0] def
/FontBBox [0 0 100 100] def

/Encoding 256 array def
0 1 255 {Encoding exch /.notdef put} for
Encoding 32 /barSpace put
Encoding 36 /barDollar put
Encoding 37 /barPercent put
Encoding 42 /barAsterisk put
Encoding 43 /barPlus put
Encoding 45 /barHyphen put
Encoding 46 /barPeriod put
Encoding 47 /barSlash put
Encoding 48 /bar0 put
Encoding 49 /bar1 put
Encoding 50 /bar2 put
Encoding 51 /bar3 put
Encoding 52 /bar4 put
Encoding 53 /bar5 put
Encoding 54 /bar6 put
Encoding 55 /bar7 put
Encoding 56 /bar8 put
Encoding 57 /bar9 put
Encoding 65 /barA put
Encoding 66 /barB put
Encoding 67 /barC put
Encoding 68 /barD put
Encoding 69 /barE put
Encoding 70 /barF put
Encoding 71 /barG put
Encoding 72 /barH put
Encoding 73 /barI put
Encoding 74 /barJ put
Encoding 75 /barK put
Encoding 76 /barL put
Encoding 77 /barM put
Encoding 78 /barN put
Encoding 79 /barO put
Encoding 80 /barP put
Encoding 81 /barQ put
Encoding 82 /barR put
Encoding 83 /barS put
Encoding 84 /barT put
Encoding 85 /barU put
Encoding 86 /barV put
Encoding 87 /barW put
Encoding 88 /barX put
Encoding 89 /barY put
Encoding 90 /barZ put

/CharProcs 45 dict def
CharProcs begin
/.notdef {} def
/barSpace {0 7 17 17 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barDollar {0 7 17 7 17 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPercent {0 7 7 7 17 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barAsterisk {0 7 17 7 7 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPlus {0 7 17 7 7 7 17 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barHyphen {0 7 17 7 7 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barPeriod {0 17 17 7 7 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barSlash {0 7 17 7 17 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar0 {0 7 7 7 17 17 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar1 {0 17 7 7 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar2 {0 7 7 17 17 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar3 {0 17 7 17 17 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar4 {0 7 7 7 17 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar5 {0 17 7 7 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar6 {0 7 7 17 17 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar7 {0 7 7 7 17 7 7 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar8 {0 17 7 7 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/bar9 {0 7 7 17 17 7 7 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barA {0 17 7 7 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barB {0 7 7 17 7 7 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barC {0 17 7 17 7 7 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barD {0 7 7 7 7 17 17 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barE {0 17 7 7 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barF {0 7 7 17 7 17 17 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barG {0 7 7 7 7 7 17 17 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barH {0 17 7 7 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barI {0 7 7 17 7 7 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barJ {0 7 7 7 7 17 17 17 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barK {0 17 7 7 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barL {0 7 7 17 7 7 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barM {0 17 7 17 7 7 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barN {0 7 7 7 7 17 7 7 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barO {0 17 7 7 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barP {0 7 7 17 7 17 7 7 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barQ {0 7 7 7 7 7 7 17 17 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barR {0 17 7 7 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barS {0 7 7 17 7 7 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barT {0 7 7 7 7 17 7 17 17 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barU {0 17 17 7 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barV {0 7 17 17 7 7 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barW {0 17 17 17 7 7 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barX {0 7 17 7 7 17 7 7 7 17 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barY {0 17 17 7 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
/barZ {0 7 17 17 7 17 7 7 7 7 newpath 93 0 moveto 5 {dup 0 100 rlineto
neg 0 rlineto 0 -100 rlineto closepath add neg 0 rmoveto} repeat fill} def
end

/BuildChar
{ 100 0 0 0 93 100 setcachedevice
  exch
  begin
    Encoding exch get
    CharProcs exch get
    end
  exec
} def
end

/Code39 newfont definefont pop

%%EndProlog

EOF

my $number=$startnumber;
while ($page<$pages) {
    my $data='';
    for ($i=$leftmargin; $i<$rightside-$rightmargin; $i+=$width/4) {
	for ($j=$botmargin; $j<$topside-$topmargin-$botmargin; $j+=$height/20) {
	    my $x=$i+$width/8;
	    my $y=$j+$height/40;
	    my $schooly=$y+5.8;
	    my $labely=$y-2.2;
	    my $lox=$x-2;
	    my $hix=$x+2;
	    my $loy=$y-2;
	    my $hiy=$y+2;
	    $data.=<<"EOF";
$x $y moveto
/Code39 findfont [$bcwidthfactor 0 0 5 0 0] makefont setfont
(*$pretext$number*) dup stringwidth pop 2 div neg 0 rmoveto show
/Helvetica findfont 1.7 scalefont setfont
$x $schooly moveto
($schoolname) dup stringwidth pop 2 div neg 0 rmoveto show
/Helvetica findfont 2.3 scalefont setfont
$x $labely moveto
($pretext$number) dup stringwidth pop 2 div neg 0 rmoveto show


EOF
	    $number++;
	}
    }


    $page++;
    print << "EOF";
%%Page: $page $page
%%PagerFonts:

$shiftx $shifty translate
72 25.4 div dup scale

/Code39 findfont [4 0 0 5 0 0] makefont setfont
/Times-Roman findfont
1 scalefont
setfont
$data





showpage


EOF
}
print "%%Trailer\n";

--- NEW FILE ---
#!/usr/bin/perl

sub guess_kohahtmldir ($;$);
#----------------------------------------------------------
# DIRECTORIES where source code is located
#----------------------------------------------------------
my $kohadir=`pwd`;
chomp $kohadir;
my $kohahtmldir=guess_kohahtmldir($kohadir, "/koha/koha/koha-html/");
my $roothomedir=(getpwuid(0))[7];	# ~root is traditionally just /
$roothomedir='/root' unless defined $roothomedir;

my $has_kohaautobuild_conf = 0;

if (-e "$roothomedir/.kohaautobuild.conf") {
    open C, "<$roothomedir/.kohaautobuild.conf";
    while (<C>) {
	chomp;
	if (/kohadir=(.*)/) {
	    $kohadir=$1;
	}
	if (/kohahtmldir=(.*)/) {
	    $kohahtmldir=$1;
	}
    }
    $has_kohaautobuild_conf = 1;
}

my $input;

print qq |
***************************************
* Welcome to the Koha Release Builder *
***************************************

This script will automatically build a release tarball.

The script assumes that you already have the koha and koha-html modules checked
out for the release that you want to build, although it will update the modules
before building.

|;
print "\nWhere is the 'koha' cvs module located [$kohadir]: ";
chomp($input = <STDIN>);
if ($input) {
    $kohadir=$input;
    $kohahtmldir=guess_kohahtmldir($kohadir, $kohahtmldir) unless $has_kohaautobuild_conf;
}


print "\nWhere is the 'koha-html' cvs module located [$kohahtmldir]: ";
chomp($input = <STDIN>);
if ($input) {
    $kohahtmldir=$input;
}

open (C, ">$roothomedir/.kohaautobuild.conf");
print C qq|
kohadir=$kohadir
kohahtmldir=$kohahtmldir
|;

#----------------------------------------------------------
# which VERSION are we building ?
#----------------------------------------------------------
print "\n\nGuessing at next release version.  You may need to enter your SourceForge password...\n";
open (CVSLOG, "cvs log buildrelease|");
my $symbolicnamessection=0;
my $symbolicnames;
my $highestversion;
my $highestrc;
my $released;
my $majorversion;
my $majorversionrc;
while (<CVSLOG>) {
    if (/^symbolic names:/) {
	$symbolicnamessection=1;
    }
    if ($symbolicnamessection && (/^\s+([^:]*):/)) {
	my $tag=$1;
	if ($tag=~/R_(.*)/) {
	    my $version='';
	    my $rc=0;
	    my $id=$1;
	    $id=~s/-/\./g;
	    if ($id =~/(.*)RC(.*)/) {
		$version=$1;
		$rc=$2;
		$version=~m#(\d+\.\d+)\.#;
		if (versioncompare($version, $majorversion->{$1})) {
		    $majorversion->{$1}=$version;
		    $majorversionrc->{$1}=$rc;
		}
		if (versioncompare($version, $highestversion)) {
		    $highestversion=$version;
		    $released=0;
		    $highestrc=$rc;
		}
	    } else {
		$version=$id;
		$version=~m#(\d+\.\d+)\.#;
		if (versioncompare($version, $majorversion->{$1})) {
		    $majorversion->{$1}=$version;
		    $majorversionrc->{$1}=0;
		}
		if (versioncompare($version, $highestversion)) {
		    $highestversion=$version;
		    $released=1;
		    $highestrc=0;
		}
	    }
	    $symbolicnames->{$version}->{$rc}=1;
	}
    }
}


my $releaseversion='';
my $currentversion='';

my $branchdata=`grep buildrelease CVS/Entries`;
chomp $branchdata;
my $branch=(split(m#/#, $branchdata))[5];

if ($branch eq 'Trel-1-2') {
    $highestversion=$majorversion->{'1.2'};
    $highestrc=$majorversionrc->{'1.2'};
    ($highestrc) ? ($released=0) : ($released=1);
}

if ($released) {
    my @components=split(/\./, $highestversion);
    $components[$#components]++;
    $nexthighestversion=join '.', @components;
    my $minornumber=(split(/\./, $highestversion))[1];
    if ($minornumber/2 == int($minornumber/2)) {
	$releaseversion=$nexthighestversion."RC1";
    } else {
	$releaseversion=$nexthighestversion;
    }
    $currentversion=$highestversion;
} else {
    $releaseversion=$highestversion."RC".($highestrc+1);
    $currentversion=$highestversion."RC$highestrc";
}


print "Current release tag is $currentversion.\n";
print "\nWould you like to bump that up to $releaseversion (or manually enter version)?  [Y]/N: ";
chomp($input = <STDIN>);
my $tagging_needs_confirmation = 0;
if ($input =~ /^n/i) {
    print "\nWould you like to rebuild the $currentversion tarball?  Y/[N]: ";
    chomp($input = <STDIN>);
    print STDERR "releaseversion=($releaseversion), currentversion=($currentversion)\n";#XXXZZZ
    if ($input =~ /^y/i) {
	$releaseversion=$currentversion;
	$tagging_needs_confirmation = 1;
    } else {
	print "What should the new version be? [$releaseversion]: ";
	chomp ($input=<STDIN>);
	if ($input) {
	    $releaseversion=$input;
	}
    }
} else {
    print "What should the new version be? [$releaseversion]: ";
    chomp ($input=<STDIN>);
    if ($input) {
	$releaseversion=$input;
    }
}


print "\nWould you like to tag the CVS repository?\n(answer yes if releasing tarball)  Y/[N]: ";
chomp ($input=<STDIN>);
my $cvstag=0;
# FIXME: This means anything other than n will tag; too dangerous?
if ($input=~/^y/i) {
    $cvstag=1;
}


if ($cvstag && $tagging_needs_confirmation) {
	print "\n\n";
	print "Do not do this if you have released the tarball to anybody, as it will\n";
	print "overwrite the tag marking the files that were in the tarball:\n\n";
	print "Confirm that you want to overwrite the tag for $releaseversion? Y/[N]: ";
	chomp($input = <STDIN>);
	if ($input =~ /^n/i || $input !~ /\S/) {
	    print "\nStopping.  Please re-run buildrelease now.\n";
	    exit;
	}
}


my $sfuserid='';
if ($cvsroot=$ENV{'CVSROOT'}) {
    $cvsroot=~m#(.*)\@cvs#;
    $sfuserid=$1;
} else {
    $ENV{'CVS_RSH'}='ssh';
    print "\nWhat is your userid at SourceForge: ";
    chomp($input = <STDIN>);
    if ($input) {
	$sfuserid=$input;
    }
    $ENV{'CVSROOT'}="$sfuserid\@cvs.koha.sourceforge.net:/cvsroot/koha";
}
my $tagname=$releaseversion;
$tagname=~s/\./-/g;

print qq|
Updating your checked-out copy of the 'koha' CVS files.
You may need to enter your SourceForge password.
Using $kohadir.
|;
chdir($kohadir);
system("cvs update");
if ($cvstag) {
    print qq|
Tagging koha with tag R_$tagname
|;
    system("cvs tag -F R_$tagname");
}
print qq|
Updating your checked-out copy of the 'koha-html' CVS files.
You may need to enter your SourceForge password.
Using $kohahtmldir.
|;
chdir($kohahtmldir) || die "$kohahtmldir: $!\n";
system("cvs update");

if ($cvstag) {
    print qq|
Tagging koha-html with tag R_$tagname
|;
    system("cvs tag -F R_$tagname");
}

#----------------------------------------------------------
# MOVE files to /tmp and build tar.gz
#----------------------------------------------------------
my $rootdir="/tmp/koha-".$releaseversion;
system("rm -rf $rootdir");
mkdir ($rootdir, 0700);
chdir($rootdir) || die "$rootdir: $!\n";

mkdir("intranet-cgi", 0755);
mkdir("intranet-html", 0755);
mkdir("opac-cgi", 0755);
mkdir("opac-html", 0755);
mkdir("scripts", 0755);
mkdir("scripts/z3950daemon", 0755);
mkdir("modules", 0755);
mkdir("docs", 0755);

# Create koha.version file
open (KV, ">$rootdir/koha.version");
print KV "$releaseversion\n";
close KV;

# Copy all CVS files to intranet-cgi
system("cp -a $kohadir/* $rootdir/intranet-cgi");

# Move C4 to modules directory
system("mv $rootdir/intranet-cgi/C4 $rootdir/modules");

# Move files from intranet-cgi to root of tarball
system("mv $rootdir/intranet-cgi/INSTALL $rootdir");
system("mv $rootdir/intranet-cgi/ChangeLog* $rootdir");
system("mv $rootdir/intranet-cgi/Hints $rootdir");
system("mv $rootdir/intranet-cgi/LICENSE $rootdir");
system("mv $rootdir/intranet-cgi/News $rootdir");
system("mv $rootdir/intranet-cgi/README $rootdir");
system("mv $rootdir/intranet-cgi/TODO $rootdir");
system("mv $rootdir/intranet-cgi/installer.pl $rootdir");
system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir");
system("mv $rootdir/intranet-cgi/Install.pm $rootdir");
system("mv $rootdir/intranet-cgi/kohareporter $rootdir");
chmod 0770, "$rootdir/installer.pl";
chmod 0770, "$rootdir/koha.upgrade";
system("mv $rootdir/intranet-cgi/koha.conf $rootdir");
system("mv $rootdir/intranet-cgi/koha.mysql $rootdir");
system("mv $rootdir/intranet-cgi/sampledata-1.2 $rootdir");
system("gzip -9 $rootdir/sampledata-1.2");

# Copy files from intranet-cgi to opac-cgi
system("cp $rootdir/intranet-cgi/detail.pl $rootdir/opac-cgi");
system("cp $rootdir/intranet-cgi/moredetail.pl $rootdir/opac-cgi");
system("cp $rootdir/intranet-cgi/search.pl $rootdir/opac-cgi");
system("cp $rootdir/intranet-cgi/subjectsearch.pl $rootdir/opac-cgi");
system("cp $rootdir/intranet-cgi/logout.pl $rootdir/opac-cgi");
system("mv $rootdir/intranet-cgi/opac/* $rootdir/opac-cgi");
system("rmdir $rootdir/intranet-cgi/opac");


# Move files from intranet-cgi to /scripts/ directory
system("mv $rootdir/intranet-cgi/telnet $rootdir/scripts");
system("mv $rootdir/intranet-cgi/tkperl $rootdir/scripts");
system("mv $rootdir/intranet-cgi/translator $rootdir/scripts");
system("mv $rootdir/intranet-cgi/updater $rootdir/scripts");
system("mv $rootdir/intranet-cgi/misc $rootdir/scripts");
system("mv $rootdir/intranet-cgi/marc $rootdir/scripts");
system("mv $rootdir/intranet-cgi/acqui.simple/bulkmarcimport.pl $rootdir/scripts/z3950daemon/");
system("mv $rootdir/intranet-cgi/acqui.simple/processz3950queue $rootdir/scripts/z3950daemon/");
system("mv $rootdir/intranet-cgi/acqui.simple/z3950-daemon-launch.sh $rootdir/scripts/z3950daemon/");
system("mv $rootdir/intranet-cgi/acqui.simple/z3950-daemon-shell.sh $rootdir/scripts/z3950daemon/");


# Remove extraneous files from intranet-cgi
system("rm -f $rootdir/intranet-cgi/ChangeLog.bak");
system("rm -f $rootdir/intranet-cgi/SendMessages");
system("rm -f $rootdir/intranet-cgi/buildrelease");
system("rm -f $rootdir/intranet-cgi/database.mysql");
system("rm -f $rootdir/intranet-cgi/installer-lite.pl");
# FIXME: The following two lines look suspicious
#system("rm -f $rootdir/intranet-cgi/koha-1.2.0.tar.gz");
#system("rm -f $rootdir/intranet-cgi/rel-1-2");
system("rm -f $rootdir/intranet-cgi/testKoha.pl");
system("rm -rf $rootdir/intranet-cgi/html-template");
system("rm -rf $rootdir/intranet-cgi/t");

# Set all .pl scripts executable
system("find $rootdir/intranet-cgi -name '*.pl' -exec chmod a+x \\{\\} \\;");
# Copy all CVS files to intranet-html and opac-html
system("cp -a $kohahtmldir/intranet-html/* $rootdir/intranet-html");
system("cp -a $kohahtmldir/opac-html/* $rootdir/opac-html");

# Move koha-tmpl files
system("mv $rootdir/intranet-cgi/koha-tmpl/opac-tmpl/* $rootdir/opac-html");
system("mv $rootdir/intranet-cgi/koha-tmpl/intranet-tmpl/* $rootdir/intranet-html");
system("rm -rf $rootdir/intranet-cgi/koha-tmpl");

# Remove extraneous files from opac-html
system("rm -f $rootdir/opac-html/koha.mo");
system("rm -f $rootdir/opac-html/koha.pot");
system("rm -f $rootdir/opac-html/test");

# Remove extraneous files from intranet-html
system("rm -f $rootdir/intranet-html/koha.pot");
system("rm -f $rootdir/intranet-html/results.html");
system("rm -f $rootdir/intranet-html/test");

# Remove junk from directory
system("find $rootdir -name CVS -exec rm -rf \\{\\} \\; 2>/dev/null");
system("find $rootdir -name *~ -exec rm -rf \\{\\} \\; 2>/dev/null");
system("find $rootdir -name .#* -exec rm -rf \\{\\} \\; 2>/dev/null");


if (-e "$roothomedir/docs") {
    print "Copying docs folder from $roothomedir/docs...";
    system("cp -r $roothomedir/docs/* $rootdir/docs/");
} else {
    print "I would have copied the docs from from $roothomedir/docs, but I couldn't find it.\n";
    print "Press <ENTER> to continue...\n";
    <STDIN>;
}

chdir("/tmp");
system("tar czf /tmp/koha-$releaseversion.tar.gz koha-".$releaseversion);
system("rm -rf $rootdir");

print qq|
============
= ALL DONE =
============

Your new tarball is located in /tmp/koha-$releaseversion.tar.gz

|;


sub versioncompare {
    my $v1=shift;
    my $v2=shift;
    my @v1=split(/\./, $v1);
    my @v2=split(/\./, $v2);
    my $count=$#v1;
    ($#v2>$count) && ($count=$#v2);
    for (my $index=0; $index<$count; $index++) {
	if ($v1[$index]>$v2[$index]) {
	    return 1;
	}
    }
    return 0;
}

sub guess_kohahtmldir ($;$) {
    my($kohadir, $default) = @_;
    my $kohahtmldir;
    # It probably makes sense to assume that the 'koha' and 'koha-html'
    # modules are checked out within the same parent directory
    if (-d $kohadir && $kohadir =~ /^(.*)\/[^\/]+$/) {
	$kohahtmldir = "$1/koha-html"
    } else {
	$kohahtmldir = $default;
    }
    return $kohahtmldir;
}

--- NEW FILE ---
#!/usr/bin/perl -w # please develop with -w

# $Id: installer-lite.pl,v 1.1 2002/11/22 09:05:18 tipaul Exp $

# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

use diagnostics;
use strict; # please develop with the strict pragma

system('clear');
print qq|
*******************************************
* Welcome to the Koha Installation Guide  *
*******************************************

This installer will guide you through the process of installing Koha.
It is not a completely automated installation, but a guide for further
information please read the documentation or visit the Koha website at
http://www.koha.org

To successfully use Koha you need some additional software:

* A webserver (It was built to work with Apache, but there is no reason
it should not work with any other webserver).

* Mysql (You could intead use postgres, or another sql based database)

* Perl

Are you ready to go through the installation process now? (Y/[N]):
|;

my $answer = <STDIN>;
chomp $answer;

if ($answer eq "Y" || $answer eq "y") {
	print "Beginning setup... \n";
    } else {
    print qq|
When you are ready to complete the installation just run this installer again.
|;
    exit;
};

print "\n";


#
# Test for Perl - Do we need to explicity check versions?
#
print "\nChecking that perl and the required modules are installed ...\n";
    unless (eval "require 5.004") {
    die "Sorry, you need at least Perl 5.004\n";
}

#
# Test for Perl Dependancies
#
my @missing = ();
unless (eval require DBI)               { push @missing,"DBI" };
unless (eval require Date::Manip)       { push @missing,"Date::Manip" };
unless (eval require DBD::mysql)        { push @missing,"DBD::mysql" };

#
# Print out a list of any missing modules
#
if (@missing > 0) {
    print "\n\n";
    print "You are missing some Perl modules which are required by Koha.\n";
    print "Once these modules have been installed, rerun this installery.\n";
    print "They can be installed by running (as root) the following:\n";
    foreach my $module (@missing) {
	print "   perl -MCPAN -e 'install \"$module\"'\n";
	exit(1);
    }} else{
    print "Perl and required modules appear to be installed, continuing...\n";
};


print "\n";

#
#KOHA conf
#
print qq|
Koha uses a small configuration file that is usually placed in your
/etc/ files directory (note: if you wish to place the koha.conf in
another location you will need to manually edit additional files).

We will help you to now create your koha.conf file, once this file
has been created, please copy it to your destination folder
(note: this may need to be done by your systems administrator).
|;

my $dbname;
my $hostname;
my $user;
my $pass;
my $inc_path;

print "\n";
print "\n";
print qq|
Please provide the name of the mysql database that you wish to use
for koha. This is normally "Koha".
|;

#Get the database name
do {
	print "Enter database name:";
	chomp($dbname = <STDIN>);
};


print "\n";
print "\n";
print qq|
Please provide the hostname for mysql.  Unless the database is located
on another machine this is likely to be "localhost".
|;

#Get the hostname for the database
do {
	print "Enter hostname:";
	chomp($hostname = <STDIN>);
};


print "\n";
print "\n";
print qq|
Please provide the name of the mysql user, who will have full administrative
rights to the $dbname database, when authenicating from $hostname.
It is recommended that you do not use your "root" user.
|;

#Set the username for the database
do {
	print "Enter username:";
	chomp($user = <STDIN>);
};


print "\n";
print "\n";
print qq|
Please provide a password for the mysql user $user.
|;

#Set the password for the database user
do {
	print "Enter password:";
	chomp($pass = <STDIN>);
};

print "\n";
print "\n";
print qq|
Please provide the full path to your Koha Intranet/Librarians installation.
Usually /usr/local/www/koha/htdocs
|;

#Get the password for the database user
do {
	print "Enter installation path:";
	chomp($inc_path = <STDIN>);
};


#Create the configuration file
open(SITES,">koha.conf") or die "Couldn't create file.
Must have write capability.\n";
print SITES <<EOP
database=$dbname
hostname=$hostname
user=$user
password=$pass
includes=$inc_path/includes
EOP
;
close(SITES);

print "Successfully created the Koha configuration file.\n";

print "\n";

#
#SETUP Virtual Host Directives
#
#OPAC Settings
#
my $opac_svr_admin;
my $opac_docu_root;
my $opac_svr_name;

print qq|
You need to setup your Apache configuration file for the
OPAC virtual host.

Please enter the servername for the OPAC interface.
Usually opac.your.domain
|;
do {
	print "Enter servername address:";
	chomp($opac_svr_name = <STDIN>);
};


print qq|
Please enter the e-mail address for your webserver admin.
Usually webmaster\@your.domain
|;
do {
	print "Enter e-mail address:";
	chomp($opac_svr_admin = <STDIN>);
};


print qq|
Please enter the full path to your OPAC\'s document root.
usually something like \"/usr/local/www/opac/htdocs\".
|;
do {
	print "Enter Document Roots Path:";
	chomp($opac_docu_root = <STDIN>);
};


#
# Update Apache Conf File.
#
open(SITES,">>koha-apache.conf") or die "Couldn't write to file.
Must have write capability.\n";
print SITES <<EOP

<VirtualHost $opac_svr_name>
    ServerAdmin $opac_svr_admin
    DocumentRoot $opac_docu_root
    ServerName $opac_svr_name
    ErrorLog logs/opac-error_log
    TransferLog logs/opac-access_log common
</VirtualHost>

EOP
;
close(SITES);


#
#Intranet Settings
#
my $intranet_svr_admin;
my $intranet_svr_name;

print qq|
You need to setup your Apache configuration file for the
Intranet/librarian virtual host.

Please enter the servername for your Intranet/Librarian interface.
Usually koha.your.domain
|;
do {
	print "Enter servername address:";
	chomp($intranet_svr_name = <STDIN>);
};


print qq|
Please enter the e-mail address for your webserver admin.
Usually webmaster\@your.domain
|;
do {
	print "Enter e-mail address:";
	chomp($intranet_svr_admin = <STDIN>);
};



#
# Update Apache Conf File.
#
open(SITES,">>koha-apache.conf") or die "Couldn't write to file.
Must have write capability.\n";
print SITES <<EOP

<VirtualHost $intranet_svr_name>
    ServerAdmin $intranet_svr_admin
    DocumentRoot $inc_path
    ServerName $intranet_svr_name
    ErrorLog logs/opac-error_log
    TransferLog logs/opac-access_log common
</VirtualHost>

EOP
;
close(SITES);


print "Successfully created the Apache Virtual Host Configuration file.\n";

system('clear');
print qq|
*******************************************
* Koha Installation Guide - Continued     *
*******************************************

In order to finish the installation of Koha, there is still a couple
of steps that you will need to complete.

  * Setup mysql
	1. Create a new mysql database called for example Koha
	   From command line: mysqladmin -uroot -ppassword create Koha

	2. Set up a koha user and password in mysql
           Log in to mysql: mysql -uroot -ppassword

	   To create a user called "koha" who has full administrative
	   rights to the "Koha" database when authenticating from
	   "localhost", enter the following on mysql command line:

	    grant all privileges on Koha.* to koha\@localhost identified by 'kohapassword'\;

	   Press ENTER, and if you see no errors then enter \q to quit mysql.


	3. Use the mysql script to create the tables
	   mysql -uusername -ppassword Koha < koha.mysql

	4. Update your database tables
	   perl updatedatabase -I /pathtoC4

	5. Update your database to use MARC
	   perl marc/fill_usmarc.pl -I /pathtoC4 to put MARC21 - english datas in parameter table
	   perl marc/updatedb2marc.pl -I /pathtoC4 to update biblios from old-DB to MARC-DB (!!! it may be long : 30 biblios/second)

  * Koha.conf
	1. Copy Koha.conf to /etc/
	   If you wish to locate the file in another location please read
	   the INSTALL and Hints files.


|;
#
# It is completed
#
print "\nCongratulations ... your Koha installation is complete!\n";
print "\nYou will need to restart your webserver before using Koha!\n";

--- NEW FILE ---
#!/usr/bin/perl -w # please develop with -w

# $Id: installer.pl,v 1.1 2002/11/22 09:05:18 tipaul Exp $

#use diagnostics;

# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
[...989 lines suppressed...]

my $restart = <STDIN>;
chomp $restart;

if ($restart=~/^y/i) {
	# Need to support other init structures here?
	if (-e "/etc/rc.d/init.d/httpd") {
	    system('/etc/rc.d/init.d/httpd restart');
	} elsif (-e "/etc/init.d/apache") {
	    system('/etc//init.d/apache restart');
	} elsif (-e "/etc/init.d/apache-ssl") {
	    system('/etc/init.d/apache-ssl restart');
	}
    } else {
	print qq|
Congratulations ... your Koha installation is complete!
You will need to restart your webserver before using Koha!
|;
    exit;
};

--- NEW FILE ---
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission.  M.I.T. makes no representations about the
# suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.


# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"


# put in absolute paths if you don't have them in your path; or use env. vars.

mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"

transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""

while [ x"$1" != x ]; do
    case $1 in
	-c) instcmd="$cpprog"
	    shift
	    continue;;

	-d) dir_arg=true
	    shift
	    continue;;

	-m) chmodcmd="$chmodprog $2"
	    shift
	    shift
	    continue;;

	-o) chowncmd="$chownprog $2"
	    shift
	    shift
	    continue;;

	-g) chgrpcmd="$chgrpprog $2"
	    shift
	    shift
	    continue;;

	-s) stripcmd="$stripprog"
	    shift
	    continue;;

	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
	    shift
	    continue;;

	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
	    shift
	    continue;;

	*)  if [ x"$src" = x ]
	    then
		src=$1
	    else
		# this colon is to work around a 386BSD /bin/sh bug
		:
		dst=$1
	    fi
	    shift
	    continue;;
    esac
done

if [ x"$src" = x ]
then
	echo "install:	no input file specified"
	exit 1
else
	true
fi

if [ x"$dir_arg" != x ]; then
	dst=$src
	src=""
	
	if [ -d $dst ]; then
		instcmd=:
		chmodcmd=""
	else
		instcmd=mkdir
	fi
else

# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad 
# if $src (and thus $dsttmp) contains '*'.

	if [ -f $src -o -d $src ]
	then
		true
	else
		echo "install:  $src does not exist"
		exit 1
	fi
	
	if [ x"$dst" = x ]
	then
		echo "install:	no destination specified"
		exit 1
	else
		true
	fi

# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic

	if [ -d $dst ]
	then
		dst="$dst"/`basename $src`
	else
		true
	fi
fi

## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`

# Make sure that the destination directory exists.
#  this part is taken from Noah Friedman's mkinstalldirs script

# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='	
'
IFS="${IFS-${defaultIFS}}"

oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"

pathcomp=''

while [ $# -ne 0 ] ; do
	pathcomp="${pathcomp}${1}"
	shift

	if [ ! -d "${pathcomp}" ] ;
        then
		$mkdirprog "${pathcomp}"
	else
		true
	fi

	pathcomp="${pathcomp}/"
done
fi

if [ x"$dir_arg" != x ]
then
	$doit $instcmd $dst &&

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else

# If we're going to rename the final executable, determine the name now.

	if [ x"$transformarg" = x ] 
	then
		dstfile=`basename $dst`
	else
		dstfile=`basename $dst $transformbasename | 
			sed $transformarg`$transformbasename
	fi

# don't allow the sed command to completely eliminate the filename

	if [ x"$dstfile" = x ] 
	then
		dstfile=`basename $dst`
	else
		true
	fi

# Make a temp file name in the proper directory.

	dsttmp=$dstdir/#inst.$$#

# Move or copy the file name to the temp name

	$doit $instcmd $src $dsttmp &&

	trap "rm -f ${dsttmp}" 0 &&

# and set any options; do chmod last to preserve setuid bits

# If any of these fail, we abort the whole thing.  If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&

# Now rename the file to the real destination.

	$doit $rmcmd -f $dstdir/$dstfile &&
	$doit $mvcmd $dsttmp $dstdir/$dstfile 

fi &&


exit 0

--- NEW FILE ---
database=koha
hostname=localhost
user=Koha
pass=password

--- NEW FILE ---
# MySQL dump 7.1
#
# Host: localhost    Database: c4test
#--------------------------------------------------------
# Server version	3.22.32-log

#
# Table structure for table 'accountlines'
#
CREATE TABLE accountlines (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  accountno smallint(6) DEFAULT '0' NOT NULL,
  itemnumber int(11),
  date date,
  amount decimal(28,6),
  description text,
  dispute text,
  accounttype varchar(5),
  amountoutstanding decimal(28,6),
  timestamp timestamp(14),
  KEY acctsborridx (borrowernumber),
  KEY timeidx (timestamp)
);

#
# Table structure for table 'accountoffsets'
#
CREATE TABLE accountoffsets (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  accountno smallint(6) DEFAULT '0' NOT NULL,
  offsetaccount smallint(6) DEFAULT '0' NOT NULL,
  offsetamount decimal(28,6),
  timestamp timestamp(14)
);

#
# Table structure for table 'additionalauthors'
#
CREATE TABLE additionalauthors (
  author text NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  KEY bibidx (biblionumber)
);

#
# Table structure for table 'aqbookfund'
#
CREATE TABLE aqbookfund (
  bookfundid varchar(5) DEFAULT '' NOT NULL,
  bookfundname text,
  bookfundgroup varchar(5)
);

#
# Table structure for table 'aqbooksellers'
#
CREATE TABLE aqbooksellers (
  id int(11),
  name text,
  address1 text,
  address2 text,
  address3 text,
  address4 text,
  phone varchar(30),
  accountnumber text,
  othersupplier text,
  currency char(3) DEFAULT '' NOT NULL,
  deliverydays smallint(6),
  followupdays smallint(6),
  followupscancel smallint(6),
  specialty text,
  booksellerfax text,
  notes text,
  bookselleremail text,
  booksellerurl text,
  contact varchar(100),
  postal text,
  url varchar(255),
  contpos varchar(100),
  contphone varchar(100),
  contfax varchar(100),
  contaltphone varchar(100),
  contemail varchar(100),
  contnotes text,
  active tinyint(4),
  listprice varchar(5),
  invoiceprice varchar(5),
  gstreg tinyint(4),
  listincgst tinyint(4),
  invoiceincgst tinyint(4),
  discount float(6,4),
  fax varchar(50)
);

#
# Table structure for table 'aqbudget'
#
CREATE TABLE aqbudget (
  bookfundid char(5) DEFAULT '' NOT NULL,
  startdate date DEFAULT '0000-00-00' NOT NULL,
  enddate date,
  budgetamount decimal(13,2)
);

#
# Table structure for table 'aqorderbreakdown'
#
CREATE TABLE aqorderbreakdown (
  ordernumber int(11),
  linenumber int(11),
  branchcode char(4),
  bookfundid char(5) DEFAULT '' NOT NULL,
  allocation smallint(6)
);

#
# Table structure for table 'aqorderdelivery'
#
CREATE TABLE aqorderdelivery (
  ordernumber date DEFAULT '0000-00-00' NOT NULL,
  deliverynumber smallint(6) DEFAULT '0' NOT NULL,
  deliverydate varchar(18),
  qtydelivered smallint(6),
  deliverycomments text
);

#
# Table structure for table 'aqorders'
#
CREATE TABLE aqorders (
  ordernumber int(11) DEFAULT '0' NOT NULL auto_increment,
  biblionumber int(11),
  title text,
  requisitionedby varchar(10),
  authorisedby varchar(10),
  booksellerid varchar(10) DEFAULT '' NOT NULL,
  deliverydays smallint(6),
  followupdays smallint(6),
  numberfollowupsallowed smallint(6),
  numberfollowupssent smallint(6),
  entrydate date,
  dateprinted date,
  quantity smallint(6),
  currency char(3),
  listprice decimal(28,6),
  totalamount decimal(28,6),
  datereceived date,
  booksellerinvoicenumber text,
  freight decimal(28,6),
  unitprice decimal(28,6),
  quantityreceived smallint(6),
  sourced text,
  cancelledby varchar(10),
  quantityreceiveddamaged smallint(6),
  datecancellationprinted date,
  notes text,
  supplierreference text,
  purchaseordernumber text,
  subscription tinyint(1),
  subscriptionfrom date,
  subscriptionto date,
  serialid varchar(30),
  basketno int(11),
  biblioitemnumber int(11),
  timestamp timestamp(14),
  rrp decimal(13,2),
  ecost decimal(13,2),
  gst decimal(13,2),
  PRIMARY KEY (ordernumber)
);

#
# Table structure for table 'biblio'
#
CREATE TABLE biblio (
  biblionumber int(11) DEFAULT '0' NOT NULL,
  author text,
  title text,
  unititle text,
  notes text,
  serial tinyint(1),
  seriestitle text,
  copyrightdate smallint(6),
  timestamp timestamp(14),
  KEY blbnoidx (biblionumber),
  PRIMARY KEY (biblionumber)
);

#
# Table structure for table 'biblioanalysis'
#
CREATE TABLE biblioanalysis (
  analyticaltitle text,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  analyticalauthor text
);

#
# Table structure for table 'biblioitems'
#
CREATE TABLE biblioitems (
  biblioitemnumber int(11) DEFAULT '0' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  volume text,
  number text,
  classification varchar(25),
  itemtype varchar(4),
  isbn varchar(14),
  issn varchar(9),
  dewey double(8,6),
  subclass char(3),
  publicationyear smallint(6),
  publishercode varchar(255),
  volumedate date,
  volumeddesc varchar(255),
  timestamp timestamp(14),
  illus varchar(255),
  pages varchar(255),
  notes text,
  size varchar(255),
  place varchar(255),
  KEY bibinoidx (biblioitemnumber),
  KEY bibnoidx (biblionumber),
  PRIMARY KEY (biblioitemnumber)
);

#
# Table structure for table 'bibliosubject'
#
CREATE TABLE bibliosubject (
  subject text NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL
);

#
# Table structure for table 'bibliosubtitle'
#
CREATE TABLE bibliosubtitle (
  subtitle text NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  KEY bibsubidx (biblionumber)
);

#
# Table structure for table 'borexp'
#
CREATE TABLE borexp (
  borrowernumber int(11),
  newexp date
);

#
# Table structure for table 'borrowers'
#
CREATE TABLE borrowers (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  cardnumber varchar(9) DEFAULT '' NOT NULL,
  surname text NOT NULL,
  firstname text NOT NULL,
  title text,
  othernames text,
  initials text NOT NULL,
  streetaddress text NOT NULL,
  suburb text,
  city text NOT NULL,
  phone text NOT NULL,
  emailaddress text,
  faxnumber text,
  altstreetaddress text,
  altsuburb text,
  altcity text,
  altphone text,
  dateofbirth date,
  branchcode varchar(4) DEFAULT '' NOT NULL,
  categorycode char(2),
  dateenrolled date,
  gonenoaddress tinyint(1),
  lost tinyint(1),
  debarred tinyint(1),
  studentnumber text,
  school text,
  contactname text,
  borrowernotes text,
  guarantor int(11),
  area char(2),
  ethnicity varchar(50),
  ethnotes varchar(255),
  sex char(1),
  expiry date,
  altnotes varchar(255),
  altrelationship varchar(100),
  streetcity text,
  phoneday varchar(50),
  preferredcont char(1),
  physstreet varchar(100),
  KEY borrowernumber (borrowernumber),
  KEY cardnumber (cardnumber)
);

#
# Table structure for table 'branchcategories'
#
CREATE TABLE branchcategories (
  categorycode char(2) DEFAULT '' NOT NULL,
  branchcode char(4) DEFAULT '' NOT NULL,
  branchholding int(11)
);

#
# Table structure for table 'branches'
#
CREATE TABLE branches (
  branchcode varchar(4) DEFAULT '' NOT NULL,
  branchname text NOT NULL,
  branchaddress1 text,
  branchaddress2 text,
  branchaddress3 text,
  branchphone text,
  branchfax text,
  branchemail text,
  issuing tinyint(4),
  UNIQUE branchcode (branchcode)
);

#
# Table structure for table 'branchtransfers'
#
CREATE TABLE branchtransfers (
  itemnumber int(11) DEFAULT '0' NOT NULL,
  datesent date DEFAULT '0000-00-00' NOT NULL,
  frombranch varchar(4),
  datearrived date,
  tobranch varchar(4),
  comments text
);

#
# Table structure for table 'catalogueentry'
#
CREATE TABLE catalogueentry (
  catalogueentry text NOT NULL,
  entrytype char(2),
  see text,
  seealso text,
  seeinstead text,
  biblionumber int(11)
);

#
# Table structure for table 'categories'
#
CREATE TABLE categories (
  categorycode char(2) DEFAULT '' NOT NULL,
  description text,
  enrolmentperiod smallint(6),
  upperagelimit smallint(6),
  dateofbirthrequired tinyint(1),
  finetype varchar(30),
  bulk tinyint(1),
  enrolmentfee decimal(28,6),
  overduenoticerequired tinyint(1),
  issuelimit smallint(6),
  reservefee decimal(28,6),
  UNIQUE categorycode (categorycode)
);

#
# Table structure for table 'categoryitem'
#
CREATE TABLE categoryitem (
  categorycode char(2) DEFAULT '' NOT NULL,
  itemtype varchar(4) DEFAULT '' NOT NULL,
  restrictedtype tinyint(1),
  rentaldiscount decimal(28,6),
  reservecharge decimal(28,6),
  fine decimal(28,6),
  firstremind int(11),
  chargeperiod int(11),
  accountsent int(11),
  chargename varchar(100)
);

#
# Table structure for table 'classification'
#
CREATE TABLE classification (
  classification varchar(12) DEFAULT '' NOT NULL
);

#
# Table structure for table 'currency'
#
CREATE TABLE currency (
  currency varchar(10),
  rate float(7,5)
);

#
# Table structure for table 'deletedbiblio'
#
CREATE TABLE deletedbiblio (
  biblionumber int(11) DEFAULT '0' NOT NULL,
  author text,
  title text,
  unititle text,
  notes text,
  serial tinyint(1),
  seriestitle text,
  copyrightdate smallint(6),
  timestamp timestamp(14),
  KEY blbnoidx (biblionumber),
  PRIMARY KEY (biblionumber)
);

#
# Table structure for table 'deletedbiblioitems'
#
CREATE TABLE deletedbiblioitems (
  biblioitemnumber int(11) DEFAULT '0' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  volume text,
  number text,
  classification varchar(25),
  itemtype varchar(4),
  isbn varchar(14),
  issn varchar(9),
  dewey double(8,6),
  subclass char(3),
  publicationyear smallint(6),
  publishercode varchar(255),
  volumedate date,
  volumeddesc varchar(255),
  timestamp timestamp(14),
  illus varchar(255),
  pages varchar(255),
  notes text,
  size varchar(255),
  KEY bibinoidx (biblioitemnumber),
  KEY bibnoidx (biblionumber),
  PRIMARY KEY (biblioitemnumber)
);

#
# Table structure for table 'deletedborrowers'
#
CREATE TABLE deletedborrowers (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  cardnumber varchar(9) DEFAULT '' NOT NULL,
  surname text NOT NULL,
  firstname text NOT NULL,
  title text,
  othernames text,
  initials text NOT NULL,
  streetaddress text NOT NULL,
  suburb text,
  city text NOT NULL,
  phone text NOT NULL,
  emailaddress text,
  faxnumber text,
  altstreetaddress text,
  altsuburb text,
  altcity text,
  altphone text,
  dateofbirth date,
  branchcode varchar(4) DEFAULT '' NOT NULL,
  categorycode char(2),
  dateenrolled date,
  gonenoaddress tinyint(1),
  lost tinyint(1),
  debarred tinyint(1),
  studentnumber text,
  school text,
  contactname text,
  borrowernotes text,
  guarantor int(11),
  area char(2),
  ethnicity varchar(50),
  ethnotes varchar(255),
  sex char(1),
  expiry date,
  altnotes varchar(255),
  altrelationship varchar(100),
  streetcity text,
  phoneday varchar(50),
  preferredcont varchar(100),
  physstreet varchar(100),
  KEY borrowernumber (borrowernumber),
  KEY cardnumber (cardnumber)
);

#
# Table structure for table 'deleteditems'
#
CREATE TABLE deleteditems (
  itemnumber int(11) DEFAULT '0' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  multivolumepart varchar(30),
  biblioitemnumber int(11) DEFAULT '0' NOT NULL,
  barcode varchar(9) DEFAULT '' NOT NULL,
  dateaccessioned date,
  booksellerid varchar(10),
  homebranch varchar(4),
  price decimal(28,6),
  replacementprice decimal(28,6),
  replacementpricedate date,
  datelastborrowed date,
  datelastseen date,
  multivolume tinyint(1),
  stack tinyint(1),
  notforloan tinyint(1),
  itemlost tinyint(1),
  wthdrawn tinyint(1),
  bulk varchar(30),
  issues smallint(6),
  renewals smallint(6),
  reserves smallint(6),
  restricted tinyint(1),
  binding decimal(28,6),
  itemnotes text,
  holdingbranch varchar(4),
  interim tinyint(1),
  timestamp timestamp(14),
  KEY itembarcodeidx (barcode),
  KEY itembinoidx (biblioitemnumber),
  KEY itembibnoidx (biblionumber),
  PRIMARY KEY (itemnumber),
  UNIQUE barcode (barcode)
);

#
# Table structure for table 'issues'
#
CREATE TABLE issues (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  itemnumber int(11) DEFAULT '0' NOT NULL,
  date_due date,
  branchcode char(4),
  issuingbranch char(18),
  returndate date,
  lastreneweddate date,
  return char(4),
  renewals tinyint(4),
  timestamp timestamp(14),
  KEY issuesborridx (borrowernumber),
  KEY issuesitemidx (itemnumber),
  KEY bordate (borrowernumber,timestamp)
);

#
# Table structure for table 'items'
#
CREATE TABLE items (
  itemnumber int(11) DEFAULT '0' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  multivolumepart varchar(30),
  biblioitemnumber int(11) DEFAULT '0' NOT NULL,
  barcode varchar(9) DEFAULT '' NOT NULL,
  dateaccessioned date,
  booksellerid varchar(10),
  homebranch varchar(4),
  price decimal(8,2),
  replacementprice decimal(8,2),
  replacementpricedate date,
  datelastborrowed date,
  datelastseen date,
  multivolume tinyint(1),
  stack tinyint(1),
  notforloan tinyint(1),
  itemlost tinyint(1),
  wthdrawn tinyint(1),
  bulk varchar(30),
  issues smallint(6),
  renewals smallint(6),
  reserves smallint(6),
  restricted tinyint(1),
  binding decimal(28,6),
  itemnotes text,
  holdingbranch varchar(4),
  paidfor text,
  timestamp timestamp(14),
  KEY itembarcodeidx (barcode),
  KEY itembinoidx (biblioitemnumber),
  KEY itembibnoidx (biblionumber),
  PRIMARY KEY (itemnumber),
  UNIQUE barcode (barcode)
);

#
# Table structure for table 'itemsprices'
#
CREATE TABLE itemsprices (
  itemnumber int(11),
  price1 decimal(28,6),
  price2 decimal(28,6)
);

#
# Table structure for table 'itemtypes'
#
CREATE TABLE itemtypes (
  itemtype varchar(4) DEFAULT '' NOT NULL,
  description text,
  loanlength smallint(6),
  renewalsallowed smallint(6),
  rentalcharge double(16,4),
  UNIQUE itemtype (itemtype)
);

#
# Table structure for table 'multipart'
#
CREATE TABLE multipart (
  itemnumber int(11) DEFAULT '0' NOT NULL,
  other int(11) DEFAULT '0' NOT NULL
);

#
# Table structure for table 'multivolume'
#
CREATE TABLE multivolume (
  biblionumber int(11) DEFAULT '0' NOT NULL,
  multivolumepart varchar(30) DEFAULT '' NOT NULL
);

#
# Table structure for table 'newitems'
#
CREATE TABLE newitems (
  itemnumber int(11) DEFAULT '0' NOT NULL,
  publishercode varchar(18),
  biblionumber int(11) DEFAULT '0' NOT NULL,
  multivolumepart varchar(30),
  barcode varchar(9) DEFAULT '' NOT NULL,
  dateaccessioned date,
  booksellerid varchar(10),
  homebranch varchar(4),
  price decimal(28,6),
  replacementprice decimal(28,6),
  replacementpricedate date,
  datelastborrowed date,
  datelastseen date,
  multivolume tinyint(1),
  stack tinyint(1),
  notforloan tinyint(1),
  itemlost tinyint(1),
  wthdrawn tinyint(1),
  bulk varchar(30),
  issues smallint(6),
  renewals smallint(6),
  reserves smallint(6),
  restricted tinyint(1),
  binding decimal(28,6),
  itemnotes text,
  holdingbranch varchar(4),
  interim tinyint(1),
  volume text,
  number text,
  classification varchar(12),
  itemtype varchar(4),
  isbn varchar(14),
  issn varchar(9),
  dewey double(16,4),
  subclass char(3),
  publicationyear smallint(6),
  KEY itembarcodeidx (barcode),
  KEY itembibnoidx (biblionumber),
  PRIMARY KEY (itemnumber)
);

#
# Table structure for table 'printers'
#
CREATE TABLE printers (
  printername char(40),
  printqueue char(20),
  printtype char(20)
);

#
# Table structure for table 'procedures'
#
CREATE TABLE procedures (
  proccode varchar(4),
  procdesc text,
  proclevel smallint(6)
);

#
# Table structure for table 'publisher'
#
CREATE TABLE publisher (
  publishercode varchar(18) DEFAULT '' NOT NULL,
  publishername text NOT NULL
);

#
# Table structure for table 'reserveconstraints'
#
CREATE TABLE reserveconstraints (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  reservedate date DEFAULT '0000-00-00' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  biblioitemnumber int(11),
  timestamp timestamp(14)
);

#
# Table structure for table 'reserves'
#
CREATE TABLE reserves (
  borrowernumber int(11) DEFAULT '0' NOT NULL,
  reservedate date DEFAULT '0000-00-00' NOT NULL,
  biblionumber int(11) DEFAULT '0' NOT NULL,
  constrainttype char(1),
  branchcode varchar(4),
  notificationdate date,
  reminderdate date,
  cancellationdate date,
  reservenotes text,
  priority smallint(6),
  found char(1),
  timestamp timestamp(14),
  itemnumber int(11)
);

#
# Table structure for table 'searchstats'
#
CREATE TABLE searchstats (
  time datetime,
  searchstring text
);

#
# Table structure for table 'serialissues'
#
CREATE TABLE serialissues (
  biblionumber int(11) DEFAULT '0' NOT NULL,
  volume varchar(20) DEFAULT '' NOT NULL,
  number varchar(20) DEFAULT '' NOT NULL,
  ordernumber smallint(6),
  issuedate varchar(20),
  received varchar(18)
);

#
# Table structure for table 'statistics'
#
CREATE TABLE statistics (
  datetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  branch varchar(4),
  proccode varchar(4),
  value double(16,4),
  type varchar(16),
  other text,
  usercode varchar(10),
  itemnumber int(11),
  itemtype varchar(4),
  borrowernumber int(11) default NULL,
  KEY timeidx (datetime)
);

#
# Table structure for table 'stopwords'
#
CREATE TABLE stopwords (
  word varchar(255)
);

#
# Table structure for table 'systempreferences'
#
CREATE TABLE systempreferences (
  variable char(50) DEFAULT '' NOT NULL,
  value char(200),
  PRIMARY KEY (variable)
);

#
# Table structure for table 'users'
#
CREATE TABLE users (
  usercode varchar(10),
  username text,
  password text,
  level smallint(6)
);

CREATE TABLE userflags (
  bit int(11) NOT NULL default '0',
  flag char(30),
  flagdesc char(255),
  defaulton int(11)
);
--- NEW FILE ---
-- MySQL dump 8.21
--
-- Host: localhost    Database: Koha
---------------------------------------------------------
-- Server version	3.23.49-log

--
-- Table structure for table 'biblio'
--

--
-- Dumping data for table 'biblio'
--


INSERT INTO biblio VALUES (1,'Browne, Anthony','Zoo',NULL,NULL,NULL,NULL,1992,20020415130853,NULL);
INSERT INTO biblio VALUES (2,'Holyer, Erna M.','Reservoir road adventure',NULL,NULL,NULL,NULL,NULL,20020415130853,NULL);
INSERT INTO biblio VALUES (3,'Bergey, Alyce','The boy who was lost',NULL,NULL,NULL,NULL,NULL,20020415130853,NULL);
INSERT INTO biblio VALUES (4,'Richler, Mordecai','Jacob two-two meets the hooded fang',NULL,NULL,NULL,NULL,NULL,20020415130853,NULL);
[...2265 lines suppressed...]
INSERT INTO shelfcontents VALUES (1,175,0);
INSERT INTO shelfcontents VALUES (1,165,0);
INSERT INTO shelfcontents VALUES (2,377,0);
INSERT INTO shelfcontents VALUES (2,412,0);
INSERT INTO shelfcontents VALUES (2,56,0);
INSERT INTO shelfcontents VALUES (2,58,0);
INSERT INTO shelfcontents VALUES (2,143,0);
INSERT INTO shelfcontents VALUES (2,222,0);
INSERT INTO shelfcontents VALUES (2,186,0);
INSERT INTO shelfcontents VALUES (2,305,0);
INSERT INTO shelfcontents VALUES (3,316,0);
INSERT INTO shelfcontents VALUES (3,30,0);
INSERT INTO shelfcontents VALUES (3,32,0);
INSERT INTO shelfcontents VALUES (3,87,0);
INSERT INTO shelfcontents VALUES (3,101,0);
INSERT INTO shelfcontents VALUES (3,200,0);
INSERT INTO shelfcontents VALUES (3,298,0);
INSERT INTO shelfcontents VALUES (3,101,0);
INSERT INTO shelfcontents VALUES (3,114,0);


--- NEW FILE ---
#!/usr/bin/perl -w

# $Id: testKoha.pl,v 1.1 2002/11/22 09:05:18 tipaul Exp $


# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

use strict;
use Test::Harness;

# please add many tests here
# Please make the test name the same as the module name where possible

my @tests=(
	't/format.t',
	't/Input.t',
	't/koha.t',
	't/output.t',
	't/require.t',
	't/Catalogue.t',
);


runtests (@tests);

exit;

# $Log: testKoha.pl,v $
# Revision 1.1  2002/11/22 09:05:18  tipaul
# moving non koha-running files to misc dir
#
# Revision 1.6  2002/08/14 18:12:51  tonnesen
# Added copyright statement to all .pl and .pm files
#
# Revision 1.5  2002/06/20 18:04:46  tonnesen
# Are we getting sick of merging yet?  Not me!
#
# Revision 1.1.2.7  2002/06/20 15:19:33  amillar
# Test valid ISBN numbers in Input.pm
#





More information about the Koha-cvs mailing list