From: MJ Ray Date: Fri, 7 Sep 2007 09:43:40 +0000 (+0100) Subject: Move many files to more FHS-like paths X-Git-Tag: v3.00.00-alpha~1789 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=243ec54e9a562bf9ceaf39baa43c6c15a5481a96;p=koha-ffzg.git Move many files to more FHS-like paths Signed-off-by: Chris Cormack --- diff --git a/Makefile.PL b/Makefile.PL index 077f36c163..54e515c1b9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -163,10 +163,10 @@ WriteMakefile( PL_FILES => { # generator => target(s) 'rewrite-config.PL' => [ - '$(INST_LIBDIR)/koha/etc/koha-conf.xml', - '$(INST_LIBDIR)/koha/etc/koha-httpd.conf', - '$(INST_LIBDIR)/koha/etc/zebra-biblios.cfg', - '$(INST_LIBDIR)/koha/etc/zebra-authorities.cfg' + '$(PREFIX)/share/koha/etc/koha-conf.xml', + '$(PREFIX)/share/koha/etc/koha-httpd.conf', + '$(PREFIX)/share/koha/etc/zebra-biblios.cfg', + '$(PREFIX)/share/koha/etc/zebra-authorities.cfg' ] } # 'opac/getfromintranet.PL' => ['$(INST_LIBDIR)/opac/cgi-bin/detail.pl','$(INST_LIBDIR)/opac/cgi-bin/moredetail.pl','$(INST_LIBDIR)/opac/cgi-bin/search.pl','$(INST_LIBDIR)/opac/cgi-bin/subjectsearch.pl','$(INST_LIBDIR)/opac/cgi-bin/logout.pl'], @@ -206,15 +206,15 @@ C4/*.pm is copied to perl's lib namespace. =pod -CGIs are copied to koha/cgi-bin -and other scripts to koha/scripts. +CGIs are copied to $(PREFIX)/lib/cgi-bin/koha/ +and other scripts to koha/ =cut foreach my $src ("mainpage.pl","help.pl",glob("*/*.pl"),glob("installer/*.pm"),glob("*/*/*.pl"),glob("*/*/*/*.pl")) { if ($src =~ /(misc|updater|rss)\//) { - $result{$src} = '$(INST_LIBDIR)/koha/scripts/'.$src; + $result{$src} = '$(INST_LIBDIR)/koha/'.$src; } else { - $result{$src} = '$(INST_LIBDIR)/koha/cgi-bin/'.$src; + $result{$src} = '$(PREFIX)/lib/cgi-bin/koha/'.$src; } } @@ -236,12 +236,12 @@ excluding non-files, CVS files and whitespace in filenames. } =pod -etc files are copied to koha/etc +etc files are copied to /usr/share/koha/etc/ =cut # Misc etc to koha/etc foreach my $src (glob("etc/*")) { - $result{$src} = '$(INST_LIBDIR)/koha/'.$src; + $result{$src} = '$(PREFIX)/share/koha/'.$src; } diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index ff7cc2e0fc..abe67a32dc 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -11,11 +11,11 @@ __BASE_DIR__/zebradb/biblios - __BASE_DIR__/etc/zebra-biblios.cfg - __BASE_DIR__/etc/pqf.properties + __PREFIX__/share/koha/etc/zebra-biblios.cfg + __PREFIX__/share/koha/etc/pqf.properties - __BASE_DIR__/ccl.properties + __PREFIX__/share/koha/etc/ccl.properties __ZEBRA_USER__ __ZEBRA_PASS__ @@ -23,10 +23,10 @@ __BASE_DIR__/zebradb/authorities - __BASE_DIR__/etc/zebra-authorities.cfg + __PREFIX__/share/koha/etc/zebra-authorities.cfg - __BASE_DIR__/etc/ccl.properties + __PREFIX__/share/koha/etc/ccl.properties __ZEBRA_USER__ __ZEBRA_PASS__ @@ -41,10 +41,10 @@ 1 authorities 1 - __BASE_DIR__/intranet/cgi-bin - __BASE_DIR__/opac/cgi-bin - __BASE_DIR__/opac/htdocs/opac-tmpl - __BASE_DIR__/intranet/htdocs/intranet-tmpl - __BASE_DIR__/intranet/htdocs/intranet-tmpl/default/en/includes/ + __CGI_DIR__ + __CGI_DIR__/opac + __BASE_DIR__/templates/koha-tmpl/opac-tmpl + __BASE_DIR__/templates/koha-tmpl/intranet-tmpl + __BASE_DIR__/templates/koha-tmpl/intranet-tmpl/default/en/includes/ diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf index 6122ff6979..077a76ee63 100644 --- a/etc/koha-httpd.conf +++ b/etc/koha-httpd.conf @@ -5,24 +5,23 @@ ## OPAC ServerAdmin __WEBMASTER_EMAIL__ - DocumentRoot __BASE_DIR__/opac/htdocs + DocumentRoot __BASE_DIR__/templates/koha-tmpl/ ServerName __WEBSERVER_HOST__ # ServerAlias opac.mydomain.com - ScriptAlias /cgi-bin/koha/ "__BASE_DIR__/opac/cgi-bin/" - ScriptAlias /index.html "__BASE_DIR__/opac/cgi-bin/opac-main.pl" - ScriptAlias /opac-search.pl "__BASE_DIR__/opac/cgi-bin/search" - ScriptAlias /search "__BASE_DIR__/opac/cgi-bin/search" - ErrorLog __BASE_DIR__/log/opac-error_log -# TransferLog __BASE_DIR__/log/opac-access_log - SetEnv PERL5LIB "__BASE_DIR__/intranet/modules" - SetEnv KOHA_CONF "__BASE_DIR__/etc/koha-conf.xml" + ScriptAlias /cgi-bin/koha/ "__CGI_DIR__/opac/" + ScriptAlias /index.html "__CGI_DIR__/opac/opac-main.pl" + ScriptAlias /opac-search.pl "__CGI_DIR__/opac/search" + ScriptAlias /search "__CGI_DIR__/opac/search" + ErrorLog __LOG_DIR__/koha-opac-error_log +# TransferLog __LOG_DIR__/koha-opac-access_log + SetEnv KOHA_CONF "__PREFIX__/share/koha/etc/koha-conf.xml" Options +FollowSymLinks # Rewrite Rules RewriteEngine On # Uncomment to turn on rewrite logging -# RewriteLog __BASE_DIR__/log/opac-rewrite.log +# RewriteLog __LOG_DIR__/koha-opac-rewrite.log # RewriteLogLevel 1 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) RewriteRule (.+) $1?%1%2 [N,R,NE] @@ -35,20 +34,19 @@ ## Intranet ServerAdmin __WEBMASTER_EMAIL__ - DocumentRoot __BASE_DIR__/intranet/htdocs + DocumentRoot __BASE_DIR__/templates/koha-tmpl/ ServerName __WEBSERVER_HOST__:__WEBSERVER_PORT_LIBRARIAN__ # ServerAlias intranet.mydomain.com - ScriptAlias /cgi-bin/koha/ "__BASE_DIR__/intranet/cgi-bin/" - ScriptAlias /index.html "__BASE_DIR__/intranet/cgi-bin/mainpage.pl" - ScriptAlias /search "__BASE_DIR__/intranet/cgi-bin/search.pl" - ErrorLog __BASE_DIR__/log/error_log -# TransferLog __BASE_DIR__/log/access_log - SetEnv PERL5LIB "__BASE_DIR__/intranet/modules" - SetEnv KOHA_CONF "__BASE_DIR__/etc/koha-conf.xml" + ScriptAlias /cgi-bin/koha/ "__CGI_DIR__/" + ScriptAlias /index.html "__CGI_DIR__/mainpage.pl" + ScriptAlias /search "__CGI_DIR__/search.pl" + ErrorLog __LOG_DIR__/koha-error_log +# TransferLog __LOG_DIR__/koha-access_log + SetEnv KOHA_CONF "__PREFIX__/share/koha/etc/koha-conf.xml" Options +FollowSymLinks RewriteEngine On # Uncomment to turn on rewrite logging -# RewriteLog __BASE_DIR__/log/intranet-rewrite.log +# RewriteLog __LOG_DIR__/koha-intranet-rewrite.log # RewriteLogLevel 1 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) diff --git a/etc/zebra-authorities.cfg b/etc/zebra-authorities.cfg index fe887965e9..a63293e1c7 100644 --- a/etc/zebra-authorities.cfg +++ b/etc/zebra-authorities.cfg @@ -4,7 +4,7 @@ # $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $ # # Where are the config files located? -profilePath:__BASE_DIR__/zebradb/authorities/tab:__BASE_DIR__/zebradb/tab +profilePath:__PREFIX__/share/koha/etc/zebradb/authorities/tab:__PREFIX__/share/koha/etc/zebradb/tab encoding: UTF-8 # modulePath - where to look for loadable zebra modules diff --git a/etc/zebra-biblios.cfg b/etc/zebra-biblios.cfg index a70d51074d..9d93aca5b0 100644 --- a/etc/zebra-biblios.cfg +++ b/etc/zebra-biblios.cfg @@ -3,7 +3,7 @@ # $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $ # # Where are the config files located? -profilePath:__BASE_DIR__/zebradb/biblios/tab:__BASE_DIR__/zebradb/tab +profilePath:__PREFIX__/share/koha/etc/zebradb/biblios/tab:__PREFIX__/share/koha/etc/zebradb/tab # modulePath - where to look for loadable zebra modules modulePath: /usr/lib/idzebra-2.0/modules diff --git a/rewrite-config.PL b/rewrite-config.PL index 2399d8f663..3c875a96bd 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -41,7 +41,9 @@ guesses worked out by the script. The following configuration keywords are available: -BASE_DIR, MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_USER, WEBMASTER_EMAIL, WEBSERVER_DOMAIN, +PREFIX, +BASE_DIR, CGI_DIR, LOG_DIR, +MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_USER, WEBMASTER_EMAIL, WEBSERVER_DOMAIN, WEBSERVER_HOST, WEBSERVER_IP, WEBSERVER_PORT, WEBSERVER_PORT_LIBRARIAN, ZEBRA_PASS, ZEBRA_USER =head1 EXAMPLES @@ -61,16 +63,20 @@ $mydomain = $myhost; $mydomain =~ s/^.*?\.//; # This is set here to rescue systems with broken DNS $myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?"; +$prefix = $ENV{'PREFIX'} || "/usr"; # These are our configuration guesses # Keys were extracted by # "",/' %configuration = ( - "__BASE_DIR__" => sprintf("/usr/lib/perl5/site-perl/%vd/koha",$^V), + "__BASE_DIR__" => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha", + "__CGI_DIR__" => $prefix."/lib/cgi-bin/koha", + "__LOG_DIR__" => "/var/log", "__MYSQL_DB__" => "koha", "__MYSQL_HOST__" => $myhost, "__MYSQL_PASS__" => "katikoan", "__MYSQL_USER__" => "kohaadmin", + "__PREFIX__" => $prefix, "__WEBMASTER_EMAIL__" => 'webmaster@'.$mydomain, "__WEBSERVER_DOMAIN__" => $mydomain, "__WEBSERVER_HOST__" => $myhost,