+use Getopt::Long;
+use vars qw( $verbose_p );
+
+GetOptions(
+ 'verbose|v' => \$verbose_p,
+) || exit(1);
+
+print <<EOM;
+***************************************
+* Welcome to the Koha Release Builder *
+***************************************
+EOM
+
+#----------------------------------------------------------
+# To guess the version, we need to first guess where this
+# script itself is Otherwise we will have different results
+# depending on whether the script is called as ./buildrelease
+# or misc/buildrelease. If we run the script from misc, we
+# will also get errors from "cvs update" later, so this is
+# rather important information
+#----------------------------------------------------------
+print STDERR "Perl reports that buildrelease is $0\n" if $verbose_p;
+my $self_path;
+if ($0 =~ /^(\.\/)*buildrelease$/) {
+ $self_path = 'buildrelease';
+} elsif ($0 =~ /^(?:(\.\/)*\/)?misc\/buildrelease$/) {
+ $self_path = 'misc/buildrelease';
+} else {
+ print <<EOM;
+
+WARNING: Unable to determine where the buildrelease script is located.
+ The version number guessed by the next step might be wrong.
+EOM
+ $self_path = (-f 'buildrelease')? 'buildrelease': 'misc/buildrelease';
+}
+print STDERR "Assuming buildrelease is $self_path\n" if $verbose_p;
+
+#----------------------------------------------------------
+# Fixup the current directory
+#----------------------------------------------------------
+if ($self_path eq 'buildrelease') {
+ print <<EOM;
+
+WARNING: You should run the buildrelease script from the top of the koha
+ CVS module. I will try to change to the correct directory, but
+ it is better if you had ran this script there in the first place.
+EOM
+ chdir ".." || die "..: chdir: $!\n";
+ $self_path = 'misc/buildrelease';
+}
+
+#----------------------------------------------------------
+# Start the release builder
+#----------------------------------------------------------
+#sub guess_kohahtmldir ($;$);