dh-make-drupal - Easily debianize Drupal modules, themes

I have spent a couple of days working into dh-make-drupal. Yes, you guessed right: An idea based on the wonderful dh-make-perl, but applied to the Drupal Content Management System.
Drupal's greatest strengths, IMHO, are:

  • Drupal offers a huge number of modules and themes
  • Drupal has an amazingly sane configuration handling, where -contrary to what usually happens in PHP-land and, in general, among webapps- you set up the code only at a single place, with only the site-specific configuration (usually a single file) handling all of the differences

Yup, even though I am quite fond of its flexibility and power, I fell for Drupal in no small part because of its sysadmin-friendliness.

Now, I hate having non-Debian-packaged files spilled over my /usr/share partition. Drupal modules want to be installed in /usr/share/drupal5/modules/module_name (or s/5/6/ for Drupal6, to which I have not yet migrated). For that reason, over the last year I have been growing my personal apt repository of Drupal stuff. Yes, it is still on, and I don't plan on taking it off. You can access it by adding deb http://www.iiec.unam.mx/apt/ etch drupal to your /etc/apt/sources. However, you can now also do the process locally. Do you fancy the wonderful Biblio module? Or the very nice Abarre theme? Great!

  1. 0 gwolf@mosca『4/tmp$ ~/code/dh-make-drupal/dh-make-drupal --drupal 5 biblio
  2. 0 gwolf@mosca『5/tmp$ cd drupal5-mod-biblio-1.16/
  3. 0 gwolf@mosca『6/tmp/drupal5-mod-biblio-1.16$ debuild -us -uc >& /dev/null
  4. 0 gwolf@mosca『7/tmp/drupal5-mod-biblio-1.16$ cd ..
  5. 0 gwolf@mosca『8/tmp$ su
  6. Password:
  7. 0 root@mosca[1]/tmp# dpkg -i drupal5-mod-biblio_1.16-1_all.deb
  8. Selecting previously deselected package drupal5-mod-biblio.
  9. (Reading|> database ... 275110 files and directories currently installed.)
  10. Unpacking drupal5-mod-biblio (from drupal5-mod-biblio_1.16-1_all.deb) ...
  11. Setting up drupal5-mod-biblio (1.16-1) ...

Yay!

Yes, still many more things to come (i.e. including the debuild call and whatnot), but... Enjoy!

BTW, this piece of software owes a couple of beers to Why the lucky stiff, author of Hpricot. You are insane (but we are all well aware of that). You deserve to go to the webscraping heaven. Yes, besides the programming-languages-teaching-cartoon heaven. You find out how to split the time between them.

[Update]: Of course, ITP bug #514786 has been filed, and I will soon be uploading this into Debian.