2014-07-08 17:33:15 +04:00
|
|
|
# This setup hook moves $out/{man,doc,info} to $out/share; moves
|
|
|
|
# $out/share/man to $man/share/man; and moves $out/share/doc to
|
|
|
|
# $man/share/doc.
|
2014-07-08 16:26:35 +04:00
|
|
|
|
|
|
|
preFixupHooks+=(_moveDocs)
|
|
|
|
|
2014-07-08 17:33:15 +04:00
|
|
|
_moveToShare() {
|
2014-07-08 16:26:35 +04:00
|
|
|
forceShare=${forceShare:=man doc info}
|
2014-07-08 17:33:15 +04:00
|
|
|
if [ -z "$forceShare" -o -z "$out" ]; then return; fi
|
2014-07-08 16:26:35 +04:00
|
|
|
|
|
|
|
for d in $forceShare; do
|
2014-07-08 17:33:15 +04:00
|
|
|
if [ -d "$out/$d" ]; then
|
|
|
|
if [ -d "$out/share/$d" ]; then
|
2014-07-08 16:26:35 +04:00
|
|
|
echo "both $d/ and share/$d/ exist!"
|
|
|
|
else
|
2014-07-08 17:33:15 +04:00
|
|
|
echo "moving $out/$d to $out/share/$d"
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv $out/$d $out/share/
|
2014-07-08 16:26:35 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
2014-07-08 17:33:15 +04:00
|
|
|
|
|
|
|
_moveToOutput() {
|
|
|
|
local d="$1"
|
|
|
|
local dst="$2"
|
|
|
|
if [ -z "$dst" -a ! -e $dst/$d ]; then return; fi
|
|
|
|
local output
|
|
|
|
for output in $outputs; do
|
|
|
|
if [ "${!output}" = "$dst" ]; then continue; fi
|
|
|
|
if [ -d "${!output}/$d" ]; then
|
|
|
|
echo "moving ${!output}/$d to $dst/$d"
|
|
|
|
mkdir -p $dst/share
|
|
|
|
mv ${!output}/$d $dst/$d
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_moveDocs() {
|
|
|
|
_moveToShare
|
|
|
|
_moveToOutput share/man "$man"
|
|
|
|
_moveToOutput share/info "$info"
|
|
|
|
_moveToOutput share/doc "$doc"
|
2015-07-26 14:35:49 +03:00
|
|
|
_moveToOutput share/gtk-doc "$doc"
|
2014-07-08 17:33:15 +04:00
|
|
|
|
|
|
|
# Remove empty share directory.
|
|
|
|
if [ -d "$out/share" ]; then
|
|
|
|
rmdir $out/share 2> /dev/null || true
|
|
|
|
fi
|
|
|
|
}
|