124 lines
3.5 KiB
Perl
124 lines
3.5 KiB
Perl
#!/usr/bin/perl
|
|
|
|
my $kohadir=`pwd`;
|
|
chomp $kohadir;
|
|
|
|
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;
|
|
}
|
|
|
|
|
|
my $kohahtmldir="/koha/koha/koha-html/";
|
|
print "\nWhere is the 'koha-html' cvs module located [$kohahtmldir]: ";
|
|
chomp($input = <STDIN>);
|
|
if ($input) {
|
|
$kohahtmldir=$input;
|
|
}
|
|
|
|
|
|
my $releaseversion="1.2.1RC2";
|
|
print "\nWhat is the release name? [$releaseversion]: ";
|
|
chomp($input = <STDIN>);
|
|
if ($input) {
|
|
$releaseversion=$input;
|
|
}
|
|
|
|
|
|
|
|
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";
|
|
}
|
|
|
|
print qq|
|
|
Updating the 'koha' CVS files. You may need to enter your SourceForge password.
|
|
Using $kohadir.
|
|
|;
|
|
chdir($kohadir);
|
|
system("cvs update");
|
|
print qq|
|
|
Updating the 'koha-html' CVS files. You may need to enter your SourceForge password.
|
|
Using $kohahtmldir.
|
|
|;
|
|
chdir($kohahtmldir);
|
|
system("cvs update");
|
|
|
|
|
|
my $rootdir="/tmp/koha-".$releaseversion;
|
|
system("rm -rf $rootdir");
|
|
mkdir ($rootdir, 0700);
|
|
chdir($rootdir);
|
|
|
|
mkdir("intranet-cgi", 0755);
|
|
mkdir("intranet-html", 0755);
|
|
mkdir("opac-cgi", 0755);
|
|
mkdir("opac-html", 0755);
|
|
mkdir("scripts", 0755);
|
|
mkdir("modules", 0755);
|
|
mkdir("docs", 0755);
|
|
|
|
# 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/databaseinstall.sh $rootdir");
|
|
system("mv $rootdir/intranet-cgi/installer.pl $rootdir");
|
|
system("mv $rootdir/intranet-cgi/koha.conf $rootdir");
|
|
system("mv $rootdir/intranet-cgi/koha.mysql $rootdir");
|
|
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");
|
|
|
|
|
|
# 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");
|
|
|
|
# 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");
|
|
|
|
system("find $rootdir -name CVS -exec rm -rf \\{\\} \\; 2>/dev/null");
|
|
|
|
|
|
chdir("/tmp");
|
|
system("tar czf /tmp/koha-$releaseversion.tar.gz koha-".$releaseversion);
|