Tidying up my repository

Ive tidied up my repo a bit, if you are using ubuntu hardy, I have packages for amd64. To use them, add

deb http://apt.workbuffer.org/ hardy all
To your /etc/apt/sources.list

For Debian unstable, I only have i386 packages
deb http://apt.workbuffer.org/ unstable all

Then
sudo apt-get install cpan-libkoha-perl
If you want to try my expiremental, Koha package, or if you just want to install the bundle of Koha dependent modules, to make the rest of the install easier, then.

sudo apt-get install cpan-libkoha-support-bundle-perl

First crack at a Koha3 .deb

Well ive managed to build a package, with the correct dependencies, its set up to do a standard install, using the default values.


chris@ubuntu:~$ sudo apt-get install cpan-libkoha-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
cpan-libalgorithm-checkdigits-perl cpan-libansicolor-perl cpan-libbiblio-endnotestyle-perl cpan-libcgi-perl
cpan-libclass-adapter-perl cpan-libconstant-perl cpan-libdata-dumper-perl cpan-libdigest-md5-perl
cpan-libexporter-perl cpan-libgetopt-long-perl cpan-libhtml-template-pro-perl cpan-liblocale-codes-perl
cpan-libmime-base64-perl cpan-libmodule-pluggable-perl cpan-libparams-util-perl cpan-libperl-ldap-perl
cpan-libpod-parser-perl cpan-libscalar-list-utils-perl cpan-libsms-send-perl cpan-libtest-manifest-perl
cpan-libtest-simple-perl cpan-libtext-csv-perl cpan-libtext-csv-xs-perl cpan-libtext-tabs-wrap-perl
cpan-libtime-hires-perl cpan-libunicode-normalize-perl cpan-libxml-libxml-perl cpan-libxml-rss-perl
libbarcode-code128-perl libclass-returnvalue-perl libdata-ical-perl libdigest-perl libgd-barcode-perl
libgd-gd2-noxpm-perl libhtml-scrubber-perl libnet-z3950-zoom-perl libpdf-reuse-barcode-perl libpdf-reuse-perl
libschedule-at-perl libtext-vfile-asdata-perl
The following NEW packages will be installed:
cpan-libalgorithm-checkdigits-perl cpan-libansicolor-perl cpan-libbiblio-endnotestyle-perl cpan-libcgi-perl
cpan-libclass-adapter-perl cpan-libconstant-perl cpan-libdata-dumper-perl cpan-libdigest-md5-perl
cpan-libexporter-perl cpan-libgetopt-long-perl cpan-libhtml-template-pro-perl cpan-libkoha-perl
cpan-liblocale-codes-perl cpan-libmime-base64-perl cpan-libmodule-pluggable-perl cpan-libparams-util-perl
cpan-libperl-ldap-perl cpan-libpod-parser-perl cpan-libscalar-list-utils-perl cpan-libsms-send-perl
cpan-libtest-manifest-perl cpan-libtest-simple-perl cpan-libtext-csv-perl cpan-libtext-csv-xs-perl
cpan-libtext-tabs-wrap-perl cpan-libtime-hires-perl cpan-libunicode-normalize-perl cpan-libxml-libxml-perl
cpan-libxml-rss-perl libbarcode-code128-perl libclass-returnvalue-perl libdata-ical-perl libdigest-perl
libgd-barcode-perl libgd-gd2-noxpm-perl libhtml-scrubber-perl libnet-z3950-zoom-perl
libpdf-reuse-barcode-perl libpdf-reuse-perl libschedule-at-perl libtext-vfile-asdata-perl
0 upgraded, 41 newly installed, 0 to remove and 46 not upgraded.
Need to get 3156kB of archives.
After this operation, 24.9MB of additional disk space will be used.
Do you want to continue [Y/n]?

Setting up libpdf-reuse-barcode-perl (0.05-1) ...
Setting up cpan-libperl-ldap-perl (0.36-1) ...
Setting up libschedule-at-perl (1.06-1) ...
Setting up cpan-libmodule-pluggable-perl (3.8-1) ...
Setting up cpan-libparams-util-perl (0.33-1) ...
Setting up cpan-libsms-send-perl (0.05-1) ...
Setting up cpan-libtext-csv-perl (1.06-1) ...
Setting up cpan-libtext-csv-xs-perl (0.52-1) ...
Setting up cpan-libtext-tabs-wrap-perl (2006.1117-1) ...
Setting up cpan-libtime-hires-perl (1.9715-1) ...
Setting up cpan-libunicode-normalize-perl (1.02-1) ...
Setting up cpan-libxml-libxml-perl (1.66-1) ...
Setting up cpan-libtest-manifest-perl (1.22-1) ...
Setting up cpan-libxml-rss-perl (1.33-1) ...
Setting up cpan-libdigest-md5-perl (2.36-1) ...
Setting up cpan-libkoha-perl (3.00.00-stableRC1-1) ...

chris@ubuntu:~$ ls /usr/share/koha/
bin doc intranet lib man misc opac

Next phase is to get it using debconf to allow the user to set the values themselves.

Making installing Koha dependencies easier

