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;
24 elsif (open(INPUT, "</etc/hostname")) {
25 $domainname = <INPUT>;
28 Install::setdomainname $domainname;
30 ###############################################
31 # SET THE etcdir ENVIRONMENT VAR INSTEAD #
32 ###############################################
33 my $etcdir = $ENV{etcdir}||'/etc';
34 system("mkdir -p $etcdir");
36 Install::setetcdir $etcdir;
38 unless (-d 'intranet-html') {
40 You seem to be installing from CVS. Please run the "buildrelease" script
41 and install from the resulting release tarball.
46 my $kohaversion=`cat koha.version`;
48 Install::setkohaversion $kohaversion;
51 if ($kohaversion =~ /RC/) {
52 releasecandidatewarning();
55 checkabortedinstall();
57 if (-e "$etcdir/koha.conf") {
58 my $installedversion=`grep kohaversion= "$etcdir/koha.conf"`;
59 chomp $installedversion;
60 $installedversion=~m/kohaversion=(.*)/;
62 my $installedversionmsg;
63 if ($installedversion) {
64 $installedversionmsg=getmessage('KohaVersionInstalled', [$installedversion]);
66 $installedversionmsg=getmessage('KohaUnknownVersionInstalled');
69 my $message=getmessage('KohaAlreadyInstalled', [$etcdir, $kohaversion, $installedversionmsg]);
70 showmessage($message, 'none');
74 my $continuingmsg=getmessage('continuing');
76 my $message=getmessage('WelcomeToKohaInstaller');
77 my $answer=showmessage($message, 'yn');
79 if ($answer eq "Y" || $answer eq "y") {
83 This installer currently does not support a completely automated
86 Please be sure to read the documentation, or visit the Koha website
87 at http://www.koha.org for more information.
92 # Check for missing Perl Modules
95 # Ask for installation directories
98 getinstallationdirectories();
102 getapachevhostinfo();
106 basicauthentication();
120 finalizeconfigfile();
127 showmessage(getmessage('AuthenticationWarning', [$etcdir]), 'PressEnter');
130 showmessage(getmessage('Completed', [ Install::getservername(), Install::getintranetport(), Install::getservername(), Install::getopacport()]), 'PressEnter');
135 if (-f "kohareporter") {
136 my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
138 system("perl kohareporter");