Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Table of Contents
Info

For scripting changes, see Drupal 6 scripting changes or Drupal 7 scripting changes.
This page is about debian packaging of the drupal code tree and apache configuration.

Prerequisites

The following packages (and their dependencies) need to be installed:

Code Block
apt-get install git fakeroot dpkg-dev make debhelper 
apt-get install libperl6-slurp-perl libfile-slurp-perl 
apt-get install devscripts libgetopt-declare-perl libio-prompt-perl  libdatetime-perl libwant-perl libdatetime-locale-perl libdatetime-timezone-perl  libparams-validate-perl 
apt-get -f install

The following debian packages need to be checked out, built:

  • site-crondispatcher
  • sitepackage-base
Code Block
git clone git://git.liip.ch/public/elearning/deployment/sitepackage-base.git 
cd sitepackage-base
dpkg-buildpackage
cd ..
git clone git://git.catalyst.net.nz/site-crondispatcher.git 
cd site-crondispatcher
make
cd ..

Install both on server

Initial setup: dh-make-site.git

Note

Only needed initially when setting up packaging for the project.

dh-make-site is a small perl script that asks some questions and writes out the config file, (fake) Makefile (which just points to the real Makefile in the packaging/ submodule) and the changelog. It sets the project up, ready to be built by "make".

Installing dh-make-site:

Code Block
git clone git://git.liip.ch/public/elearning/deployment/dh-make-site 
cd dh-make-site 
make 
cd .. 
dpkg -i dh-make-site_0.40~beta1_all.deb

Packaging scripts

These are the Debian packaging scripts that will allow you to create the Debian package. There's one branch for Drupal 6 and another for Drupal 7. To get them, run the following commands in the root dir of your Drupal install:

Code Block
git clone git://git.liip.ch/public/elearning/deployment/sitepackaging packaging
cd packaging
# Replace drupal7 by drupal6 if you're using Drupal 6
git checkout -b drupal7 origin/drupal7

Building the package

See Debian Repository Light for how to proceed once you created the .deb file.

Rebuilding an existing version of a package

Warning

Make sure that you are building the package from a CLEAN project checkout, including all submodules, as the package will be built from the contents of your source tree.

The Make process takes the contents of packaging/debian_templates, templates them into debian/ (using the values in the config file) and then builds the .deb file, and deletes the contents of debian/ again. The reason for this is so that users don't have to commit the contents of the debian directory to their version control, which would result in conflicts every time a change was made to the template.

Code Block
# change into the root directory of your git checkout 
make

After the build process finishes, you should have a number of files in the parent directory (example):

drupal-site-<project>_6.18~dev-1.dsc
drupal-site-<project>_6.18~dev-1_i386.changes
drupal-site-<project>_6.18~dev-1.tar.gz
drupal-site-<project>-common_6.18~dev-1_all.deb
drupal-site-<project>-mysql_6.18~dev-1_all.deb
drupal-site-<project>-pgsql_6.18~dev-1_all.deb

The bold ones are those that you actually need.

Creating a new version of a package

If you want to create a new version of an existing package, you need to do the following first:

Code Block
# change to the root directory of your git checkout 
# run the following command 
dch -i --no-auto-nmu

This will open your default editor and present you with something similar to the following:

No Format
drupal-site-mysite (6.18~dev-3) unstable; urgency=low

  *

 -- Adrian Schlegel <adrian@liip.ch>  Mon, 21 Jun 2010 22:03:32 +0200

Make sure that your name and email address are correct. Then add a description of the reason for the update after the star ('*').

Note

When Building on Ubuntu:
Its possible that Ubuntu sets the version number to 6.18~dev-ubuntuXYZ instead of 6.18~dev-X. Make sure that version number is set as documented below !!

Example:

No Format
drupal-site-mysite (6.18~dev-3) unstable; urgency=low

  * Security update for module xy

 -- Adrian Schlegel <adrian@liip.ch>  Mon, 21 Jun 2010 22:03:32 +0200

Save your changes. This bumps up the version number of your package.

Next build the package as described in the previous section. This will give you packages with a higher version number.
If the packages build without a problem, you can commit the changes to the changelog:

Code Block
git commit -m '<the reason for the update>' debian/changelog

Finally, create a tag so that we know exactly what package is on which server on which date:

Code Block
git tag -s project-drupal-6-{staging\|prod}-YYYYMMDDXX (eg project-drupal-6-prod-2010083100 )

And then push your new tag and commit:

Code Block
git push origin project-drupal-6 project-drupal-6-prod-2010083100