merged from upstream master
authorLars Wirzenius <lars@catalyst.net.nz>
Wed, 26 May 2010 04:14:04 +0000 (16:14 +1200)
committerLars Wirzenius <lars@catalyst.net.nz>
Wed, 26 May 2010 04:14:04 +0000 (16:14 +1200)
109 files changed:
C4/Acquisition.pm
C4/AuthoritiesMarc.pm
C4/AuthoritiesMarc/MARC21.pm
C4/AuthoritiesMarc/UNIMARC.pm
C4/Biblio.pm
C4/Bookseller.pm
C4/Boolean.pm
C4/Branch.pm
C4/Budgets.pm
C4/Circulation.pm
C4/ClassSortRoutine.pm
C4/ClassSortRoutine/Dewey.pm
C4/ClassSortRoutine/Generic.pm
C4/ClassSortRoutine/LCC.pm
C4/ClassSource.pm
C4/Contract.pm
C4/Form/MessagingPreferences.pm
C4/Heading.pm
C4/Heading/MARC21.pm
C4/Input.pm
C4/Installer.pm
C4/Log.pm
C4/Maintainance.pm
C4/Output.pm
C4/Overdues.pm
C4/Print.pm
C4/Reserves.pm
C4/SQLHelper.pm
C4/Search.pm
C4/Serials.pm
C4/Serials/Frequency.pm
C4/Serials/NumberPattern.pm
C4/Stats.pm
C4/Suggestions.pm
C4/VirtualShelves.pm
C4/Z3950.pm
INSTALL
admin/aqbudgets.pl
catalogue/search.pl
cataloguing/addbooks.pl
cataloguing/merge.pl
debian/bd-to-depends [new file with mode: 0755]
debian/changelog
debian/control
debian/copyright
debian/koha-common.README.Debian [new file with mode: 0644]
debian/koha-common.cron.d [new file with mode: 0644]
debian/koha-common.cron.hourly [new file with mode: 0644]
debian/koha-common.dirs [new file with mode: 0644]
debian/koha-common.init [new file with mode: 0755]
debian/koha-common.install [new file with mode: 0644]
debian/koha-common.logrotate [new file with mode: 0644]
debian/koha-common.postinst [new file with mode: 0644]
debian/koha-post-install-setup [new file with mode: 0644]
debian/koha.README.Debian
debian/koha.install
debian/libkoha-perl.config [deleted file]
debian/libkoha-perl.postinst [deleted file]
debian/rules
debian/scripts/koha-create [new file with mode: 0755]
debian/scripts/koha-create-dirs [new file with mode: 0755]
debian/scripts/koha-create.8 [new file with mode: 0644]
debian/scripts/koha-disable [new file with mode: 0755]
debian/scripts/koha-dump [new file with mode: 0755]
debian/scripts/koha-dump-defaults [new file with mode: 0755]
debian/scripts/koha-enable [new file with mode: 0644]
debian/scripts/koha-foreach [new file with mode: 0755]
debian/scripts/koha-list [new file with mode: 0755]
debian/scripts/koha-rebuild-zebra [new file with mode: 0755]
debian/scripts/koha-remove [new file with mode: 0755]
debian/scripts/koha-reset-passwd [new file with mode: 0755]
debian/scripts/koha-restart-zebra [new file with mode: 0755]
debian/scripts/koha-restore [new file with mode: 0755]
debian/scripts/koha-start-zebra [new file with mode: 0755]
debian/scripts/koha-stop-zebra [new file with mode: 0755]
debian/scripts/koha-upgrade-schema [new file with mode: 0755]
debian/source/format
debian/templates/apache-shared-disable.conf [new file with mode: 0644]
debian/templates/apache-shared-intranet.conf [new file with mode: 0644]
debian/templates/apache-shared-opac.conf [new file with mode: 0644]
debian/templates/apache-shared.conf [new file with mode: 0644]
debian/templates/apache-site.conf.in [new file with mode: 0644]
debian/templates/koha-conf-site.xml.in [new file with mode: 0644]
debian/templates/zebra-authorities-dom-site.cfg.in [new file with mode: 0644]
debian/templates/zebra-authorities-site.cfg.in [new file with mode: 0644]
debian/templates/zebra-biblios-site.cfg.in [new file with mode: 0644]
debian/templates/zebra.passwd.in [new file with mode: 0644]
debian/unavailable.html [new file with mode: 0644]
installer/data/mysql/en/mandatory/sample_notices.sql
installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
installer/data/mysql/pl-PL/mandatory/sample_notices.sql
installer/data/mysql/pl-PL/optional/sample_news.sql [changed mode: 0755->0644]
installer/data/mysql/ru-RU/mandatory/sample_notices.sql
installer/data/mysql/uk-UA/optional/sample_news.sql [changed mode: 0755->0644]
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
kohaversion.pl
members/member.pl
opac/opac-search.pl
opac/opac-suggestions.pl
reserve/placerequest.pl
tools/batchMod.pl
xt/author/test_template.pl
xt/permissions.t

index 4616d69..c0ac40e 100644 (file)
@@ -1854,6 +1854,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index a3eef69..5de02c4 100644 (file)
@@ -1505,7 +1505,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Paul POULAIN paul.poulain@free.fr
 
