my $kohadir=`pwd`;
chomp $kohadir;
my $kohahtmldir=guess_kohahtmldir($kohadir, "/koha/koha/koha-html/");
+my $kohatmpldir=guess_kohatmpldir($kohadir, "/koha/koha/koha-tmpl/");
my $roothomedir=(getpwuid(0))[7]; # ~root is traditionally just /
$roothomedir='/root' unless defined $roothomedir;
if (/kohahtmldir=(.*)/) {
$kohahtmldir=$1;
}
+ if (/kohatmpldir=(.*)/) {
+ $kohatmpldir=$1;
+ }
}
$has_kohaautobuild_conf = 1;
}
$kohahtmldir=$input;
}
+print "\nWhere is the 'koha-tmpl' cvs module located [$kohatmpldir]: ";
+chomp($input = <STDIN>);
+if ($input) {
+ $kohatmpldir=$input;
+}
+
open (C, ">$roothomedir/.kohaautobuild.conf");
print C qq|
kohadir=$kohadir
kohahtmldir=$kohahtmldir
+kohatmpldir=$kohatmpldir
|;
#----------------------------------------------------------
# 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|");
+open (CVSLOG, "cvs log misc/buildrelease|");
my $symbolicnamessection=0;
my $symbolicnames;
my $highestversion;
#----------------------------------------------------------
# MOVE files to /tmp and build tar.gz
#----------------------------------------------------------
+
+print qq|
+Updating your checked-out copy of the 'koha-tmpl' CVS files.
+You may need to enter your SourceForge password.
+Using $kohatmpldir.
+|;
+chdir($kohatmpldir) || die "$kohatmpldir: $!\n";
+system("cvs update");
+
+if ($cvstag) {
+ print qq|
+Tagging koha-tmpl with tag R_$tagname
+|;
+ system("cvs tag -F R_$tagname");
+}
+
+
+
+
my $rootdir="/tmp/koha-".$releaseversion;
system("rm -rf $rootdir");
mkdir ($rootdir, 0700);
system("mv $rootdir/intranet-cgi/misc/info/* $rootdir");
system("mv $rootdir/intranet-cgi/misc/installer.pl $rootdir");
system("mv $rootdir/intranet-cgi/misc/koha.upgrade $rootdir");
-#system("mv $rootdir/intranet-cgi/Install.pm $rootdir"); #does not exist ??
+system("mv $rootdir/intranet-cgi/misc/Install.pm $rootdir");
#system("mv $rootdir/intranet-cgi/kohareporter $rootdir"); # does not exist ??
chmod 0770, "$rootdir/installer.pl";
chmod 0770, "$rootdir/koha.upgrade";
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");
+# Copy koha-tmpl files
+system("cp -a $kohatmpldir/opac-tmpl/* $rootdir/opac-html");
+system("cp -a $kohatmpldir/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");
chdir("/tmp");
system("tar czf /tmp/koha-$releaseversion.tar.gz koha-".$releaseversion);
-#system("rm -rf $rootdir");
+system("rm -rf $rootdir");
print qq|
============
}
return $kohahtmldir;
}
+
+sub guess_kohatmpldir ($;$) {
+ my($kohadir, $default) = @_;
+ my $kohatmpldir;
+ # It probably makes sense to assume that the 'koha' and 'koha-tmpl'
+ # modules are checked out within the same parent directory
+ if (-d $kohadir && $kohadir =~ /^(.*)\/[^\/]+$/) {
+ $kohatmpldir = "$1/koha-tmpl"
+ } else {
+ $kohatmpldir = $default;
+ }
+ return $kohatmpldir;
+}