Today, MJRay asks how to make MakeMaker (no redundancy!) do what he wants.

Incidentally, I faced this issue just yesterday, preparing an application for internal use in my job. As sysadmin, I want all the homebrew software to be Debian-packaged, even if they're not the most policy abiding packages.

I was installing some modules for mod_perl2, some utility modules and a couple of scripts. Of course, it also needed accesory files, like images for the web or templates for HTML, and configuration too.

After reading the reply to this post, written by Randal Shwartz himself, I got convinced that there wasn't any frigging way to make the thing do it.

So my solution was far from ideal, as I wanted to put everything in the Makefile, but it wasn't so ugly, considering that it was only meant for use in a Debian package:

  • mod_perl and regular modules, using the standard method: put them under lib/ and MakeMaker takes care of them. As I didn't wanted site-wide modules, I changed INSTALLVENDORLIB in the debian/rules to point to /usr/share/pkgname/lib
  • for scripts, perl or not: you list them in EXE_FILES, and then point INSTALLVENDORSCRIPT to where you want them. In my case it was /usr/share/pkgname/bin, but if you need to install CGIs, it would be valid to point to /usr/lib/cgi-bin.
  • For support files, at first I put them under PMLIBDIRS control (as the rest of the modules), but I didn't like the resulting directory layout. So I processed them, along with configuration files, and stuff with debhelper tools.

In a nutshell, if you only want to process modules and CGIs, you can do it with MakeMaker