Browse Source

termux_step_install_license: install to usr/share/doc/ instead of usr/share/

android-5
Henrik Grimler 6 years ago
committed by Leonid Plyushch
parent
commit
cbdeb4a8c0
  1. 10
      scripts/build/termux_step_install_license.sh

10
scripts/build/termux_step_install_license.sh

@ -1,23 +1,23 @@
termux_step_install_license() { termux_step_install_license() {
mkdir -p "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME" mkdir -p "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME"
if [ ! "${TERMUX_PKG_LICENSE_FILE}" = "" ]; then if [ ! "${TERMUX_PKG_LICENSE_FILE}" = "" ]; then
for LICENSE in $TERMUX_PKG_LICENSE_FILE; do for LICENSE in $TERMUX_PKG_LICENSE_FILE; do
if [ ! -f "$TERMUX_PKG_SRCDIR/$LICENSE" ]; then termux_error_exit "$TERMUX_PKG_SRCDIR/$LICENSE does not exist"; fi if [ ! -f "$TERMUX_PKG_SRCDIR/$LICENSE" ]; then termux_error_exit "$TERMUX_PKG_SRCDIR/$LICENSE does not exist"; fi
cp -f ${TERMUX_PKG_SRCDIR}/${LICENSE} ${TERMUX_PREFIX}/share/${TERMUX_PKG_NAME} cp -f ${TERMUX_PKG_SRCDIR}/${LICENSE} ${TERMUX_PREFIX}/share/doc/${TERMUX_PKG_NAME}
done done
else else
local COUNTER=0 local COUNTER=0
for LICENSE in "$(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g')"; do for LICENSE in "$(echo $TERMUX_PKG_LICENSE | sed 's/,/ /g')"; do
if [ -f "$TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt" ]; then if [ -f "$TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt" ]; then
if [[ $COUNTER > 0 ]]; then if [[ $COUNTER > 0 ]]; then
ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE.${COUNTER}" ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE.${COUNTER}"
else else
ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE" ln -sf "../LICENSES/${LICENSE}.txt" "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE"
fi fi
fi fi
COUNTER=$((COUNTER + 1)) COUNTER=$((COUNTER + 1))
done done
if [ ! -f $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE* ] && [ ! -L $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/LICENSE* ]; then if [ ! -f $TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE* ] && [ ! -L $TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE* ]; then
termux_error_exit "No LICENSE file was installed for $TERMUX_PKG_NAME" termux_error_exit "No LICENSE file was installed for $TERMUX_PKG_NAME"
fi fi
fi fi

Loading…
Cancel
Save