Differences between revisions 50 and 51
Revision 50 as of 2013-03-12 20:33:37
Size: 7365
Editor: ?TomaszMuras
Comment:
Revision 51 as of 2013-07-01 21:52:52
Size: 7357
Editor: ?AlanMoore
Comment: removed duplicate word
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
This is unfortunate because the only possible upgrade path is 1.9 -> 2.2 -> 2.3+. For users willing willing to upgrade from 1.9 in the future, 2.2 version will be provided in wheezy-backports. This one, however will not have security fixes applied and should only be used as the intermediate step for an upgrade. This is unfortunate because the only possible upgrade path is 1.9 -> 2.2 -> 2.3+. For users willing to upgrade from 1.9 in the future, 2.2 version will be provided in wheezy-backports. This one, however will not have security fixes applied and should only be used as the intermediate step for an upgrade.

Introduction

This space is about packaging Moodle (www.moodle.org)

Current status

As of 12 March 2013.

In current stable - Debian 6, squeeze Moodle 1.9 is packaged.

Moodle 2.2 was packaged for the next Debian release - wheezy but this version is already too old and will soon stop being maintained by upstream. As such it's not possible to keep a high quality 2.2 version of Moodle in Debian and Moodle package was removed from wheezy. Instead, the LTS Moodle version (if there ever is one like this) will be packaged for the next+1 Debian release - jessie.

This is unfortunate because the only possible upgrade path is 1.9 -> 2.2 -> 2.3+. For users willing to upgrade from 1.9 in the future, 2.2 version will be provided in wheezy-backports. This one, however will not have security fixes applied and should only be used as the intermediate step for an upgrade.

Again: there will be a gap in availability of moodle package for Debian (1.9 in Debian 6, nothing in Debian 7, 2.6 (possibly) in Debian 8).

Changes applied to upstream code

Bundled libraries

  • smarty
  • YUI - unbundled for YUI2 (libjs-yui) but YUI3 is still there
  • magpie
  • nusoap (529573) - there is no need for this library in PHP5

  • fpdf in lib/fpdf - left one extra file fpdfprotection.php that is not packaged with php-fpdf
  • PHP Markdown libmarkdown-php is packaged by Debian but Moodle uses a different version - PHP Markdown Extra
  • HTML purifier. Packaged in Debian as php-htmlpurifier but Moodle contains modified version. Upstream patches:
  • PHPCAS
  • within PHPCAS: domxml-php4-php5.php
  • phpmailer. From Dan: With regard to non-patched versions of the library, I made just that change in Moodle 2.0 to get Moodle to do the customisations within a subclass. So it should be possible to do this with the standard libraries linked in Debian now.
  • overlib JS library. Upstream is working on removing it: http://tracker.moodle.org/browse/MDL-21533 .

Patches

  • Moodle uses old YUI library that contains beta or experimental files (with -experimental- or -beta- in the filename). Debian ships with a newer version of YUI library "libjs-yui" where these files are renamed. The patch updates file names in lib/ajax/ajaxlib.php. Reported in #589612

Other

  • Chat daemon script is not shipped (rm debian/moodle/usr/share/moodle/mod/chat/chatd.php)
  • admin/delete.php used to be removed because of security issue that has since been fixed upstream
  • mod/wiki/ewiki/fragments/mkhuge was removed as well, I don't know why
  • lib/editor/htmlarea/plugins/SpellChecker was removed - I don't know why

Testing

After the package is ready but before it's uploaded:

  • check if it builds in pbuilder ( pbuilder --build moodle_N.dsc )
  • lintian -v moodle_*.changes
  • update previous version with the new package
  • downgrade to the previous version
  • remove the package and reinstall it

Config files

Apache config

I (Tomek) currently don't see a good method of generating apache configuration automatically. Alias directive will not work well with vhosts. Until I find some nicer way, I would like to ship the package that builds sample Apache configs but does not enable them.

Moodle config

  • $CFG->dbpersist

By default Moodle will use persistent connections so there is no need to set this one up. The code from 1.9.8:

if (!isset($CFG->dbpersist) or !empty($CFG->dbpersist)) {    // Use persistent connection (default)
  • $CFG->respectsessionsettings

respectsessionsettings should be set to true if user wants to configure sessions in php.ini, httpd.conf or .htaccess.

Post-installation

Install with alias:

 ln -s /etc/moodle/apache.conf /etc/apache2/conf.d/moodle

Install as vhost:

 ln -s /etc/moodle/apache.vhost.conf /etc/apache2/sites-enabled/moodle

Language packs

Moodle used to be distributed with the several language packs but it's not anymore. This means that while upgrading from 1.8.2 to the latest 1.9.8, language packs will be removed.

Other

Find all license files:

find . -type f -iregex '.*\(license\|copying\).*'

Find all unnecessary files:

find . -type f -name .cvsignore

Debugging package

Pack files into debian package: pack.sh

tar -zcf control.tar.gz conffiles control md5sums postinst preinst config debian-binary postrm prerm
ar r moodle_1.9.8-1_all.deb debian-binary control.tar.gz data.tar.gz
./clean.sh

Unpack: unpack.sh

ar x moodle_1.9.8-1_all.deb
tar -zxf control.tar.gz

Clean up: clean.sh

rm data.tar.gz control.tar.gz conffiles control md5sums postinst preinst config debian-binary postrm prerm

Building the package

Building newest (2.2) package

 git clone git://git.debian.org/pkg-moodle/moodle.git
 git branch upstream remotes/origin/upstream
 git branch dfsg_clean_22 remotes/origin/dfsg_clean_22
 git branch wheezy remotes/origin/wheezy
 git-buildpackage  --git-debian-branch=wheezy --git-upstream-branch=dfsg_clean_22 --git-upstream-tree=branch

To push:

 git push git+ssh://USERNAME@git.debian.org/git/pkg-moodle/moodle.git

Building 1.9 package

  git-buildpackage --git-debian-branch=squeeze

Building old 1.8 package

 dpkg-buildpackage

TODO

TODO for the new, Moodle 2.2 package:

  • create a script for gathering information for bug reports (and add dh_bugfiles)
  • on the first install we don't need user to actually go to the site and click through the installation process - whole database could be dumped as a template and then restored using dbconfig. Even better yet, DB dump could be read for new installations (so it's quick) and Moodle CLI script could be used for upgrades.
  • add a question about installing moodle using Apache alias (to /moodle). If user answers "yes", Moodle will be installed automatically, and Apache rebooted.
  • improve debian/rules: use overrides or cdbs
  • use podebconf for translations
  • create helper for packaging Moodle modules, themes, languages, filters - aka http://packages.debian.org/unstable/web/dh-make-drupal

  • create symlinks with dh_link
  • change format of debian/copyright into http://dep.debian.net/deps/dep5/. As a bonus convience Moodle upstream to change lib/trirdpartylibs.xml into dep5.

  • do something with ?DragMath .jar files currently bundled with Moodle (see http://tracker.moodle.org/browse/MDL-32450)

  • Moodle DB is created with MyISAM not InnoDB

My blog (Tomek): http://techblog.zabuchy.net , twitter: http://twitter.com/zabuch