I did some work with CPANPLUS specifically using cpan2dist and CPANPLUS::Dist::Deb to create a distribution using Bundle::KohaSupport as the base.

So now we can do this, add a line to our sources.list
deb http://apt.workbuffer.org/ unstable main

run apt-get update
Then

chris@ubuntu:~/git/koha.git$ sudo apt-get install cpan-libbundle-kohasupport-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
cpan-libalgorithm-checkdigits-perl cpan-libansicolor-perl cpan-libbiblio-endnotestyle-perl cpan-libcgi-perl
cpan-libclass-adapter-perl cpan-libconstant-perl cpan-libdata-dumper-perl cpan-libdigest-md5-perl
cpan-libexporter-perl cpan-libgetopt-long-perl cpan-libhtml-template-pro-perl cpan-liblocale-codes-perl
cpan-libmime-base64-perl cpan-libmodule-pluggable-perl cpan-libparams-util-perl cpan-libperl-ldap-perl
cpan-libpod-parser-perl cpan-libscalar-list-utils-perl cpan-libsms-send-perl cpan-libtest-manifest-perl
cpan-libtest-simple-perl cpan-libtext-csv-perl cpan-libtext-csv-xs-perl cpan-libtext-tabs-wrap-perl
cpan-libtime-hires-perl cpan-libunicode-normalize-perl cpan-libxml-libxml-perl cpan-libxml-rss-perl
libbarcode-code128-perl libclass-returnvalue-perl libdata-ical-perl libdigest-perl libfile-temp-perl
libgd-barcode-perl libgd-gd2-noxpm-perl libhtml-scrubber-perl libnet-z3950-zoom-perl
libpdf-reuse-barcode-perl libpdf-reuse-perl libschedule-at-perl libtext-vfile-asdata-perl
The following NEW packages will be installed:
cpan-libalgorithm-checkdigits-perl cpan-libansicolor-perl cpan-libbiblio-endnotestyle-perl
cpan-libbundle-kohasupport-perl cpan-libcgi-perl cpan-libclass-adapter-perl cpan-libconstant-perl
cpan-libdata-dumper-perl cpan-libdigest-md5-perl cpan-libexporter-perl cpan-libgetopt-long-perl
cpan-libhtml-template-pro-perl cpan-liblocale-codes-perl cpan-libmime-base64-perl
cpan-libmodule-pluggable-perl cpan-libparams-util-perl cpan-libperl-ldap-perl cpan-libpod-parser-perl
cpan-libscalar-list-utils-perl cpan-libsms-send-perl cpan-libtest-manifest-perl cpan-libtest-simple-perl
cpan-libtext-csv-perl cpan-libtext-csv-xs-perl cpan-libtext-tabs-wrap-perl cpan-libtime-hires-perl
cpan-libunicode-normalize-perl cpan-libxml-libxml-perl cpan-libxml-rss-perl libbarcode-code128-perl
libclass-returnvalue-perl libdata-ical-perl libdigest-perl libfile-temp-perl libgd-barcode-perl
libgd-gd2-noxpm-perl libhtml-scrubber-perl libnet-z3950-zoom-perl libpdf-reuse-barcode-perl libpdf-reuse-perl
libschedule-at-perl libtext-vfile-asdata-perl
0 upgraded, 42 newly installed, 0 to remove and 39 not upgraded.
Need to get 3046kB of archives.
After this operation, 23.6MB of additional disk space will be used.
Do you want to continue [Y/n]?

The trick thing is, it will use the packages in the main debian repo first (like libfile-temp-perl above) and then use the package built from cpan if it can’t find one (like cpan-libtest-manifest-perl)

Ive only built packages for amd64 at this point (well a lot are architecture independent), but if others would find it useful I can add i386 packages to my repo as well.

A geeky way to spend your lunch break

So I spent 20 mins whacking some caching in around the _build_langauges_arrayref subroutine in C4::Languages in Koha.
Before and After. Ill take that as a win. All that needs to be done now is add code to the script that handles updating the language syspref, so that it clears the cache when its changed.

Koha profiling

So far ive only profiled opac-search.pl and opac-main.pl, the results are here. From them I can see doing some caching in the C4::Languages module might speed things up. If you look here you can see its doing a lot of work, and it does this work for each page. So if we cache the data structure resulting from the build_langauges_arrayref, and just return that in the subsequent calls, we should win some decent performance.
Ill work on that tomorrow night, and post the new profiles

Too much weights, not enough speed work

Following on from testing Koha with memcached, I decided to test the opac with mod_perl, mod_expires and mod_deflate.
So with no mod_perl and no caching
time curl http://opac.koha.workbuffer.org/cgi-bin/koha/opac-search.pl?q=a
real 0m2.993s

And with mod_perl
time curl http://opac.koha.workbuffer.org/cgi-bin/koha/opac-search.pl?q=a
real 0m0.657s

And now opac main is down too

real 0m0.010s

This of course isn’t really testing mod_expires or mod_deflate, but certainly telling the browser to cache the images, css and javascript helps out a lot there too.

(Oh and if you haven’t seen the movie Once were Warriors, the title won’t make sense, i’m sure if you search on youtube you can find the clip)