build: fix RPM builds

The rpmbuild tool requires certain directories to exist and will fail
rather than attempting to create them.  The 'clean' phase of maven will
remove these directories.

This patch adds support to ensure the directories exist.

NB. This patch changes the location of rpmbuild-related directories
from path/to/target/ (e.g. packages/fhs/target/RPMS) to
path/to/target/rpmbuild (e.g. packages/fhs/target/rpmbuild/RPMS).
There is an obvious knock-on effect to the location of resulting RPM
files.

Target: master
Request: 2.7 (as needed)
Request: 2.6 (as needed)
Request: 2.2 (as needed)
Patch: http://rb.dcache.org/r/6427/
Acked-by: Gerd Behrmann
cns: make unit tests less sensitive to speed of computer

A recent build failed because the CNS unit-tests rely on a test taking
no longer than 100 ms to complete.  Under normal circumstances, this
is reasonable; however, the build machine was suffering high IO load
and didn't managed to complete the unit test in the allotted time
window.

While the build machine shouldn't be suffering from this IO-load,
equally, our unit-tests shouldn't fail on slow machines.

This patch doesn't fix the dependency on system time; rather, it
increases the time window to 1 minute.

Target: master
Requires-notes: no
Requires-book: no
Patch: http://rb.dcache.org/r/6432/
Acked-by: Gerd Behrmann
dcache-chimera: Add interactive chimera shell

Adds an interactive shell for chimera. May also be used in non-interactive mode
with a command provided on the command line. In the latter form it supplants
the older chimera-cli utility.

Note that in some cases the argument order has changed compared to the
chimera-cli utility. The argument order now matches the order found in common
Posix utilities.

The chimera-cli utility should be documented as deprecated and eventually
removed from dCache.

The system-test populate script has been updated to use the new utility, which
avoids means the chimera skeleton can be created with a single invocation,
cutting down on the build time.

Target: trunk
Require-book: yes
Require-notes yes
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6423/
spacemanager: Retry on transient errors

Besides allowing the space manager to recover from various transient errors,
this change also enables us to use serializable transaction isolation.

Target: trunk
Require-notes: no
Require-book: no
Fix text width calculation for ANSI formatted help output

ANSI escape sequences have to be ignored to get the correct
width.

Target: trunk
Require-notes: no
Require-book: no
spacemanager: Rewrite command line interface

The patch more or less rewrites all space manager related admin commands.

The following commands are removed:

ls
ls file space tokens
listInvalidSpaces
listFilesInSpace
removeFilesFromSpace
remove file
reserve
release
update space reservation

The following commands are added:

ls spaces
ls files
reserve space
update space
release space
release file

The new commands should offer greater flexibility and more concise output.
Documentation has been added for all commands. Options for almost all
commands have changed.

Note that although commands have been rewritten to make use of the
annotation syntax, the point of this patch is the changed user experience,
not the change of implementation.

Internal database keys like the link group id and the file reservation id
are no longer exposed through the user interface. Group (which confusingly
could be both group and user name) and role fields are presented as a
unified owner, which may be a user name or an FQAN. Various list commands
try to hide irrellevant information, dynamically adding columns to the output
suitable for the requested information.

The code was refactored such that the CLI appears in its own class. The link
group import code has been moved to its own classs too. Commands with blocking
code (ie database operations) are now executed on a thread pool to prevent
blocking the message thread.

The RESERVED state of files has been renamed to ALLOCATED to better reflect
how it is used and to be consistent with the terminology of the aggregation
field in space reservations.

The database interface has been extended with a criterion API to allow
flexible querying.

Target: trunk
Require-notes: yes
Require-book: yes
spacemanager: Delete flushed file reservations when name space entry is deteled

Space manager marks file reservations as deleted when the name space entry
is deleted. The actual file reservation is not removed until space manager
is notified that the file is removed from the pool. For files flushed to
tape there may not be a disk copy and thus such a notification is never sent.
The consequence is that reservations for flushed files are never removed.

This patch fixes the problem by deleting the file reservation of flushed files
as soon as the name space entry is deleted. A liquibase changeset is added to
delete old reservations for deleted flushed files.

Target: trunk
Require-notes: yes
Require-book: no
Revert "srm: fix Copy scheduling"

This reverts commit c547ddd5660884703044775d180ae22da01ba69a.
Revert "srm: refactor SchedulerFactory"

This reverts commit 1193536caf59037b34ca07b37a60203d458acd90.