TL;DR: spaces and other metacharacters are not supported for directories that will land in /usr/local
.
/usr/local/MegaRAID Storage Manager
contains spaces. Obviously this package doesn't follow good practices in the *nix world (blame LSI/Broadcom).
You could instead alien-convert to a tar or extract directly using rpm2cpio
, figure out how install scripts are used and fit to see how to reuse them, optionally see if it's possible to rename the directory with spaces if any reference to it can be easily replaced too, and build directly a binary package using dpkg-deb -b
which won't be affected by such problem, but will have created a package which doesn't comply with Debian policy.
explanations below...
The Debian policy mandates that nothing should be installed by a package in /usr/local
except some directories by an indirect method:
9.1.2. Site-specific programs
As mandated by the FHS, packages must not place any files in
/usr/local
, either by putting them in the file system archive to be
unpacked by dpkg
or by manipulating them in their maintainer scripts.
However, the package may create empty directories below /usr/local
so
that the system administrator knows where to place site-specific
files. These are not directories in /usr/local
, but are children of
directories in /usr/local
. These directories (/usr/local/*/dir/
)
should be removed on package removal if they are empty.
Note that this applies only to directories below /usr/local
, not
in /usr/local
.
[...]
So this package can't be compliant anyway, for example the file /usr/local/MegaRAID Storage Manager/startmonitorhelp.sh
is not compliant: it's a file packaged somewhere in /usr/local
.
alien
uses the dh_usrlocal
build helper to automatically convert (still compliant) directories for addition in maintainer scripts (ie on Debian preinst
, postinst
etc. scripts that are archived separately in the .deb ar archive and will be stored in /var/lib/dpkg/info/
later) which will then perform a few mkdir
commands on installation:
dh_usrlocal
is a debhelper program that can be used for building
packages that will provide a subdirectory in /usr/local when
installed.
It finds subdirectories of usr/local in the package build directory,
and removes them, replacing them with maintainer script snippets
(unless -n
is used) to create the directories at install time, and
remove them when the package is removed, in a manner compliant with
Debian policy. These snippets are inserted into the maintainer scripts
by dh_installdeb
.
The content of the /usr/bin/dh_usrlocal
perl script includes:
# Detect some obvious cases of "this will not end
# well". We rely on what "while read dir ... ; do"
# can handle for correctness.
if ($fn =~ m{[\s!'"\$()*#;<>?@\[\]\\`|]}) {
error("Cannot generate a correct shell script for $fn due to shell metacharacters");
}
\s
which means any space in PCRE is part of the forbidden metacharacters and triggers the error when parsing /usr/local/MegaRAID Storage Manager
.