These are two tools to make moving file into /opt convenient for
Debian packages.  This is useful on Maemo 5 since /opt is on a
different partition than / and has much more space.

The first tool, maemo-optify, works on a Debian package in unpacked
form.  This is a directory as it is created by debian/rules just
before calling dpkg-deb.  It will move selected files to /opt/maemo/
and replace the originals with symbol links to the new location.  You
can call it from debian/rules right before dh_builddep, for example.

The second tool, maemo-optify-deb, works on a Debian package itself.
It will unpack it, run maemo-optify, and pack it up again.  It can
also work on .changes files and will update them accordingly.  You can
put it into a buildbot, for example.

Maemo-optify has a heuristic for selecting which files to move.  By
default, it will never move files that are less than 2kb and it will
only move directories that have the same name as the package.

** Optification from debian/rules

You can put a call to "maemo-optify" into debian/rules, immediately
after dh_gencontrol or equivalent, like this:

    maemo-optify PACKAGE DIR

where PACKAGE is the name of the binary package that you want to
optify, and DIR is the directory with the files of the package.  If
you omit DIR, it defaults to "debian/PACKAGE".  (The name of the
package is needed for the heuristics that maemo-optify performs.)

If you omit PACKAGE as well, maemo-optify will work on all packages
that are listed in debian/control.

** Optification of .deb files

Optification of an existing .deb archive file is as simple as

    $ maemo-optify-deb package.deb

This will modify package.deb in place.

** Disabling optification

If maemo-optify finds a existing "/opt" directory, it assumes that the
package has already been optified and will not perform any further
optifications by itself.


TODO

- Implement missing things to make maemo-optify really fit for debian/rules:
- Let binary packages control what is being done.  Maybe make
  optification opt-in instead of opt-out (pun intended).
- Handle .changes files in maemo-optify-deb.
- Add option to maemo-optify for the package name so that it doesn't
  need to be guessed from the directory.
- Make maemo-optify-deb robust and give it an option to not overwrite
  the package in place.
- Worry a bit about md5sums.  Do we need to update them?
