1 #!/usr/bin/perl -w # please develop with -w
6 use strict; # please develop with the strict pragma
10 Install::setlanguage 'en';
12 my $domainname = `hostname`; # Note: must not have any arguments (portability)
13 if ($domainname =~ /^[^\s\.]+\.([-a-z0-9\.]+)$/) {
17 if (open(INPUT, "</etc/resolv.conf")) {
19 $domainname = $1 if /^domain\s+([-a-z0-9\.]+)\s*$/i;
20 last if defined $domainname;
25 Install::setdomainname $domainname;
28 Install::setetcdir $etcdir;
31 print "You must be root to run this script.\n";
36 unless (-d 'intranet-html') {
38 You seem to be installing from CVS. Please run the "buildrelease" script
39 and install from the resulting release tarball.
44 my $kohaversion=`cat koha.version`;
46 Install::setkohaversion $kohaversion;
49 if ($kohaversion =~ /RC/) {
50 releasecandidatewarning();
53 checkabortedinstall();
55 if (-e "$etcdir/koha.conf") {
56 my $installedversion=`grep kohaversion= "$etcdir/koha.conf"`;
57 chomp $installedversion;
58 $installedversion=~m/kohaversion=(.*)/;
60 my $installedversionmsg;
61 if ($installedversion) {
62 $installedversionmsg=getmessage('KohaVersionInstalled', [$installedversion]);
64 $installedversionmsg=getmessage('KohaUnknownVersionInstalled');
67 my $message=getmessage('KohaAlreadyInstalled', [$etcdir, $kohaversion, $installedversionmsg]);
68 showmessage($message, 'none');
72 my $continuingmsg=getmessage('continuing');
74 my $message=getmessage('WelcomeToKohaInstaller');
75 my $answer=showmessage($message, 'yn');
77 if ($answer eq "Y" || $answer eq "y") {
81 This installer currently does not support a completely automated
84 Please be sure to read the documentation, or visit the Koha website
85 at http://www.koha.org for more information.
90 # Check for missing Perl Modules
93 # Ask for installation directories
96 getinstallationdirectories();
100 getapachevhostinfo();
104 basicauthentication();
114 finalizeconfigfile();
121 showmessage(getmessage('AuthenticationWarning', [$etcdir]), 'PressEnter');
124 showmessage(getmessage('Completed', [ Install::getservername(), Install::getintranetport(), Install::getservername(), Install::getopacport()]), 'PressEnter');
129 if (-f "kohareporter") {
130 my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
132 system("perl kohareporter");