index dd3f0f8..e532ae1 100644 (file)
@@ -119,7 +119,7 @@ sub fix_marc21_auth_type_location {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index 5df70e6..244eec9 100644 (file)
@@ -79,7 +79,7 @@ sub default_auth_type_location {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index 91e9027..376568a 100644 (file)
@@ -3543,7 +3543,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Paul POULAIN paul.poulain@free.fr
 
index bdc4346..16a5a3c 100644 (file)
@@ -276,6 +276,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 3d0230a..d8c14fb 100644 (file)
@@ -118,6 +118,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 03d5824..b402ab8 100644 (file)
@@ -610,6 +610,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index df53905..8c7b011 100644 (file)
@@ -844,6 +844,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index e270b56..1207b24 100644 (file)
@@ -2776,7 +2776,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index e8c9b5e..19fd998 100644 (file)
@@ -126,7 +126,7 @@ sub _get_class_sort_key {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index 87382df..aff01b7 100644 (file)
@@ -87,7 +87,7 @@ sub get_class_sort_key {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index 0e5cfc3..e787096 100644 (file)
@@ -68,7 +68,7 @@ sub get_class_sort_key {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index f933093..b72c58e 100644 (file)
@@ -71,7 +71,7 @@ sub get_class_sort_key {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index 76dc759..2dcaf78 100644 (file)
@@ -358,6 +358,6 @@ sub GetClassSort {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 2fd54e7..9a49116 100644 (file)
@@ -69,6 +69,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 6f464dc..2a8252c 100644 (file)
@@ -158,7 +158,7 @@ L<C4::Members::Messaging>, F<admin/categorie.pl>, F<opac/opac-messaging.pl>, F<m
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com> refactoring code by Andrew Moore.
 
index ae1a0d0..7df6b82 100644 (file)
@@ -190,7 +190,7 @@ sub _marc_format_handler {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index a057e51..8d45d1a 100644 (file)
@@ -237,7 +237,7 @@ sub _get_display_heading {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index 15cfdcd..41be2fb 100644 (file)
@@ -155,6 +155,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index ca9e4be..eca0aee 100644 (file)
@@ -628,7 +628,7 @@ sub get_file_path_from_name {
 C4::Installer is a refactoring of logic originally from installer/installer.pl, which was
 originally written by Henri-Damien Laurant.
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index f1ba188..2f791de 100644 (file)
--- a/C4/Log.pm
+++ b/C4/Log.pm
@@ -257,6 +257,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 33d6483..740163f 100644 (file)
@@ -209,6 +209,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 49a0ff0..5a767a3 100644 (file)
@@ -492,6 +492,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 7f59b9b..7ea969c 100644 (file)
@@ -1283,6 +1283,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 674f220..8820e78 100644 (file)
@@ -197,7 +197,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =head1 SEE ALSO
 
index e347295..65b97dd 100644 (file)
@@ -1723,7 +1723,7 @@ sub _koha_notify_reserve {
     my ($itemnumber, $borrowernumber, $biblionumber) = @_;
 
     my $dbh = C4::Context->dbh;
-    my $borrower = C4::Members::GetMember( $borrowernumber );
+    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
     my $letter_code;
     my $print_mode = 0;
     my $messagingprefs;
@@ -1853,7 +1853,7 @@ sub _ShiftPriorityByDateAndPriority {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index 4470742..8f994d3 100644 (file)
@@ -24,7 +24,6 @@ use List::MoreUtils qw(first_value any);
 use C4::Context;
 use C4::Dates qw(format_date_in_iso);
 use C4::Debug;
-use YAML;
 require Exporter;
 use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
 
index 229ee40..cb97a1e 100644 (file)
@@ -29,7 +29,6 @@ use C4::XSLT;
 use C4::Branch;
 use C4::Reserves;    # CheckReserves
 use C4::Debug;
-use YAML;
 use URI::Escape;
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
@@ -651,7 +650,6 @@ sub _remove_stopwords {
 #
                foreach ( keys %{ C4::Context->stopwords } ) {
                        next if ( $_ =~ /(and|or|not)/ );    # don't remove operators
-                       $debug && warn "$_ Dump($operand)";
                        if ( my ($matched) = ($operand =~
                                /([^\X\p{isAlnum}]\Q$_\E[^\X\p{isAlnum}]|[^\X\p{isAlnum}]\Q$_\E$|^\Q$_\E[^\X\p{isAlnum}])/gi))
                        {
@@ -1345,6 +1343,10 @@ sub buildQuery {
 
 =head2 searchResults
 
+  my @search_results = searchResults($search_context, $searchdesc, $hits, 
+                                     $results_per_page, $offset, $scan, 
+                                     @marcresults, $hidelostitems);
+
 Format results in a form suitable for passing to the template
 
 =cut
@@ -1352,10 +1354,12 @@ Format results in a form suitable for passing to the template
 # IMO this subroutine is pretty messy still -- it's responsible for
 # building the HTML output for the template
 sub searchResults {
-    my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults, $hidelostitems ) = @_;
+    my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults, $hidelostitems ) = @_;
     my $dbh = C4::Context->dbh;
     my @newresults;
 
+    $search_context = 'opac' unless $search_context eq 'opac' or $search_context eq 'intranet';
+
     #Build branchnames hash
     #find branchname
     #get branch information.....
@@ -1664,9 +1668,11 @@ sub searchResults {
        use C4::Charset;
        SetUTF8Flag($marcrecord);
        $debug && warn $marcrecord->as_formatted;
-        if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
-            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display(
-                $oldbiblio->{biblionumber}, $marcrecord, 'Results' );
+        if (!$scan && $search_context eq 'opac' && C4::Context->preference("OPACXSLTResultsDisplay")) {
+            # FIXME note that XSLTResultsDisplay (use of XSLT to format staff interface bib search results)
+            # is not implemented yet
+            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, 'Results', 
+                                                                $search_context);
         }
 
         # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
@@ -2653,6 +2659,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index f8a9bf5..48cb150 100644 (file)
@@ -2333,6 +2333,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index e41db5e..95d867f 100644 (file)
@@ -137,6 +137,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index 88e6def..9aeb9f5 100644 (file)
@@ -124,6 +124,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
index a0c53ca..d423b1f 100644 (file)
@@ -125,7 +125,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index 0d49e4a..01bd3e2 100644 (file)
@@ -453,7 +453,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
index fc11fc9..e47b4b8 100644 (file)
@@ -632,7 +632,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =head1 SEE ALSO
 
index 2ac1460..8f97d8b 100644 (file)
@@ -297,7 +297,7 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 =cut
 
diff --git a/INSTALL b/INSTALL
index df0b673..6f41267 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -5,7 +5,7 @@ Koha is the first open-source Integrated Library System. Developed initially in
 New Zealand by Katipo Communications, Ltd and first deployed in January of 2000
 for the Horowhenua Library Trust, it is currently maintained by a team of
 software providers and library technology staff from around the globe. Learn
-more about the Koha project at http://koha.org.
+more about the Koha project at http://koha-community.org.
 
 INSTALLATION
 ============
index 22c80c8..9da555d 100755 (executable)
@@ -239,8 +239,6 @@ if ($op eq 'add_form') {
     my $period_total = 0;
     my ( $period_alloc_total, $base_spent_total );
 
-       use YAML;
-       $debug && warn Dump(@budgets);
        #This Looks WEIRD to me : should budgets be filtered in such a way ppl who donot own it would not see the amount spent on the budget by others ?
 
     foreach my $budget (@budgets) {
index 5f0286b..920afb7 100755 (executable)
@@ -513,7 +513,8 @@ for (my $i=0;$i<@servers;$i++) {
     if ($server =~/biblioserver/) { # this is the local bibliographic server
         $hits = $results_hashref->{$server}->{"hits"};
         my $page = $cgi->param('page') || 0;
-        my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}});
+        my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan,
+                                       @{$results_hashref->{$server}->{"RECORDS"}});
         $total = $total + $results_hashref->{$server}->{"hits"};
         ## If there's just one result, redirect to the detail page
         if ($total == 1) {         
index 4ee7141..4c8a989 100755 (executable)
@@ -86,7 +86,7 @@ if ($query) {
     # format output
     # SimpleSearch() give the results per page we want, so 0 offet here
     my $total = scalar @$marcresults;
-    my @newresults = searchResults( $query, $total, $results_per_page, 0, 0, @$marcresults );
+    my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, @$marcresults );
     $template->param(
         total          => $total_hits,
         query          => $query,
index b1cddf2..1b890ba 100755 (executable)
@@ -26,7 +26,6 @@ use C4::Auth;
 use C4::Items;
 use C4::Biblio;
 use C4::Serials;
-use YAML;
 
 my $input = new CGI;
 my @biblionumber = $input->param('biblionumber');
@@ -69,7 +68,6 @@ if ($merge) {
 
     # Moving items from the other record to the reference record
     my $itemnumbers = get_itemnumbers_of($frombiblio);
-    use Data::Dumper;
     foreach my $itloop ($itemnumbers->{$frombiblio}) {
        foreach my $itemnumber (@$itloop) {
            my $res = MoveItemFromBiblio($itemnumber, $frombiblio, $tobiblio);
diff --git a/debian/bd-to-depends b/debian/bd-to-depends
new file mode 100755 (executable)
index 0000000..747a7d1
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+
+import re
+import debian.deb822
+
+exclusions = [
+    'debhelper',
+]
+
+exclusions = [re.compile(s) for s in exclusions]
+
+depstring = debian.deb822.Deb822(file('debian/control')).get('Build-Depends')
+deps = [s.strip() for s in depstring.split(',')]
+result = []
+for dep in deps:
+    for ex in exclusions:
+        if ex.match(dep):
+            break
+    else:
+        result.append(dep)
+print 'koha:Depends=%s' % ', '.join(result)
index e59e8d5..5b8fcd0 100644 (file)
@@ -1,4 +1,4 @@
-koha (3.01.00.128-1~) squeeze; urgency=low
+koha (3.2~0.1) experimental; urgency=low
 
   * Initial release.
 
index 567ae57..459e1c3 100644 (file)
@@ -3,25 +3,101 @@ Maintainer: Lars Wirzenius <lars@catalyst.net.nz>
 Section: web
 Priority: optional
 Standards-Version: 3.8.4
-Build-Depends: koha-dev-env, debhelper (>= 7.0.50), gettext
+# NOTA BENE: Build dependencies end up as runtime dependencies as well.
+# See debian/rules, the override_dh_gencontrol rules. 
+# There are some exceptions.
+Build-Depends: debhelper (>= 7.0.50), gettext,
+    perl,
+    libalgorithm-checkdigits-perl,
+    libauthen-cas-client-perl,
+    libbiblio-endnotestyle-perl,
+    libcgi-session-perl,
+    libcgi-session-serialize-yaml-perl,
+    libclass-accessor-perl,
+    libclass-factory-util-perl,
+    libdbd-sqlite2-perl,
+    libdbd-mysql-perl,
+    libdbi-perl,
+    libdata-ical-perl,
+    libdate-calc-perl,
+    libdate-ical-perl,
+    libdate-manip-perl,
+    libemail-date-perl,
+    libgd-gd2-perl,
+    libgraphics-magick-perl,
+    libhtml-scrubber-perl,
+    libhtml-template-pro-perl,
+    libjson-perl,
+    liblingua-stem-perl,
+    liblingua-stem-snowball-perl,
+    liblist-moreutils-perl,
+    liblocale-po-perl,
+    libmarc-charset-perl,
+    libmarc-crosswalk-dublincore-perl,
+    libmarc-record-perl,
+    libmarc-xml-perl,
+    libmime-lite-perl,
+    libmail-sendmail-perl,
+    libnet-ldap-perl,
+    libnet-z3950-zoom-perl,
+    libnumber-format-perl,
+    libpdf-api2-perl,
+    libpdf-reuse-perl,
+    libpdf-reuse-barcode-perl,
+    libpdf-table-perl,
+    libpoe-perl,
+    libsms-send-perl,
+    libschedule-at-perl,
+    libstorable-perl,
+    libtext-csv-perl,
+    libxml-dumper-perl,
+    libxml-libxml-perl,
+    libxml-libxslt-perl,
+    libxml-rss-perl,
+    libxml-sax-writer-perl,
+    libxml-simple-perl,
+    libyaml-syck-perl,
+    libyaml-perl,
+    libmodule-install-perl,
+    libhttp-oai-perl,
+    libtext-csv-encoded-perl,
+    libpdf-api2-simple-perl,
+    libmemoize-memcached-perl,
+    liblocale-currency-format-perl
 
-Package: koha
+Package: koha-common
 Architecture: all
-Depends: ${shlib:Depends}, ${misc:Depends},
- dbconfig-common,
- koha-dev-env,
+Depends: ${shlib:Depends}, ${misc:Depends}, ${koha:Depends},
  apache2,
- mysql-server,
- daemon,
  at,
+ daemon,
  idzebra-2.0,
- yaz,
  libjs-jquery,
+ libjs-yui,
+ mysql-client,
  tinymce2, 
- libjs-yui
-Recommends: mysql-client
+ yaz
+Suggests: mysql-server
 Homepage: http://koha-community.org/
 Description: integrated (physical) library management system
  Koha is an Integrated Library Managment system for real-world libraries
  (the kinds with books).
+ .
+ This package contains everything needed to run Koha, except the site
+ specific configuration files. See the package koha for the rest.
 
+Package: koha
+Architecture: all
+Depends: ${shlib:Depends}, ${misc:Depends},
+ koha-common,
+ dbconfig-common,
+ mysql-server
+Homepage: http://koha-community.org/
+Description: integrated (physical) library management system
+ Koha is an Integrated Library Managment system for real-world libraries
+ (the kinds with books).
+ .
+ This package contains site-specific configuration files and sets up
+ the MySQL database for Koha. For simplicity, the database server is
+ assumed to run on the same host as Koha. This package also does some
+ Apache reconfiguration.
index c1be5fd..b583bfd 100644 (file)
@@ -1,9 +1,23 @@
-This will be filled in later.
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Name: Koha
+Maintainer: Lars Wirzenius <lars@catalyst.net.nz>
+Source: git://git.koha-community.org/koha.git
 
-Copyright by various people.
-
-Debian packaging copyright:
-
-Copyright 2010 Catalyst IT Ltd
+Files: *
+Copyright: 2000-2010, various people and organisations
+License: GPL-2+
+ Koha is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
 
+ Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
+ You should have received a copy of the GNU General Public License along with
+ Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ Suite 330, Boston, MA  02111-1307 USA
+ .
+ On a Debian system, you can find a copy of GPL version 2 at
+ /usr/share/common-licenses/GPL-2 .
diff --git a/debian/koha-common.README.Debian b/debian/koha-common.README.Debian
new file mode 100644 (file)
index 0000000..0676284
--- /dev/null
@@ -0,0 +1,29 @@
+Koha filesystem layout on Debian
+================================
+
+The Debian packaging of Koha puts files in the following places:
+
+* /etc/koha -- system configuration files
+* /etc/cron.hourly/koha-common -- cron job
+* /usr/share/koha -- shared files (HTML templates, Perl code, etc)
+
+Each Koha instance has files in the following places:
+
+* /etc/koha/sites/$name -- confguration files
+* /etc/apache2/sites-available/$name -- Apache config file
+* /var/lib/koha/$name -- Zebra databases
+* /var/log/koha/$name -- log files (Apache, Zebra)
+* /var/lock/koha/$name -- run-time lock files
+* /var/run/koha/$name -- run-time sockets etc
+* /var/spool/koha/$name -- database dumps
+
+
+Koha and MySQL
+==============
+
+koha-common's postinst script sets up the /etc/mysql/koha-common.cnf,
+and all scripts use that to access the MySQL database. By default, it
+is a symlink pointing at debian.cnf, and only works on localhost.
+If you wish, you can create a file /etc/mysql/koha-common.cnf instead
+of the symlink, and point it at a remote server. There is currently
+no tool to help you do that, but it should be fairly straightforward.
diff --git a/debian/koha-common.cron.d b/debian/koha-common.cron.d
new file mode 100644 (file)
index 0000000..715d1b0
--- /dev/null
@@ -0,0 +1,9 @@
+# /etc/cron.d/koha-common
+#
+# Call koha-rebuild-zebra for each enabled Koha instance, to make sure the
+# Zebra indexes are up to date.
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+*/5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra $(koha-list --enabled)
diff --git a/debian/koha-common.cron.hourly b/debian/koha-common.cron.hourly
new file mode 100644 (file)
index 0000000..4724ca8
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# /etc/cron.hourly/koha-common -- Hourly housekeeping tasks for all Kohas.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/build_holds_queue.pl
diff --git a/debian/koha-common.dirs b/debian/koha-common.dirs
new file mode 100644 (file)
index 0000000..93a6041
--- /dev/null
@@ -0,0 +1,5 @@
+etc/koha/sites
+var/lib/koha
+var/log/koha
+var/lock/koha
+var/spool/koha
diff --git a/debian/koha-common.init b/debian/koha-common.init
new file mode 100755 (executable)
index 0000000..719a584
--- /dev/null
@@ -0,0 +1,121 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          koha-common
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start Zebra server for each Koha instance
+# Description:       For each enabled Koha instance on this host,
+#                    as listed by "koha-list --enabled", start a Zebra
+#                    server (using koha-start-zebra).
+### END INIT INFO
+
+# Author: Lars Wirzenius <lars@catalyst.net.nz>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Koha ILS"
+NAME=daemonexecutablename
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS="--options args"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x /usr/sbin/koha-start-zebra ] || exit 0
+
+# Read configuration variable file if it is present
+# [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    koha-start-zebra $(koha-list --enabled)
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+    # We stop everything, including disabled ones.
+    koha-stop-zebra $(koha-list) || true
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+    koha-restart-zebra $(koha-list --enabled)
+}
+
+case "$1" in
+  start)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       do_start
+       case "$?" in
+               0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  stop)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+#  status)
+#       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+#       ;;
+  #reload|force-reload)
+       #
+       # If do_reload() is not implemented then leave this commented out
+       # and leave 'force-reload' as an alias for 'restart'.
+       #
+       #log_daemon_msg "Reloading $DESC" "$NAME"
+       #do_reload
+       #log_end_msg $?
+       #;;
+  restart|force-reload)
+       #
+       # If the "reload" option is implemented then remove the
+       # 'force-reload' alias
+       #
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+       #echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/debian/koha-common.install b/debian/koha-common.install
new file mode 100644 (file)
index 0000000..986aa07
--- /dev/null
@@ -0,0 +1,26 @@
+misc/release_notes/release_notes_3*.txt     usr/share/doc/koha-common
+debian/tmp/usr/*                            usr
+debian/tmp/etc/koha/pazpar2
+debian/tmp/etc/koha/zebradb/[!z]*
+debian/templates/* etc/koha
+debian/koha-post-install-setup usr/sbin
+debian/unavailable.html                     usr/share/koha/intranet/htdocs
+debian/unavailable.html                     usr/share/koha/opac/htdocs
+debian/templates/*                          etc/koha
+debian/scripts/koha-create                  usr/sbin
+debian/scripts/koha-create-dirs             usr/sbin
+debian/scripts/koha-disable                 usr/sbin
+debian/scripts/koha-dump                    usr/sbin
+debian/scripts/koha-dump-defaults           usr/sbin
+debian/scripts/koha-enable                  usr/sbin
+debian/scripts/koha-foreach                 usr/sbin
+debian/scripts/koha-list                    usr/sbin
+debian/scripts/koha-rebuild-zebra           usr/sbin
+debian/scripts/koha-remove                  usr/sbin
+debian/scripts/koha-reset-passwd            usr/sbin
+debian/scripts/koha-restart-zebra           usr/sbin
+debian/scripts/koha-restore                 usr/sbin
+debian/scripts/koha-start-zebra             usr/sbin
+debian/scripts/koha-stop-zebra              usr/sbin
+debian/scripts/koha-upgrade-schema          usr/sbin
+debian/scripts/*.8                          usr/share/man/man8
diff --git a/debian/koha-common.logrotate b/debian/koha-common.logrotate
new file mode 100644 (file)
index 0000000..37024d3
--- /dev/null
@@ -0,0 +1,14 @@
+# Rotate log files for all Koha instances.
+
+/var/log/koha/*/*.log {
+    rotate 5
+    weekly
+    missingok
+    compress
+    delaycompress
+    notifempty
+    sharedscripts
+    postrotate
+        /etc/init.d/apache2 reload > /dev/null
+    endscript
+}
diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst
new file mode 100644 (file)
index 0000000..ffb2165
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+conf=/etc/mysql/koha-common.cnf
+if [ ! -e "$conf" ] && [ ! -L "$conf" ]
+then
+    ln -s debian.cnf "$conf"
+fi
+
+#DEBHELPER#
diff --git a/debian/koha-post-install-setup b/debian/koha-post-install-setup
new file mode 100644 (file)
index 0000000..73faf83
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Set up Apache post-install for koha-common.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+a2enmod rewrite
+a2enmod suexec
+service apache2 restart
index ce271ba..a807092 100644 (file)
@@ -13,11 +13,19 @@ following:
   implementation.
   - edit /etc/perl/XML/SAX/ParserDetails.ini to
     move XML::LibXML::SAX:Parser section last in the file
+  - FIXME: This should become unnecessary: Koha is in the process of
+    being patched to specify the parser it needs explicitly, instead
+    of assuming it is the default one.
+* Enable the suexec module for Apache.
+  - sudo a2enmod suexec
 * Enable the rewrite module for Apache.
   - sudo a2enmod rewrite
 * Restart Apache.
   - sudo service apache2 restart
 
+The latter two steps can be done by running the koha-post-install-setup
+script.
+
 Then access the following URL:
 
     http://localhost:8080/
index 2f036b4..831de78 100644 (file)
@@ -1 +1,6 @@
-misc/release_notes/release_notes_3*.txt usr/share/doc/koha 
+debian/tmp/etc/apache2
+debian/tmp/etc/koha/koha-httpd.conf
+debian/tmp/var
+debian/tmp/etc/koha/zebradb/zebra-biblios.cfg
+debian/tmp/etc/koha/zebradb/zebra-authorities.cfg
+debian/tmp/etc/koha/zebradb/zebra-authorities-dom.cfg
diff --git a/debian/libkoha-perl.config b/debian/libkoha-perl.config
deleted file mode 100644 (file)
index fc41aa7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-
-alias stripwhitespace="sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//'"
-installeddebconfversion=dpkg -s debconf | sed -ne '/^Version/s/^Version: //p'
-
-. /usr/share/debconf/confmodule
-
diff --git a/debian/libkoha-perl.postinst b/debian/libkoha-perl.postinst
deleted file mode 100644 (file)
index 502bd8f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-set -e
-
-# Load the debconf library - this must come FIRST; do not insert any other
-# commands before this
-. /usr/share/debconf/confmodule
-
-echo "INFO: postinst as '$1'"
-
-case "$1" in
-  configure)
-    echo "Configuring..."
-    
-    # set up logrotate
-    # remove first in case we are reconfiguring
-#    rm /etc/logrotate.d/koha
-    
-    # add logrotate
-    ln -s /etc/koha/koha.logrotate /etc/logrotate.d/koha
-    
-    # reload apache
-    /etc/init.d/apache2 reload
-    ;;
-    
-  abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-    
-  *)
-    echo "postinst called with unknown argument \$1'" >&2
-    exit 0
-    ;;
-esac
-
-#DEBHELPER#
-
-# finish up
-db_stop
-exit 0
\ No newline at end of file
index da16972..2a8aa0d 100755 (executable)
@@ -1,16 +1,21 @@
 #!/usr/bin/make -f
 
-PACKAGE = $(shell dh_listpackages)
-TMP     = $(CURDIR)/debian/$(PACKAGE)
+TMP = $(CURDIR)/debian/tmp
 
 # Make "perl Makefile.PL" be non-interactive.
 export PERL_MM_USE_DEFAULT=1
 
 %:
-       dh $@
-       
+       dh $@ --fail-missing
+
+override_dh_gencontrol:
+       debian/bd-to-depends >> debian/koha-common.substvars
+       dh_gencontrol
+
 override_dh_auto_install:
        dh_auto_install
+       rm $(TMP)/etc/koha/README.txt
+       rm -r $(TMP)/usr/share/koha/doc
        rm -r $(TMP)/var/run
        rm -r $(TMP)/var/lock
        rm $(TMP)/var/log/koha/README
@@ -18,7 +23,7 @@ override_dh_auto_install:
        ln -s /usr/share/javascript/jquery/jquery.js \
           $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/jquery/jquery.js
        rm $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/jquery/jquery.js
-       ln -s /usr/share/javascript/jquery \
+       ln -s /usr/share/javascript/jquery/jquery.js \
           $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/jquery/jquery.js
        rm -r \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce
@@ -32,6 +37,9 @@ override_dh_auto_install:
                $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
        ln -s /usr/share/javascript/yui \
                $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
+       install -d $(TMP)/etc/apache2/sites-available
+       install -d $(TMP)/etc/apache2/sites-enabled
+       install -d $(TMP)/etc/apache2/conf.d
        ln -s ../../koha/koha-httpd.conf $(TMP)/etc/apache2/sites-available/koha
        ln -s ../sites-available/koha $(TMP)/etc/apache2/sites-enabled/koha
        install -m 0644 debian/koha.apache-ports $(TMP)/etc/apache2/conf.d/koha
@@ -40,5 +48,16 @@ override_dh_auto_install:
        mv $(TMP)/etc/koha/koha-conf.xml $(TMP)/usr/share/koha/koha-conf.xml.in
        sed -i $(TMP)/usr/share/koha/koha-conf.xml.in \
                -e '/^ <user>/s/>.*</>_DBC_DBUSER_</' \
-               -e '/^ <pass>/s/>.*</>_DBC_DBPASS_</' \
+               -e '/^ <pass>/s/>.*</>_DBC_DBPASS_</'
+       install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
+               koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+               $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css
+       install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
+               koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
+       sed -i -e 's:url(.*/reset-fonts-grids.css.*):url(reset-fonts-grids.css):' \
+                  -e 's:url(.*/skin.css.*):url(skin.css):' \
+               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/opac.css \
+               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/sco.css \
+               $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css/staff-global*.css
 
diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create
new file mode 100755 (executable)
index 0000000..33edb94
--- /dev/null
@@ -0,0 +1,229 @@
+#!/bin/sh
+#
+# koha-create -- Create a new Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+generate_config_file() {
+    touch "$2"
+    chown "root:$username" "$2"
+    chmod 0640 "$2"
+    sed -e "s/__KOHASITE__/$name/g" \
+        -e "s/__OPACPORT__/80/g" \
+        -e "s/__INTRAPORT__/$INTRAPORT/g" \
+        -e "s/__OPACSERVER__/$domain/g" \
+        -e "s/__INTRASERVER__/$intradomain/g" \
+        -e "s/__ZEBRA_PASS__/$zebrapwd/g" \
+        -e "s/__DB_NAME__/$mysqldb/g" \
+        -e "s/__DB_HOST__/$mysqlhost/g" \
+        -e "s/__DB_USER__/$mysqluser/g" \
+        -e "s/__DB_PASS__/$mysqlpwd/g" \
+        -e "s/__UNIXUSER__/$username/g" \
+        -e "s/__UNIXGROUP__/$username/g" \
+        "/etc/koha/$1" > "$2"
+}
+
+getmysqlhost() {
+    awk '
+        /^\[/ { inclient = 0 }
+        /^\[client\]/ { inclient = 1 }
+        inclient && /^ *host *=/ { print $3 }' \
+        /etc/mysql/koha-common.cnf
+}
+
+getinstancemysqlpassword() {
+    sed -n '/<pass>/s:.*>\(.*\)</pass>.*:\1:p' \
+        "/etc/koha/sites/$1/koha-conf.xml"
+}
+
+
+# Set defaults and read config file, if it exists.
+DOMAIN=""
+INTRAPORT="8080"
+INTRAPREFIX=""
+INTRASUFFIX=""
+DEFAULTSQL=""
+if [ -e /etc/koha/koha-sites.conf ]
+then
+    . /etc/koha/koha-sites.conf
+fi
+
+
+# Parse command line.
+[ "$#" = 2 ] || 
+    die "Usage: $0 [--create-db|--request-db|--populate-db] instancename"
+case "$1" in
+  --create-db) op=create ;;
+  --request-db) op=request ;;
+  --populate-db) op=populate ;;
+  *) die "Usage: $0 [--create-db|--request-db|--populate-db] instancename" ;;
+esac
+
+name="$2"
+domain="$name$DOMAIN"
+if [ "$INTRAPORT" = 80 ] || [ "$INTRAPORT" = "" ]
+then
+    intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN"
+else
+    intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN:$INTRAPORT"
+fi
+
+
+mysqldb="koha_$name"
+mysqlhost="$(getmysqlhost)"
+mysqluser="koha_$name"
+
+if [ "$op" = create ] || [ "$op" = request ]
+then
+    mysqlpwd="$(pwgen -1)"
+else
+    mysqlpwd="$(getinstancemysqlpassword $name)"
+fi
+
+
+if [ "$op" = create ] || [ "$op" = request ]
+then
+    # Create new user and group.
+    username="$name-koha"
+    if getent passwd "$username" > /dev/null
+    then
+        die "User $username already exists."
+    fi
+    if getent group "$username" > /dev/null
+    then
+        die "Group $username already exists."
+    fi
+    adduser --no-create-home --disabled-login \
+        --gecos "Koha instance $username" \
+        --quiet "$username"
+
+    # Create the site-specific directories.
+    koha-create-dirs "$name"
+
+    # Generate Zebra database password.
+    zebrapwd="$(pwgen -1)"
+
+    # Set up MySQL database for this instance.
+    if [ "$op" = create ]
+    then
+        mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
+CREATE DATABASE $mysqldb;
+CREATE USER '$mysqluser'@'%' IDENTIFIED BY '$mysqlpwd';
+GRANT ALL PRIVILEGES ON $mysqldb.* TO '$mysqluser';
+FLUSH PRIVILEGES;
+eof
+    fi
+
+
+    # Generate and install Apache site-available file and log dir.
+    generate_config_file apache-site.conf.in \
+        "/etc/apache2/sites-available/$name"
+    mkdir "/var/log/koha/$name"
+    chown "$username:$username" "/var/log/koha/$name"
+
+
+    # Generate and install main Koha config file.
+    generate_config_file koha-conf-site.xml.in \
+        "/etc/koha/sites/$name/koha-conf.xml"
+
+    # Generate and install Zebra config files.
+    generate_config_file zebra-biblios-site.cfg.in \
+        "/etc/koha/sites/$name/zebra-biblios.cfg"
+    generate_config_file zebra-authorities-site.cfg.in \
+        "/etc/koha/sites/$name/zebra-authorities.cfg"
+    generate_config_file zebra-authorities-dom-site.cfg.in \
+        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
+    generate_config_file zebra.passwd.in \
+        "/etc/koha/sites/$name/zebra.passwd"
+
+
+    # Create a GPG-encrypted file for requesting a DB to be set up.
+    if [ "$op" = request ]
+    then
+        touch "$name-db-request.txt"
+        chmod 0600 "$name-db-request.txt"
+        cat > "$name-db-request.txt" << eof
+Please create a database and user on $mysqlhost as follows:
+
+database name: $mysqldb
+database user: $mysqluser
+     password: $mysqlpwd
+
+Thank you.
+eof
+
+        echo "See $name-db-request.txt for database creation request."
+        echo "Please forward it to the right person, and then run"
+        echo "$0 --populate-db $name"
+        echo "Thanks."
+    fi
+fi
+
+
+if [ "$op" = create ] || [ "$op" = populate ]
+then
+    # Use the default database content if that exists.
+    if [ -e "$DEFAULTSQL" ]
+    then
+        # Populate the database with default content.
+        zcat "$DEFAULTSQL" |
+        sed "s/__KOHASITE__/$name/g" |
+        mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd"
+
+
+        # Change the default user's password.
+        staffpass="$(pwgen -1)"
+        staffdigest=$(echo -n "$staffpass" |
+                      perl -e '
+                            use Digest::MD5 qw(md5_base64); 
+                            while (<>) { print md5_base64($_), "\n"; }')
+        mysql --host="$mysqlhost" --user="$mysqluser" \
+--password="$mysqlpwd" <<eof
+USE \`$mysqldb\`;
+UPDATE borrowers 
+SET password = '$staffdigest' 
+WHERE borrowernumber = 3;
+eof
+
+        echo "staff user password is '$staffpass' but keep that secret"
+
+        # Upgrade the database schema, just in case the dump was from an 
+        # old version.
+        koha-upgrade-schema "$name"
+    else
+        echo "Koha instance is empty, no staff user created."
+    fi
+fi
+
+
+if [ "$op" = create ] || [ "$op" = populate ]
+then
+    # Reconfigure Apache.
+    a2ensite "$name"
+    service apache2 restart
+
+    # Start Zebra.
+    koha-start-zebra "$name"
+fi
diff --git a/debian/scripts/koha-create-dirs b/debian/scripts/koha-create-dirs
new file mode 100755 (executable)
index 0000000..7daf57a
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# koha-create-dirs -- Create dirs for a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+userdir() {
+    local username="$1-koha"
+    local directory="$2"
+    if [ ! -d "$directory" ]
+    then
+        install -d -o "$username" -g "$username" "$directory"
+    fi
+}
+
+rootdir() {
+    local directory="$1"
+    if [ ! -d "$directory" ]
+    then
+        install -d -o root -g root "$directory"
+    fi
+}
+
+for name in "$@"
+do
+    rootdir "/var/spool/koha/$name"
+    userdir "$name" "/etc/koha/sites/$name"
+    userdir "$name" "/var/lib/koha/$name"
+    userdir "$name" "/var/lib/koha/$name/authorities"
+    userdir "$name" "/var/lib/koha/$name/biblios"
+    userdir "$name" "/var/lib/koha/$name/biblios/key"
+    userdir "$name" "/var/lib/koha/$name/biblios/register"
+    userdir "$name" "/var/lib/koha/$name/biblios/shadow"
+    userdir "$name" "/var/lock/koha/$name"
+    userdir "$name" "/var/lock/koha/$name/authorities"
+    userdir "$name" "/var/lock/koha/$name/biblios"
+    userdir "$name" "/var/run/koha/$name"
+    userdir "$name" "/var/run/koha/$name/authorities"
+    userdir "$name" "/var/run/koha/$name/biblios"
+done
+
diff --git a/debian/scripts/koha-create.8 b/debian/scripts/koha-create.8
new file mode 100644 (file)
index 0000000..618588f
--- /dev/null
@@ -0,0 +1,128 @@
+.\" Copyright 2010  Catalyst IT, Ltd
+.\" 
+.\" This program is free software: you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\" 
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\" 
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.TH KOHA-CREATE 8 2010-05-03 Koha
+.SH NAME
+koha-create \- create a new Koha instance
+.SH SYNOPSIS
+.B koha-create
+.IR instance-name
+.SH DESCRIPTION
+.B koha-create
+creates a new Koha instance.
+It is meant for a site that provides Koha hosting,
+and serves several sites from the same host.
+.PP
+The name of the instance is used as the domain name for Apache,
+and Unix user and group names, and MySQL username and table names
+are derived from it.
+Unix user and group are named
+.IR instance -koha.
+MySQL username is 
+.RI koha_ instance ,
+and table is
+.RI koha_ instance .
+.PP
+The Unix user has logins disabled.
+The password for MySQL is generated randomly, and printed to the terminal.
+.PP
+The instance name is used as the domain name (ServerName) for Apache.
+The open catalog (OPAC), for library customers, is on port 80.
+The librarian intranet interface is on port 8080.
+.PP
+After the Koha instance is created, it is ready to be used, 
+but the librarian needs to log in via the intranet and configure things.
+.PP
+Several configuration variables are available for adjusting this behavior.
+The variables are put into
+.B /etc/koha/koha-site.conf .
+The following variables are obeyed:
+.PP
+.TP
+.B DOMAIN
+The domain to append to the instance name, for Apache ServerName.
+Default is empty.
+The value must begin with a period.
+.TP
+.B INTRAPORT
+The port for the intranet.
+If you set this to empty or 80, then you
+.I must
+also define
+.B INTRAPREFIX
+or
+.BR INTRASUFFIX .
+.TP
+.B INTRAPREFIX
+This is inserted before the instance name when forming Apache ServerName.
+For subdomains, make sure it ends with a period.
+.TP
+.B INTRASUFFIX
+This is inserted after the instance name,
+but before the domain name,
+when forming Apache ServerName.
+.TP
+.B DEFAULTSQL
+An SQL file (possibly compressed with gzip) that can be fed to
+.BR mysql (1)
+to initialize the database after it has been created.
+Might be created using
+.BR koha-dump-defaults (8).
+.SH FILES
+.TP
+.B /etc/koha/koha-site.conf
+Configuration variables are read from this file, if it exists.
+.SH BUGS
+The program is a bit fragile.
+If something goes wrong, it does not clean up after itself.
+.SH EXAMPLE
+To create a new Koha instance:
+.PP
+.RS
+koha-create hslibrary
+.RE
+.PP
+The public catalog is now at 
+.I http://hslibrary/
+and the librarian interface at
+.IR http://hslibrary:8080/ .
+.PP
+To use full domain names, and have the intranet interface on port 80, but
+on a different domain name, add the following variables to the
+configuration file:
+.PP
+.nf
+.RS
+DOMAIN=".example.com"
+INTRAPORT=""
+INTRASUFFIX="-intra"
+.RE
+.fi
+.PP
+This will result in the addresses for the public and intranet interfaces
+becoming these:
+.PP
+.nf
+.RS
+http://hslibrary.example.com/
+http://hslibrary-intra.example.com/
+.RE
+.fi
+.PP
+Configuration changes only apply to instances created afterwards.
+.SH "SEE ALSO"
+.BR koha-remove (8).
+.PP
+.B http://koha-community.org/
+
diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable
new file mode 100755 (executable)
index 0000000..5d7aa36
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# koha-disable -- disable a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+# Parse command line.
+[ "$#" = 1 ] || die "Usage: $0 instancename..."
+
+
+for name in "$@"
+do
+    sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \
+        "/etc/apache2/sites-available/$name"
+done
+
+/etc/init.d/apache2 restart
diff --git a/debian/scripts/koha-dump b/debian/scripts/koha-dump
new file mode 100755 (executable)
index 0000000..ab2995e
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# koha-dump: dump all contents and configs for a Koha site
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+# Make sure the files we create are not accessible by anyone else.
+umask 0077
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+# Parse command line.
+[ "$#" = 1 ] || die "Usage: $0 instancename"
+name="$1"
+kohaconfig="/etc/koha/sites/$name/koha-conf.xml"
+date="$(date +%Y-%m-%d)"
+
+echo "Dumping Koha site $name:"
+
+
+# Dump database.
+mysqlhost="$(sed -n '/.*<hostname>\(.*\)<\/hostname>.*/s::\1:p' $kohaconfig)"
+mysqldb="$(sed -n '/.*<database>\(.*\)<\/database>.*/s::\1:p' $kohaconfig)"
+mysqluser="$(sed -n '/.*<user>\(.*\)<\/user>.*/s::\1:p' $kohaconfig | tail -n1)"
+mysqlpass="$(sed -n '/.*<pass>\(.*\)<\/pass>.*/s::\1:p' $kohaconfig)"
+dbdump="/var/spool/koha/$name/$name-$date.sql.gz"
+echo "* DB to $dbdump"
+mysqldump --databases --host="$mysqlhost" \
+    --user="$mysqluser" --password="$mysqlpass" "$mysqldb" | 
+    gzip > "$dbdump"
+chown "root:$name-koha" "$dbdump"
+chmod g+r "$dbdump"
+
+
+# Dump configs, logs, etc.
+metadump="/var/spool/koha/$name/$name-$date.tar.gz"
+echo "* configs, logs to $metadump"
+tar -C / -czf "$metadump" \
+    "etc/koha/sites/$name" \
+    "etc/apache2/sites-available/$name" \
+    "etc/apache2/sites-enabled/$name" \
+    "var/lib/koha/$name" \
+    "var/log/koha/$name"
+
+echo "Done."
diff --git a/debian/scripts/koha-dump-defaults b/debian/scripts/koha-dump-defaults
new file mode 100755 (executable)
index 0000000..1de7ed8
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# koha-dump-defaults: create default contents from an existing Koha site
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+# Parse command line.
+[ "$#" = 1 ] || die "Usage: $0 instancename"
+name="$1"
+kohaconfig="/etc/koha/sites/$name/koha-conf.xml"
+date="$(date +%Y-%m-%d)"
+
+
+mysqldb="$(sed -n '/.*<database>\(.*\)<\/database>.*/s::\1:p' $kohaconfig)"
+mysqluser="$(sed -n '/.*<user>\(.*\)<\/user>.*/s::\1:p' $kohaconfig | tail -n1)"
+mysqlpass="$(sed -n '/.*<pass>\(.*\)<\/pass>.*/s::\1:p' $kohaconfig)"
+mysqldump --databases --user="$mysqluser" --password="$mysqlpass" "$mysqldb" |
+    sed "s/$name/__KOHASITE__/g"
diff --git a/debian/scripts/koha-enable b/debian/scripts/koha-enable
new file mode 100644 (file)
index 0000000..3ceef2e
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# koha-enable -- enable a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+# Parse command line.
+[ "$#" = 1 ] || die "Usage: $0 instancename..."
+
+
+for name in "$@"
+do
+    sed -i 's:^\(\s*Include /etc/koha/apache-shared-disable.conf\)$:#\1:' \
+        "/etc/apache2/sites-available/$name"
+done
+
+/etc/init.d/apache2 restart
diff --git a/debian/scripts/koha-foreach b/debian/scripts/koha-foreach
new file mode 100755 (executable)
index 0000000..80152bc
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# koha-foreach -- run a command for each Koha instance
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+listopts=""
+if [ "$1" = --enabled ]
+then
+    listopts="--enabled"
+    shift
+fi
+
+
+for name in $(koha-list $listopts)
+do
+    sudo -u "$name-koha" \
+    env PERL5LIB=/usr/share/koha/lib \
+        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
+        "$@"
+done
+
diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list
new file mode 100755 (executable)
index 0000000..af810ae
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# koha-instances -- List all Koha instances.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+is_enabled() {
+    if grep '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
+            "/etc/apache2/sites-available/$name" > /dev/null
+    then
+        return 1
+    else
+        return 0
+    fi
+}
+
+all=yes
+if [ "$1" = --enabled ]
+then
+    shift
+    all=no
+fi
+
+find /etc/koha/sites -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | 
+sort |
+while read name
+do
+    if [ "$all" = yes ] || is_enabled "$name"
+    then
+        echo "$name"
+    fi
+done
diff --git a/debian/scripts/koha-rebuild-zebra b/debian/scripts/koha-rebuild-zebra
new file mode 100755 (executable)
index 0000000..7da1066
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# koha-rebuild-zebra -- Rebuild the Zebra database for a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+if [ "$1" = --full ]
+then
+    opts="-r"
+    shift
+else
+    opts="-z"
+fi
+
+
+for name in "$@"
+do
+    sudo -u "$name-koha" \
+    env PERL5LIB=/usr/share/koha/lib \
+        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
+        /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a $opts
+done
diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove
new file mode 100755 (executable)
index 0000000..de3fe1c
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# koha-remove -- Remove a Koha instance.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+for name in "$@"
+do
+    echo "Removing Koha instance $name"
+
+    mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
+DROP USER 'koha_$name';
+DROP DATABASE koha_$name;
+FLUSH PRIVILEGES;
+eof
+    
+    rm "/etc/apache2/sites-available/$name"
+    rm "/etc/koha/sites/$name/koha-conf.xml"
+    rm "/etc/koha/sites/$name/zebra-biblios.cfg"
+    rm "/etc/koha/sites/$name/zebra-authorities.cfg"
+    rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
+    rm "/etc/koha/sites/$name/zebra.passwd"
+    rmdir "/etc/koha/sites/$name"
+    rm -r "/var/lock/koha/$name"
+    rm -r "/var/log/koha/$name"
+    rm -r "/var/run/koha/$name"
+    deluser --quiet "$name-koha"
+    a2dissite "$name"
+done
+
+service apache2 restart
diff --git a/debian/scripts/koha-reset-passwd b/debian/scripts/koha-reset-passwd
new file mode 100755 (executable)
index 0000000..70ba3ba
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# koha-reset-passwd -- reset password for a user in a Koha instance
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+pwdigest() {
+    echo -n "$1" |
+    perl -e 'use Digest::MD5 qw(md5_base64);
+             while (<>) { print md5_base64($_), "\n"; }'
+}
+
+
+[ $# -lt 2 ] && die "Usage: $0 instancename username..."
+instance="$1"
+shift
+
+temp="$(mktemp)"
+
+cat <<eof > "$temp"
+use koha_$instance;
+eof
+
+for userid in "$@"
+do
+    password="$(pwgen -1)"
+    digest="$(pwdigest $password)"
+    echo "$userid $password"
+    echo "UPDATE borrowers SET password = '$digest' WHERE userid = '$userid';" \
+        >> "$temp"
+done
+
+mysql --defaults-extra-file=/etc/mysql/koha-common.cnf < "$temp"
+
+rm "$temp"
diff --git a/debian/scripts/koha-restart-zebra b/debian/scripts/koha-restart-zebra
new file mode 100755 (executable)
index 0000000..6b5c0ca
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# koha-restart-zebra -- Restart Zebra for named Koha instandes
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+for name in "$@"
+do
+    echo "Restarting Zebra server for $name"
+    daemon \
+        --name="$name-koha-zebra" \
+        --errlog="/var/log/koha/$name/zebra-error.log" \
+        --stdout="/var/log/koha/$name/zebra.log" \
+        --output="/var/log/koha/$name/zebra-output.log" \
+        --verbose=1 \
+        --respawn \
+        --delay=30 \
+        --user="$name-koha.$name-koha" \
+        --restart \
+        -- \
+        zebrasrv \
+        -v none,fatal,warn \
+        -f "/etc/koha/sites/$name/koha-conf.xml"
+done
diff --git a/debian/scripts/koha-restore b/debian/scripts/koha-restore
new file mode 100755 (executable)
index 0000000..560dc40
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# koha-restore: restore a Koha site from a dump (from koha-dump)
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+die() {
+    echo "$@" 1>&2
+    exit 1
+}
+
+
+# Parse command line.
+[ "$#" = 2 ] || die "Usage: $0 sqldump configdump"
+sqldump="$1"
+configdump="$2"
+
+
+# Verify that no files in the config dump exist on the filesystem.
+anyexists=no
+tar -tf "$configdump" |
+while read x
+do
+    if [ -e "/$x" ]
+    then
+        anyexists=yes
+        echo "ERROR: File exists: /$x" 1>&2
+    fi
+done
+if [ "$anyexists" = yes ]
+then
+    die "Config dump $configdump has files that exist on the filesystem."
+fi
+
+
+# Create user and group.
+name=$(tar tf "$configdump" | 
+       sed -n '/^etc\/koha\/sites\/\([^/]*\)\/$/s//\1/p')
+username="$name-koha"
+adduser --no-create-home --disabled-login --gecos "Koha instance $username" \
+    --quiet "$username"
+
+
+# Create dirs. Some of them will be in the tarball, but not all, e.g.,
+# /var/run and /var/lock.
+koha-create-dirs "$name"
+
+
+# Unpack tarball.
+tar -C / -xf "$configdump"
+
+
+# Re-create database and database user.
+mysqldb="koha_$name"
+mysqluser="koha_$name"
+mysqlpwd="$(sed -n '/.*<pass>\(.*\)<\/pass>.*/s//\1/p' /etc/koha/sites/$name/koha-conf.xml)"
+zcat "$sqldump" | mysql --defaults-extra-file=/etc/mysql/koha-common.cnf
+mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof || true
+DROP USER '$mysqluser';
+eof
+mysql --defaults-extra-file=/etc/mysql/koha-common.cnf << eof || true
+CREATE USER '$mysqluser' IDENTIFIED BY '$mysqlpwd';
+GRANT ALL PRIVILEGES ON $mysqldb.* TO '$mysqluser';
+FLUSH PRIVILEGES;
+eof
+koha-rebuild-zebra --full "$name"
+
+
+# Restart Apache.
+/etc/init.d/apache2 restart
+
diff --git a/debian/scripts/koha-start-zebra b/debian/scripts/koha-start-zebra
new file mode 100755 (executable)
index 0000000..52c6041
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# koha-start-zebra -- Start Zebra for named Koha instandes
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+for name in "$@"
+do
+    echo "Starting Zebra server for $name"
+    daemon \
+        --name="$name-koha-zebra" \
+        --errlog="/var/log/koha/$name/zebra-error.log" \
+        --stdout="/var/log/koha/$name/zebra.log" \
+        --output="/var/log/koha/$name/zebra-output.log" \
+        --verbose=1 \
+        --respawn \
+        --delay=30 \
+        --user="$name-koha.$name-koha" \
+        -- \
+        zebrasrv \
+        -v none,fatal,warn \
+        -f "/etc/koha/sites/$name/koha-conf.xml"
+done
diff --git a/debian/scripts/koha-stop-zebra b/debian/scripts/koha-stop-zebra
new file mode 100755 (executable)
index 0000000..3ddd697
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# koha-stop-zebra -- Stop Zebra for named Koha instandes
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+for name in "$@"
+do
+    echo "Stopping Zebra server for $name"
+    daemon \
+        --name="$name-koha-zebra" \
+        --errlog="/var/log/koha/$name/zebra-error.log" \
+        --stdout="/var/log/koha/$name/zebra.log" \
+        --output="/var/log/koha/$name/zebra-output.log" \
+        --verbose=1 \
+        --respawn \
+        --delay=30 \
+        --user="$name-koha.$name-koha" \
+        --stop \
+        -- \
+        zebrasrv \
+        -f "/etc/koha/sites/$name/koha-conf.xml"
+done
diff --git a/debian/scripts/koha-upgrade-schema b/debian/scripts/koha-upgrade-schema
new file mode 100755 (executable)
index 0000000..e641c57
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# koha-upgrade-schema -- Upgrade the DB schema for Koha instances.
+# Copyright 2010  Catalyst IT, Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e
+
+
+update="/usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl"
+for name in "$@"
+do
+    echo "Upgrading database schema for $name"
+    KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
+    PERL5LIB="/usr/share/koha/lib" \
+    "$update"
+done
+
index 163aaf8..89ae9db 100644 (file)
@@ -1 +1 @@
-3.0 (quilt)
+3.0 (native)
diff --git a/debian/templates/apache-shared-disable.conf b/debian/templates/apache-shared-disable.conf
new file mode 100644 (file)
index 0000000..0696bf0
--- /dev/null
@@ -0,0 +1,3 @@
+# This file is included in a Koha site's Apache config to disable the site.
+
+RewriteRule .* /unavailable.html [L]
diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf
new file mode 100644 (file)
index 0000000..04bab25
--- /dev/null
@@ -0,0 +1,19 @@
+# Apache configuration settings that are shared for every Koha instance.
+# This file contains settings for the intranet site.
+#
+# This file should be included from an instance's 
+# /etc/apache2/site-available file, from within the VirtualHost section
+# for the intranet.
+
+DocumentRoot /usr/share/koha/intranet/htdocs
+
+ScriptAlias /cgi-bin/koha/ "/usr/share/koha/intranet/cgi-bin/"
+ScriptAlias /index.html "/usr/share/koha/intranet/cgi-bin/mainpage.pl"
+ScriptAlias /search "/usr/share/koha/intranet/cgi-bin/search.pl"
+
+
+RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
+RewriteRule (.+) $1?%1%2 [N,R,NE]
+RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
+RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
+RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
diff --git a/debian/templates/apache-shared-opac.conf b/debian/templates/apache-shared-opac.conf
new file mode 100644 (file)
index 0000000..42715c8
--- /dev/null
@@ -0,0 +1,19 @@
+# Apache configuration settings that are shared for every Koha instance.
+# This file contains settings for the OPAC site.
+#
+# This file should be included from an instance's 
+# /etc/apache2/site-available file, from within the VirtualHost section
+# for OPAC.
+
+DocumentRoot /usr/share/koha/opac/htdocs
+
+ScriptAlias /cgi-bin/koha/ "/usr/share/koha/opac/cgi-bin/opac/"
+ScriptAlias /index.html "/usr/share/koha/opac/cgi-bin/opac/opac-main.pl"
+ScriptAlias /search "/usr/share/koha/opac/cgi-bin/opac/opac-search.pl"
+ScriptAlias /opac-search.pl "/usr/share/koha/opac/cgi-bin/opac/opac-search.pl"
+
+RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
+RewriteRule (.+) $1?%1%2 [N,R,NE]
+RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
+RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
+RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
diff --git a/debian/templates/apache-shared.conf b/debian/templates/apache-shared.conf
new file mode 100644 (file)
index 0000000..077bd7f
--- /dev/null
@@ -0,0 +1,69 @@
+# Apache configuration settings that are shared for every Koha instance.
+# This file contains settings that are the same for both the OPAC and
+# the Intranet site.
+#
+# This file should be included from an instance's 
+# /etc/apache2/site-available file, once from the OPAC section, and once
+# from the intranet section.
+
+
+SetEnv PERL5LIB "/usr/share/koha/lib"
+
+
+<IfModule mod_gzip.c>
+    mod_gzip_on yes
+    mod_gzip_dechunk yes
+    mod_gzip_keep_workfiles No
+    mod_gzip_can_negotiate yes
+    mod_gzip_update_static No
+    mod_gzip_temp_dir /tmp
+    mod_gzip_minimum_file_size 512
+    mod_gzip_maximum_file_size 1000000
+    mod_gzip_maximum_inmem_size 1000000
+    mod_gzip_handle_methods GET POST
+    mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
+    mod_gzip_item_exclude mime ^image/.*
+    mod_gzip_item_exclude rspheader Content-Type:image/*
+    mod_gzip_item_include file \.js$
+    mod_gzip_item_include mime ^application/x-javascript$
+    mod_gzip_item_include file \.php$
+    mod_gzip_item_include mime ^text/html$
+    mod_gzip_item_include file \.css$
+    mod_gzip_item_include mime ^text/css$
+</IfModule>
+
+
+<IfModule mod_deflate.c>
+    # Compress content with type html, text, and css, ...
+    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
+    AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
+
+    DeflateCompressionLevel 9
+
+    # Properly handle old browsers that do not support compression
+    BrowserMatch ^Mozilla/4 gzip-only-text/html
+    BrowserMatch ^Mozilla/4\.0[678] no-gzip
+    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
+
+    DeflateFilterNote Input instream
+    DeflateFilterNote Output outstream
+    DeflateFilterNote Ratio ratio
+
+    LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
+    <IfModule mod_headers.c>
+       #properly handle requests coming from behind proxies
+       Header append Vary User-Agent
+    </IfModule>
+</IfModule>
+
+
+Options +FollowSymLinks
+
+
+ErrorDocument 400 /cgi-bin/koha/errors/400.pl
+ErrorDocument 401 /cgi-bin/koha/errors/401.pl
+ErrorDocument 403 /cgi-bin/koha/errors/403.pl
+ErrorDocument 404 /cgi-bin/koha/errors/404.pl
+ErrorDocument 500 /cgi-bin/koha/errors/500.pl
+
+RewriteEngine On
diff --git a/debian/templates/apache-site.conf.in b/debian/templates/apache-site.conf.in
new file mode 100644 (file)
index 0000000..e9dbf93
--- /dev/null
@@ -0,0 +1,31 @@
+# Koha instance __KOHASITE__ Apache config.
+
+# OPAC
+<VirtualHost *:__OPACPORT__>
+   Include /etc/koha/apache-shared.conf
+#  Include /etc/koha/apache-shared-disable.conf
+   Include /etc/koha/apache-shared-opac.conf
+
+   ServerName __OPACSERVER__
+   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
+   AssignUserID __UNIXUSER__ __UNIXGROUP__
+
+   ErrorLog    /var/log/koha/__KOHASITE__/opac-error.log
+#  TransferLog /var/log/koha/__KOHASITE__/opac-access_log
+#  RewriteLog  /var/log/koha/__KOHASITE__/opac-rewrite.log
+</VirtualHost>
+
+# Intranet
+<VirtualHost *:__INTRAPORT__>
+   Include /etc/koha/apache-shared.conf
+#  Include /etc/koha/apache-shared-disable.conf
+   Include /etc/koha/apache-shared-intranet.conf
+   
+   ServerName __INTRASERVER__
+   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
+   AssignUserID __UNIXUSER__ __UNIXGROUP__
+
+   ErrorLog    /var/log/koha/__KOHASITE__/intranet-error.log
+#  TransferLog /var/log/koha/__KOHASITE__/intranet-access_log
+#  RewriteLog  /var/log/koha/__KOHASITE__/intranet-rewrite.log
+</VirtualHost>
diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in
new file mode 100644 (file)
index 0000000..d5ca838
--- /dev/null
@@ -0,0 +1,145 @@
+<yazgfs>
+
+<listen id="biblioserver" >unix:/var/run/koha/__KOHASITE__/bibliosocket</listen>
+<listen id="authorityserver" >unix:/var/run/koha/__KOHASITE__/authoritysocket</listen>
+
+<!-- BIBLIOGRAPHIC RECORDS -->
+<server id="biblioserver"  listenref="biblioserver"> 
+    <directory>/var/lib/koha/__KOHASITE__/biblios</directory>
+    <config>/etc/koha/sites/__KOHASITE__/zebra-biblios.cfg</config>
+    <cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn>
+     <retrievalinfo>
+       <retrieval syntax="usmarc" name="F"/>
+       <retrieval syntax="usmarc" name="B"/>
+       <retrieval syntax="xml" name="F"/>
+       <retrieval syntax="xml" name="B"/>
+       <retrieval syntax="xml" name="marcxml"
+                  identifier="info:srw/schema/1/marcxml-v1.1">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="dc">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2DC.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="mods">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2MODS.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="rdfdc">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="rss2">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2RSS2.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="utils">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl"/>
+         </backend>
+       </retrieval>
+     </retrievalinfo>
+</server>
+<serverinfo id="biblioserver">
+        <ccl2rpn>/etc/koha/zebradb/ccl.properties</ccl2rpn>
+        <user>kohauser</user>    
+        <password>__ZEBRA_PASS__</password>
+</serverinfo>
+
+<!-- AUTHORITY RECORDS -->
+<server id="authorityserver"  listenref="authorityserver" >
+    <directory>/var/lib/koha/__KOHASITE__/authorities</directory>
+    <config>/etc/koha/sites/__KOHASITE__/zebra-authorities-dom.cfg</config>
+    <cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn>
+    <xi:include href="/etc/koha/zebradb/retrieval-info-auth-dom.xml"
+                xmlns:xi="http://www.w3.org/2001/XInclude">
+      <xi:fallback>
+     <retrievalinfo>
+       <retrieval syntax="usmarc" name="F"/>
+       <retrieval syntax="usmarc" name="B"/>
+       <retrieval syntax="xml" name="marcxml"
+                  identifier="info:srw/schema/1/marcxml-v1.1">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="dc">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2DC.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="mods">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2MODS.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="rdfdc">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
+         </backend>
+       </retrieval>
+       <retrieval syntax="xml" name="utils">
+         <backend syntax="usmarc" name="F">
+           <marc inputformat="marc" outputformat="marcxml"
+                 inputcharset="utf-8"/>
+           <xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl"/>
+         </backend>
+       </retrieval>
+     </retrievalinfo>
+      </xi:fallback>
+    </xi:include>
+</server>
+<serverinfo id="authorityserver">
+    <ccl2rpn>/etc/koha/zebradb/ccl.properties</ccl2rpn>
+    <user>kohauser</user>
+    <password>__ZEBRA_PASS__</password>
+</serverinfo>
+
+<config>
+ <db_scheme>mysql</db_scheme>
+ <database>__DB_NAME__</database>
+ <hostname>__DB_HOST__</hostname>
+ <port>3306</port>
+ <user>__DB_USER__</user>
+ <pass>__DB_PASS__</pass>
+ <biblioserver>biblios</biblioserver>
+ <biblioservershadow>1</biblioservershadow>
+ <authorityserver>authorities</authorityserver>
+ <authorityservershadow>1</authorityservershadow>
+ <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
+ <opacdir>/usr/share/koha/opac/cgi-bin/opac</opacdir>
+ <opachtdocs>/usr/share/koha/opac/htdocs/opac-tmpl</opachtdocs>
+ <intrahtdocs>/usr/share/koha/intranet/htdocs/intranet-tmpl</intrahtdocs>
+ <includes>/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/includes/</includes>
+ <logdir>/var/log/koha/__KOHASITE__</logdir>
+ <install_log>/usr/share/koha/misc/koha-install-log</install_log>
+ <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
+ <memcached_servers></memcached_servers>
+ <memcached_namespace></memcached_namespace>
+</config>
+
+</yazgfs>
diff --git a/debian/templates/zebra-authorities-dom-site.cfg.in b/debian/templates/zebra-authorities-dom-site.cfg.in
new file mode 100644 (file)
index 0000000..5b8fd7a
--- /dev/null
@@ -0,0 +1,50 @@
+
+# Simple Zebra configuration file that defines
+# a database with MARCXML records.
+# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
+#
+# Where are the config files located?
+profilePath:/etc/koha/zebradb/authorities/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/marc21/authorities:/etc/koha/zebradb/lang_defs/en:/etc/koha/zebradb/xsl
+
+encoding: UTF-8
+# modulePath - where to look for loadable zebra modules
+modulePath: /usr/lib/idzebra-2.0/modules
+
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: explain.att
+attset: gils.att
+
+#systag sysno rank
+
+# Specify record type
+# group   .recordType[  .name  ]:  type
+# type is split into fundamental type. file-read-type . argument
+# http://www.indexdata.dk/zebra/doc/zebra-cfg.tkl
+# http://www.indexdata.dk/zebra/doc/grs.tkl
+recordtype: dom./etc/koha/zebradb/authorities/etc/dom-config.xml
+marcxml.recordtype: dom./etc/koha/zebradb/authorities/etc/dom-config.xml
+iso2709.recordtype: dom./etc/koha/zebradb/authorities/etc/dom-config-marc.xml
+
+recordId: (bib1,Local-Number)  
+# was auth1
+storeKeys:1
+storeData:1
+
+# Lock File Area
+lockDir: /var/lock/koha/__KOHASITE__/authorities
+perm.anonymous:ar
+perm.kohauser:rw
+register: /var/lib/koha/__KOHASITE__/authorities/register:4G
+shadow: /var/lib/koha/__KOHASITE__/authorities/shadow:1G 
+
+# Temp File area for result sets
+setTmpDir: /var/lib/koha/__KOHASITE__/authorities/tmp
+
+# Temp File area for index program
+keyTmpDir: /var/lib/koha/__KOHASITE__/authorities/key
+
+# Approx. Memory usage during indexing
+memMax: 50M
+rank:rank-1
+
diff --git a/debian/templates/zebra-authorities-site.cfg.in b/debian/templates/zebra-authorities-site.cfg.in
new file mode 100644 (file)
index 0000000..301e5e6
--- /dev/null
@@ -0,0 +1,61 @@
+
+# Simple Zebra configuration file that defines
+# a database with MARCXML records.
+# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
+#
+# Where are the config files located?
+profilePath:/etc/koha/zebradb/authorities/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/marc21/authorities:/etc/koha/zebradb/lang_defs/en
+
+encoding: UTF-8
+# modulePath - where to look for loadable zebra modules
+modulePath: /usr/lib/idzebra-2.0/modules
+
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: explain.att
+attset: gils.att
+
+#systag sysno rank
+
+# Specify record type
+# group   .recordType[  .name  ]:  type
+# type is split into fundamental type. file-read-type . argument
+# http://www.indexdata.dk/zebra/doc/zebra-cfg.tkl
+# http://www.indexdata.dk/zebra/doc/grs.tkl
+
+# Can use -g iso2709 to batch index raw iso2709 records in a single or
+# multiple files, or marcxml records that are split into separate files
+# the trailing .record tells zebraidx to use record.abs
+iso2709.recordType:grs.marcxml.record
+
+# Can use -g marcxml to batch index marcxml files
+# zebraidx uses record.abs because of <record> is the root element
+marcxml.recordType:grs.sgml
+
+# Koha uses grs.xml internally when updating a single record, no idea
+# why it knows to use record.abs
+recordType:grs.xml
+
+recordId: (bib1,Local-Number)  
+# was auth1
+storeKeys:1
+storeData:1
+
+# Lock File Area
+lockDir: /var/lock/koha/__KOHASITE__/authorities
+perm.anonymous:ar
+perm.kohauser:rw
+passwd: /etc/koha/sites/__KOHASITE__/zebra.passwd
+register: /var/lib/koha/__KOHASITE__/biblios/register:4G
+shadow: /var/lib/koha/__KOHASITE__/biblios/shadow:1G
+
+# Temp File area for result sets
+setTmpDir: /var/lib/koha/__KOHASITE__/authorities/tmp
+
+# Temp File area for index program
+keyTmpDir: /var/lib/koha/__KOHASITE__/authorities/key
+
+# Approx. Memory usage during indexing
+memMax: 50M
+rank:rank-1
+
diff --git a/debian/templates/zebra-biblios-site.cfg.in b/debian/templates/zebra-biblios-site.cfg.in
new file mode 100644 (file)
index 0000000..5402f37
--- /dev/null
@@ -0,0 +1,59 @@
+# Simple Zebra configuration file that defines
+# a database with MARCXML records.
+# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
+#
+# Where are the config files located?
+profilePath:/etc/koha/zebradb/biblios/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/marc21/biblios:/etc/koha/zebradb/lang_defs/en
+# modulePath - where to look for loadable zebra modules
+modulePath: /usr/lib/idzebra-2.0/modules
+
+encoding: UTF-8
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: explain.att
+attset: gils.att
+
+# systag sysno rank
+
+# Specify record type
+# group   .recordType[  .name  ]:  type
+# type is split into fundamental type. file-read-type . argument
+# http://www.indexdata.dk/zebra/doc/zebra-cfg.tkl
+# http://www.indexdata.dk/zebra/doc/grs.tkl
+
+# Can use -g iso2709 to batch index raw iso2709 records in a single or
+# multiple files, or marcxml records that are split into separate files
+# the trailing .record tells zebraidx to use record.abs
+iso2709.recordType:grs.marcxml.record
+
+# Can use -g marcxml to batch index marcxml files
+# zebraidx uses record.abs because of <record> is the root element
+marcxml.recordType:grs.sgml
+
+# Koha uses grs.xml internally when updating a single record, no idea
+# why it knows to use record.abs
+recordType:grs.xml
+
+recordId: (bib1,Local-number)
+storeKeys:1
+storeData:1
+
+
+# Lock File Area
+lockDir: /var/lock/koha/__KOHASITE__/biblios
+perm.anonymous:ar
+perm.kohauser:rw
+passwd: /etc/koha/sites/__KOHASITE__/zebra.passwd
+register: /var/lib/koha/__KOHASITE__/biblios/register:4G
+shadow: /var/lib/koha/__KOHASITE__/biblios/shadow:4G
+
+# Temp File area for result sets
+setTmpDir: /var/lib/koha/__KOHASITE__/biblios/tmp
+
+# Temp File area for index program
+keyTmpDir: /var/lib/koha/__KOHASITE__/biblios/key
+
+# Approx. Memory usage during indexing
+memMax: 50M
+rank:rank-1
+truncmax: 1000000000
diff --git a/debian/templates/zebra.passwd.in b/debian/templates/zebra.passwd.in
new file mode 100644 (file)
index 0000000..b21a10c
--- /dev/null
@@ -0,0 +1 @@
+kohauser:__ZEBRA_PASS__
diff --git a/debian/unavailable.html b/debian/unavailable.html
new file mode 100644 (file)
index 0000000..50c57f3
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Unavailable</title>
+</head>
+<body>
+
+<h1>Sorry!</h1>
+
+<p>The Koha site you are trying to access is currently unavailable,
+probably because of maintenance.
+This is not at all your fault, and we apologize for any inconvenience
+the downtime may cause you. Please check back in a while. 
+We hope to get things back up soon.</p>
+
+</body>
+</html>
index 82d0bdc..66947f2 100644 (file)
@@ -10,8 +10,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
 ('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
 ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'),
-('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>
-<<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
+('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
 ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
 ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'),
 ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).');
index 96e8ee2..023df9b 100644 (file)
@@ -11,8 +11,7 @@ VALUES
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
 ('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
 ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>'),
-('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>
-<<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
+('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
 ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
 ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'),
 ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).');
index 82d0bdc..66947f2 100644 (file)
@@ -10,8 +10,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
 ('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
 ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'),
-('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>
-<<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
+('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
 ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
 ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'),
 ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).');
index 82d0bdc..66947f2 100644 (file)
@@ -10,8 +10,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
 ('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
 ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'),
-('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>
-<<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
+('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
 ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
 ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'),
 ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).');
index 53fec36..d4e67c0 100755 (executable)
@@ -3605,6 +3605,16 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){
     SetVersion ($DBversion);
 }
 
+$DBversion = '3.01.00.135';
+if (C4::Context->preference('Version') < TransformToNum($DBversion)){
+    $dbh->do("
+        INSERT INTO `letter` (module, code, name, title, content) VALUES
+('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n')
+");
+    print "Upgrade to $DBversion done (bug 4377: added HOLD_PRINT message template)";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index 5c3900e..2763726 100644 (file)
@@ -4,6 +4,10 @@
 
 <script type="text/javascript">
 //<![CDATA[
+function print_slip(subscriptionid,issue){
+    var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue;
+    window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
+}
 function addsubscriptionid()
 {
        var tab=new Array();
@@ -192,6 +196,8 @@ $(document).ready(function() {
                 </th>
                 <th>Branch
                 </th>
+               <th>Routing
+               </th>
                 <th>Edit
                 </th>
             </tr>
@@ -218,6 +224,9 @@ $(document).ready(function() {
                 <td>
                     <!-- TMPL_VAR Name="branchcode" -->
                 </td>
+               <td>
+                  <a href="" onclick="print_slip(<!-- TMPL_VAR NAME="subscriptionid" ESCAPE="HTML" -->, '<!-- TMPL_VAR NAME="serialseq" ESCAPE="HTML" -->'); return false" >Print list</a>
+               </td>
                 <td>
                   <!--TMPL_IF Name="cannotedit"-->
                     disabled
index 774247f..dd73db9 100644 (file)
@@ -187,7 +187,10 @@ function CloneSubfield(index){
 </div>
 <!--/TMPL_IF -->
 
- <input type="hidden" name="op" value="serialchangestatus" />
+    <input type="hidden" name="op" value="serialchangestatus" />
+    <!--TMPL_LOOP Name="subscriptions"-->
+    <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
+    <!--/TMPL_LOOP -->
        <table>
        <tr>
                <th>Numbered</th>
@@ -204,7 +207,6 @@ function CloneSubfield(index){
     <!-- /TMPL_UNLESS -->
         <td>
             <input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->" />
-            <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
             <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
             <input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
             <input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
@@ -317,7 +319,6 @@ function CloneSubfield(index){
     <tr>
         <td>
             <input type="hidden" name="serialid" value="NEW" />
-            <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
             <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
             <input type="hidden" name="itemcount" value="<!-- TMPL_VAR name="issuesatonce" -->" />
             <input type="hidden" name="user" value="<!-- TMPL_VAR name="librarian" -->" />
index c5c4b73..7fcd66a 100644 (file)
         </span>
        </xsl:if>
 
-       <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr>
-
        <xsl:if test="marc:datafield[@tag=020]">
         <span class="results_summary"><span class="label">ISBN: </span>
         <xsl:for-each select="marc:datafield[@tag=020]">
index ed6f5a0..13714d4 100644 (file)
 
   <xsl:call-template name="tag_215" />
 
-  <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=090]/marc:subfield[@code='a']}"><!-- unAPI --></abbr>
-
 <xsl:if test="marc:controlfield[@tag=009]">
     <li><strong>PPN: </strong>
       <xsl:value-of select="marc:controlfield[@tag=009]"/>
index 3c6077e..2cde9f6 100644 (file)
         </span>
        </xsl:if>
 
-       <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=999]/marc:subfield[@code='c']}" ><!-- unAPI --></abbr>
-
        <xsl:if test="marc:datafield[@tag=020]">
         <span class="results_summary"><span class="label">ISBN: </span>
         <xsl:for-each select="marc:datafield[@tag=020]">
index ed8a4e0..3683246 100644 (file)
 
   <xsl:call-template name="tag_215" />
 
-  <abbr class="unapi-id" title="koha:biblionumber:{marc:datafield[@tag=090]/marc:subfield[@code='a']}"><!-- unAPI --></abbr>
-
   <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']">
     <span class="results_summary"><span class="label">ISBN: </span>
     <xsl:for-each select="marc:datafield[@tag=010]">
index 473e669..7dd7766 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.134';
+    our $VERSION = '3.01.00.135';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index e92ab43..3b1b98e 100755 (executable)
@@ -31,7 +31,6 @@ use C4::Members;
 use C4::Branch;
 use C4::Category;
 use File::Basename;
-use YAML;
 
 my $input = new CGI;
 my $quicksearch = $input->param('quicksearch');
index 34491c3..a142cb1 100755 (executable)
@@ -442,12 +442,13 @@ for (my $i=0;$i<=@servers;$i++) {
                 # because pazGetRecords handles retieving only the records
                 # we want as specified by $offset and $results_per_page,
                 # we need to set the offset parameter of searchResults to 0
-                my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
+                my @group_results = searchResults( 'opac', $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
                                                    @{ $group->{"RECORDS"} }, C4::Context->preference('hidelostitems'));
                 push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
             }
         } else {
-            @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}},, C4::Context->preference('hidelostitems'));
+            @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan,
+                                        @{$results_hashref->{$server}->{"RECORDS"}},, C4::Context->preference('hidelostitems'));
         }
                my $tag_quantity;
                if (C4::Context->preference('TagsEnabled') and
index e11cd0b..fc9ce51 100755 (executable)
@@ -68,7 +68,7 @@ else {
        $$suggestion{suggestedby} ||= $borrowernumber unless ($allsuggestions);
 }
 # warn "bornum:",$borrowernumber;
-use YAML;
+
 my $suggestions_loop =
   &SearchSuggestion( $suggestion);
 if ( $op eq "add_confirm" ) {
index 36f8ecd..bc3fc74 100755 (executable)
 
 use strict;
 use warnings;
+
+use CGI;
 use C4::Biblio;
 use C4::Items;
-use CGI;
 use C4::Output;
 use C4::Reserves;
 use C4::Circulation;
 use C4::Members;
+use C4::Auth qw/checkauth/;
 
-my $input = new CGI;
-#print $input->header;
+my $input = CGI->new();
 
+my ($user, $cookie, $sesion_id, $flags) = checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
 
 my @bibitems=$input->param('biblioitem');
 # FIXME I think reqbib does not exist anymore, it's used in line 82, to AddReserve of contraint type 'o'
index 67397e1..310624f 100755 (executable)
@@ -32,7 +32,6 @@ use C4::BackgroundJob;
 use C4::ClassSource;
 use C4::Dates;
 use C4::Debug;
-use YAML;
 use Switch;
 use MARC::File::XML;
 
index 893a913..dd81b4a 100755 (executable)
@@ -51,7 +51,7 @@ $template->output; # tossing output
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
 
 Galen Charlton <galen.charlton@liblime.com>
 
index 6231875..7e61524 100755 (executable)
@@ -23,7 +23,6 @@ use warnings;
 use Test::More qw(no_plan);
 
 use C4::Context;
-use YAML;
 
 my $root_dir = C4::Context->config( 'intranetdir' ) . '/installer/data/mysql';
 my $base_perms_file = "en/mandatory/userpermissions.sql";