Differences between revisions 28 and 29
Revision 28 as of 2010-06-21 19:15:02
Size: 4672
Editor: ?TomaszMuras
Comment:
Revision 29 as of 2010-06-22 18:31:56
Size: 4810
Editor: ?TomaszMuras
Comment:
Deletions are marked like this. Additions are marked like this.
Line 31: Line 31:

= Testing =
After the package is ready but before it's uploaded:
 * check if it builds in pbuilder ( pbuilder --build moodle_N.dsc )

Introduction

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

Changes applied to upstream code

Bundled libraries

  • smarty
  • YUI
  • 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
  • pclzip

    Moodle has modified the library a bit to fix the bug, see http://tracker.moodle.org/browse/MDL-7828 . This bug, however affects only Windows platform, so we should be fine replacing bundled library with one that is packaged in Debian.

  • Snoopy Ideally Snoopy should not be needed at all - as we depend on php5-curl. Unfortunately, it seems like some parts of the code use Snoopy directly instead of lib/filelib.php. Moodle has done some changes to the Snoopy class but they are only cosmetic - the version shipped with Debian should be just fine.

Patches

  • there is no need for any patches at this time

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 )

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

 git clone git://git.debian.org/pkg-moodle/moodle.git
 git branch upstream remotes/origin/upstream
 git-buildpackage

To push:

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

TODO

  • font in lib/default.ttf - lintian warning re font-in-non-font-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. There should be a question about admin's password.
  • 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 (ideally) 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

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