@@ -, +, @@
http://www.sitemaps.org/protocol.html#submit_robots
- You can build a package out of this patchset, or do the following on a kohadevbox
cp debian/scripts/koha-functions.sh /usr/share/koha/bin
- Run
$ debian/scripts/koha-sitemap --help
- Go through all the options (--enable, --disable, generate).
- debian/scripts/koha-sitemap --enable kohadev
- call it again, a suitable warning is raised and the file is still there
- call it again, a suitable warning is raised and the file does not exist
- debian/scripts/koha-sitemap --generate kohadev
/var/lib/koha/kohadev/sitemap/
- Sign off :-D
---
debian/docs/koha-sitemap.xml | 92 ++++++++++++++
debian/koha-common.install | 1 +
debian/scripts/koha-functions.sh | 11 ++
debian/scripts/koha-sitemap | 208 +++++++++++++++++++++++++++++++
debian/templates/apache-shared-opac.conf | 7 ++
5 files changed, 319 insertions(+)
create mode 100644 debian/docs/koha-sitemap.xml
create mode 100755 debian/scripts/koha-sitemap
--- a/debian/docs/koha-sitemap.xml
+++ a/debian/docs/koha-sitemap.xml
@@ -0,0 +1,92 @@
+
+koha-sitemap
+
+Koha is the first free software library automation package.
+
+ The Koha community
+ http://koha-community.org/
+
+
+
+
+
+
+ koha-sitemap
+ 8
+
+
+
+ koha-sitemap
+ Manage sitemaps for Koha instances.
+ UNIX/Linux
+
+
+
+
+ koha-sitemap
+
+ |
+ |
+ |
+ |
+ ||
+
+ instancename
+
+
+
+ Options
+
+
+
+
+
+
+ Enable sitemap generation for the desired Koha instances.
+
+
+
+
+
+
+ Disable sitemap generation for the desired Koha instances.
+
+
+
+
+
+
+ Generate sitemap for the desired Koha instances.
+
+
+
+
+
+
+ Make the script quiet about non existent instance names or missing directories. Useful when calling koha-sitemap from another scripts.
+
+
+
+
+
+
+ Show usage information.
+
+
+
+
+
+
+ Description
+ The koha-sitemap script lets you manage your Koha instances sitemaps.
+
+
+ See also
+
+ /etc/default/koha-common
+
+
+
+
+
+
--- a/debian/koha-common.install
+++ a/debian/koha-common.install
@@ -29,6 +29,7 @@ debian/scripts/koha-restart-zebra usr/sbin
debian/scripts/koha-restore usr/sbin
debian/scripts/koha-run-backups usr/sbin
debian/scripts/koha-shell usr/sbin
+debian/scripts/koha-sitemap usr/sbin
debian/scripts/koha-start-zebra usr/sbin
debian/scripts/koha-stop-zebra usr/sbin
debian/scripts/koha-translate usr/sbin
--- a/debian/scripts/koha-functions.sh
+++ a/debian/scripts/koha-functions.sh
@@ -95,6 +95,17 @@ is_sip_enabled()
fi
}
+is_sitemap_enabled()
+{
+ local instancename=$1
+
+ if [ -e /var/lib/koha/$instancename/sitemap.enabled ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
is_zebra_running()
{
local instancename=$1
--- a/debian/scripts/koha-sitemap
+++ a/debian/scripts/koha-sitemap
@@ -0,0 +1,208 @@
+#!/bin/bash
+#
+# Copyright 2016 Theke Solutions
+#
+# This file is part of Koha.
+#
+# 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 .
+
+set -e
+
+. /lib/lsb/init-functions
+
+# Read configuration variable file if it is present
+[ -r /etc/default/koha-common ] && . /etc/default/koha-common
+
+# include helper functions
+if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
+ . "/usr/share/koha/bin/koha-functions.sh"
+else
+ echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
+ exit 1
+fi
+
+usage()
+{
+ local scriptname=$(basename $0)
+
+ cat <&2 <= 2.4>
+ AliasMatch "^/sitemap(.*)" "/var/lib/koha/${instance}/sitemap/sitemap$1"
+
+ Require all granted
+
+
--