Koha/debian
Tomas Cohen Arazi c6f091cc23 Bug 10733: Memcached on package installs
This patch makes the koha-create script adjust the koha-conf.xml file
with the proper string substitutions to enable the use of memcached
for the created Koha instance.

It adds three option switches that control this:

 --use-memcached (defaults to "no")
 --memcached-servers "host1:port1,..." (defaults to '127.0.0.1:11211')
 --memcached-prefix "desired_namespace prefix" (defaults to 'koha_')

It respects the current schema configuration schema, where configuration
values are pondered like this:

hardcoded < koha-sites.conf < koha-create option switches

koha-sites.conf is read for USE_MEMCACHED, MEMCACHED_SERVERS and
MEMCACHED_PREFIX.

Note: the docs discourage setting user's own namespace prefix.

Using memcached is off as the default. The relevant configuration
variables will remain empty if the user doesn't pass --use-memcached
to the command. It matches the current behaviour.

To test:
- Apply the patch
- Build your own packages and install them on a test server
a) Create a new instance without using the new switches like:
 $ koha-create --create-db memctest
 - Check that /etc/koha/sites/memctest/koha-conf.xml contains:
   * Empty <memcached_servers> tag.
   * Empty <memcached_namespace> tag.

b) Play with the possible combination of option switches
(Note that the code defaults to empty and will remain like that if
--use-memcached is not used, so less tests...)

 $ koha-create --create-db --use-memcached memctest
 $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" memctest
 $ koha-create --create-db --use-memcached --memcached-servers "anything:xxx" --memcached-prefix "something" memctest
 $ koha-create --create-db --use-memcached --memcached-prefix "something" memctest

 - Check the koha-conf.xml and /etc/apache2/sites-enabled/memctest
   file reflect the chosen options.

c) Run
 $ koha-create --help
 - It should advertise this addition accordingly.

d) Run
 $ man koha-create
 - Man page for koha-create should provide good information on the new
   switches behaviour

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 03:27:51 +00:00
..
docs Bug 10733: Memcached on package installs 2013-10-30 03:27:51 +00:00
scripts Bug 10733: Memcached on package installs 2013-10-30 03:27:51 +00:00
source Switch to native source format. 2010-05-25 07:57:37 -04:00
templates Bug 10733: Memcached on package installs 2013-10-30 03:27:51 +00:00
bd-to-depends Add missing build-dependencies (python, python-debian). 2010-06-02 07:14:37 -04:00
build-git-snapshot Bug 10018 - version update for 3.13 2013-04-16 08:13:51 -07:00
changelog Bug 9918 - Changelog updates for 3.12 2013-03-27 21:49:09 -04:00
compat Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
control Bug 8798: (follow-up) add libdbix-class-schema-loader-perl to koha-perldeps 2013-10-14 21:21:30 +00:00
control.in Bug 10733: add 'memcached' as suggested dependency 2013-10-30 03:27:31 +00:00
copyright Update FSF address in debian/copyright. 2010-06-02 07:14:43 -04:00
koha-common.config Bug 10574 - mute the "upgrading from 3.2" message 2013-09-06 14:54:53 +00:00
koha-common.cron.d Bug 10379: silence zebra rebuild cron when no instances are enabled 2013-06-26 08:55:23 -07:00
koha-common.cron.daily Bug 6275 - allow automated backups for packages 2011-08-11 12:45:53 +12:00
koha-common.cron.hourly Add koha-foreach, a script to run a command for each Koha instance. 2010-05-25 07:59:45 -04:00
koha-common.default Bug 10617 - koha-common init script cleanup 2013-09-21 17:39:37 +00:00
koha-common.dirs Split off koha-common. 2010-05-25 07:58:56 -04:00
koha-common.docs Bug 10802: make Debian package install history.txt 2013-09-16 15:27:16 +00:00
koha-common.init Bug 10624: add 'status' option switch for the packages init script 2013-10-09 04:53:42 +00:00
koha-common.install Bug 10802: make Debian package install history.txt 2013-09-16 15:27:16 +00:00
koha-common.logrotate Split off koha-common. 2010-05-25 07:58:56 -04:00
koha-common.postinst Bug 6361 - make the packages work with koha 3.4 2011-06-03 11:06:31 +12:00
koha-common.README.Debian Bug 5139 - packages now do email and other cron jobs 2010-10-06 08:12:14 -04:00
koha-common.templates Bug 6361 - make the packages work with koha 3.4 2011-06-03 11:06:31 +12:00
koha-post-install-setup Add koha-post-install-setup, a script to be run by sysadmin post-install. 2010-05-25 07:59:19 -04:00
koha.apache-ports Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.config Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.dirs Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.install Bug 7818 : Following, fixing so the packages build Still need to update koha-create to make use of the new file 2012-07-06 11:17:19 +02:00
koha.postinst Bug 4817: Point to README.Debian in koha package description, postinst output. 2010-05-27 05:19:03 -04:00
koha.postrm When purging, remove /var/log/koha. 2010-04-22 06:15:31 -04:00
koha.prerm Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.README.Debian Bug 5550 - correct filename referenced in docs 2011-01-01 07:43:30 +13:00
list-deps Bug 9592 - update dependencies, allow blacklisting 2013-02-15 08:06:51 -05:00
README.build Bug 5602: Changes to account for the version update. 2011-08-04 10:26:39 +12:00
rules Bug 10802: make Debian package install history.txt 2013-09-16 15:27:16 +00:00
unavailable.html Add koha-disable, a script to disable a Koha instance. 2010-05-25 07:59:29 -04:00
update-control Add tools to update debian/control's build dependencies. 2010-06-02 07:14:36 -04:00

In order to build .deb packages, following debian packages need to be present
(installed): 
devscripts
pbuilder
dh-make
fakeroot

As root (or sudo) execute:
pbuilder create

Executing build-git-snapshot without any arguments will leave package and the
rest in some pbuilder dir, eg. /var/cache/pbuilder/result It is highly
recommended that --buildresult option is used.