DEBIAN-MATLAB-MEXHELPER(1) | User Commands | DEBIAN-MATLAB-MEXHELPER(1) |
debian-matlab-mexhelper - helper to build Matlab extensions on Debian
debian-matlab-mexhelper [OPTIONS] <package name> <mode>
The is a small helper that eases building and installing MEX extensions for Matlab toolbox packages in Debian binary packages. Because these packages cannot build-depend on Matlab (for obvious reasons) they need to compile their extensions at installation time using a local Matlab installation. The helper is somewhat flexible by supporting custom build, install and clean commands, as well as source and destination directories. It also deals with moving extensions into library directories and automatically symlinks them into the toolbox directory.
There are two major modes: 'install' to build, install and symlink extensions (useful in postinst) and 'clean' to remove installed extensions and symlinks (useful in prerm).
The command to build the extensions is invoked in the source directory. By default, this is /usr/src/matlab/<package name>, but can be overridden with the --src-dir option. Any optional 'install' (--install-cmd) and 'clean' (--clean-cmd) are invoked in the source directory too.
Moreover, this helper will also take any installed extensions from a default installation path /usr/share/matlab/site/m/<package name>, move them into /usr/lib/matlab/site/<package name> and symlink back to the original location. These locations can be configured with the --m-dir and --mex-dir options respectively. Again, this step is optional and is only performed if a package actually installs extensions inot this location.
-h
--help
--version
--build-cmd
--install-cmd
--clean-cmd
--src-dir
--mex-dir
--m-dir
--make
The following call can be used in a package's postinst script if it comes with a Matlab script 'build_matlab.m' that builds and installs its extension into the desired locations. The --src-dir option is used to point to a non-standard location of the extension sources.
If a package installs extension sources into the standard location and builds its extensions using a Makefile that support the DESTDIR for installing the built extensions and a 'distclean' target it is sufficient to run the following.
Otherwise it is also possible to fully customize all commands.
If a package uses debian-matlab-mexhelper to install extensions into the standard location it can also be used to remove all MEX extensions and created symlinks when a package is removed from a system. To achieve this simply put the following call into a package's prerm script.
Written by Michael Hanke.
Copyright © 2010-2011 Michael Hanke <michael.hanke@gmail.com>
Licensed under GNU General Public License version 3 or later.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
November 2021 | debian-matlab-mexhelper 0.0.21.1 |