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!
0 gwolf@mosca『4』/tmp$ ~/code/dh-make-drupal/dh-make-drupal --drupal 5 biblio
0 gwolf@mosca『5』/tmp$ cd drupal5-mod-biblio-1.16/
0 gwolf@mosca『6』/tmp/drupal5-mod-biblio-1.16$ debuild -us -uc >& /dev/null
0 gwolf@mosca『7』/tmp/drupal5-mod-biblio-1.16$ cd ..
0 gwolf@mosca『8』/tmp$ su
0 root@mosca/tmp# dpkg -i drupal5-mod-biblio_1.16-1_all.deb
Selecting previously deselected package drupal5-mod-biblio.
(Reading database ... 275110 files and directories currently installed.)
Unpacking drupal5-mod-biblio (from drupal5-mod-biblio_1.16-1_all.deb) ...
Setting up drupal5-mod-biblio (1.16-1) ...
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.
Andrey Chernomyrdin 2009-12-23 02:09:26
dh-make-drupal not properly work
I try to use dh-make-drupal under unstable
$ dh-make-drupal biblio ERROR: No suitable version found for Drupal 6 (level>=recommended) $ dpkg -l dh-make-drupal Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii dh-make-drupal 0.4-2 Create Debian packages from Drupal modules a
may be design of page http://drupal.org/project/* was changed and html parse get worng data ?
Anonymous 2010-08-18 13:52:45
I found a couple unspecified dependencies that I needed (fresh Ubuntu 10.04):
After installing those, everything worked great!
Also, I realized that if I specified the Drupal module’s name with any capital letters, it would fail… switching to all lower case fixed that problem.
Anyway, thanks for creating and publishing this utility!
gwolf 2009-12-23 22:31:47
Aware of the fact…
Thanks a lot - this was reported to me as bug #561946 in the Debian BTS. I will look into the problem and upload a new version as soon as possible.
gwolf 2010-08-10 11:09:11
Copyright information required
Oh! Well, this comes as a surprise, but then again, it does not… that much.
Thing is, Debian packages require having a debian/copyright file. And all Drupal projects include that information in a couple of places:
- Has the GPLv2, which is the only license accepted by the Drupal repository. In fact, my code just checks whether it is the exact file (by looking at its MD5 digest), or marks it as unknown
- The Drupal web site
- The actual name of the author is downloaded from the "profile-full-name" element of the page linked at the "info-page" element of the project's page
So, in short, what do I suggest? Try creating a LICENSE.txt. Even if it contains rubbish. It should work. If it does, please tell me. If it does not, please… Tell me as well! :)
(And, yes, I’m fixing it for the next release)
gwolf 2010-08-22 10:01:19
Fixed since April… Just after that Ubuntu release :-/
dh-make-drupal 0.6-2 includes the needed changes - but I uploaded it in April, by which time Ubuntu 10.04 was already out. Thanks for the report, though!
Nadezhda 2009-02-10 14:25:00
Nadezhda was here ;) :*
Nadezhda was here ;) :*
Roel de Cock 2010-08-10 06:45:26
Making a local package?
I’ve had success packaging some standard Drupal mods, like Views, so I thought I might try to package a locally-edited theme as well. To test this, I simply copied the ‘pushbutton’ theme into a local directory ‘testing’ and tried to package it as follows:
cp -a /usr/share/drupal6/themes/pushbutton ./testing
mv testing/pushbutton.info testing/testing.info
tar czf testing.tar.gz testing
dh-make-drupal -T Themes -t testing.tar.gz -V '1.0' testing
This makes a directory drupal6-thm-testing-1.0 with the unpacked tarball and a debian/ subdir, and then bails out with “ERROR: can’t convert nil into String”. I’ve tried –debug 5, which only gives:
descr: Generated from a local file - Sorry, cannot even fetch a proper description!
D: Starting Debian package creation
D: Original tarball verified - 53 files included
I: Debian package name: drupal6-thm-testing
D: Author copyright information not found
Am I doing it wrong, or am I touching upon uncharted territory?
Roel de Cock 2010-08-10 23:46:41
That nailed it…
Thanks for the prompt advice, that worked.
BTW I haven’t tried it, but I suppose that dpkg –purge won’t have the desired effect with modules that add their own stuff to the Drupal database- you’ll still have to use Drupal’s own uninstall first to remove any module-specific remainders, right?