You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
779 B

termux_step_install_license() {
mkdir -p "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME"
local COUNTER=0
for LICENSE in $(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g'); do
if [ -f "$TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt" ]; then
if [[ $COUNTER > 0 ]]; then
ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE.${COUNTER}"
else
ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE"
fi
else
for POSSIBLE_LICENSE in "LICENSE*" "license*" "COPYRIGHT" "copyright"; do
if [ -f "$TERMUX_PKG_SRCDIR/$POSSIBLE_LICENSE" ]; then
cp "$TERMUX_PKG_SRCDIR/$POSSIBLE_LICENSE" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/"
break
fi
done
fi
COUNTER=$((COUNTER + 1))
done
}