This space is about packaging Moodle (

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




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

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

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)

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


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.


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:

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


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

Clean up:

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 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://

Building 1.9 package

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

Building old 1.8 package



TODO for the new, Moodle 2.2 package:

My blog (Tomek): , twitter: