views:

34

answers:

2

I need to make a .deb for our software, that includes a copy of Drupal. I've had to patch Drupal, so I can't use the stock Drupal from the distro. I want the outcome to be a file named drupal6-rs_6.16_all.deb, but because in my control file it's a subpackage, it's "inheriting" the version of my main package, so I end up with a package drupal6-rs_6.0.6_all.deb (6.0.6 is the version of our own codebase).

I would prefer to be able to generate the Drupal package from within the same debian/* description, rather than making a separate debian/* subtree for Drupal alone.

Can this be done? I know that with RPM it is possible to override the version of a subpackage, but if I add Version: 6.16 to the subpackage's debian/control header, it (a) highlights differently in vim to the other header entries, and (b) has no effect.

A: 

Since there is only one debian/changelog file per source package, I believe there can be only one version per source package. If you look at the Debian Package Tracking System, it always refers to one version number - that of the source package. The binary package(s) that the source package builds, therefore, have the same version number.

This leaves you with two options -

  1. Do things the right way - patch Drupal (maybe with dpatch, as the Drupal package in Debian already uses it) and leave as a separate source package in itself. Put a version number suffix (e.g. 6.17-1yourcompany1). Then make a package for your own software and have your software depend on the Drupal. Now you can depend on drupal6 (=6.17-1yourcompany1) so you know everyone has actually got the patch. Using a personal repository to distribute your software would be a good idea.

  2. The other alternative you have is to use a hacky method. Since you don't want to use a separate debian/ folder, use one. Whether you make two binaries or one (with everything merged into on big package) from the source package, it is up to you to decide which version number you want to use - Drupal's or your codebase's.

Umang
I'm going to conclude it isn't possible to have a subpackage with a version different from what the source package specifies, the way you can distinguish these two in RPM. I'll probably just bite the bullet and make a separate source package for our patched Drupal. But a nitpick: I'll make it drupal6-ourcompany-6.17 instead of our identifier in the packager's sub-version field. That way we can depend on drupal6-ourcompany >= 6.13
Bernd Jendrissek
Yes, that makes sense. Make sure you don't call it drupal6.16-yourcompany because when drupal creates new a upstream release, then that package will not satisfy your dependency.
Umang
@Bernd: Look at the other answer.
Umang
+1  A: 

I should RTFM sometimes. Look at man dh_installchangelogs. There's a reason it's got an s suffixed to it!

Yes, it seems you can override the version of a binary package in a multiple-binary source package.

Umang
Bingo! That was the trick.
Bernd Jendrissek
Yeah, I'm pretty mad at myself for forgetting to look up the manpage.
Umang