diff --git a/scripts/build/termux_create_debian_subpackages.sh b/scripts/build/termux_create_debian_subpackages.sh index 84ae2d8c2b..1632aaacca 100644 --- a/scripts/build/termux_create_debian_subpackages.sh +++ b/scripts/build/termux_create_debian_subpackages.sh @@ -19,8 +19,11 @@ termux_create_debian_subpackages() { local TERMUX_SUBPKG_ESSENTIAL=false local TERMUX_SUBPKG_BREAKS="" local TERMUX_SUBPKG_DEPENDS="" + local TERMUX_SUBPKG_RECOMMENDS="" + local TERMUX_SUBPKG_SUGGESTS="" local TERMUX_SUBPKG_CONFLICTS="" local TERMUX_SUBPKG_REPLACES="" + local TERMUX_SUBPKG_PROVIDES="" local TERMUX_SUBPKG_CONFFILES="" local TERMUX_SUBPKG_DEPEND_ON_PARENT="" local SUB_PKG_MASSAGE_DIR=$SUB_PKG_DIR/massage/$TERMUX_PREFIX @@ -87,7 +90,10 @@ termux_create_debian_subpackages() { test ! -z "$TERMUX_SUBPKG_DEPENDS" && echo "Depends: ${TERMUX_SUBPKG_DEPENDS/#, /}" >> control test ! -z "$TERMUX_SUBPKG_BREAKS" && echo "Breaks: $TERMUX_SUBPKG_BREAKS" >> control test ! -z "$TERMUX_SUBPKG_CONFLICTS" && echo "Conflicts: $TERMUX_SUBPKG_CONFLICTS" >> control + test ! -z "$TERMUX_SUBPKG_RECOMMENDS" && echo "Recommends: $TERMUX_SUBPKG_RECOMMENDS" >> control test ! -z "$TERMUX_SUBPKG_REPLACES" && echo "Replaces: $TERMUX_SUBPKG_REPLACES" >> control + test ! -z "$TERMUX_SUBPKG_PROVIDES" && echo "Provides: $TERMUX_SUBPKG_PROVIDES" >> control + test ! -z "$TERMUX_SUBPKG_SUGGESTS" && echo "Suggests: $TERMUX_SUBPKG_SUGGESTS" >> control echo "Description: $TERMUX_SUBPKG_DESCRIPTION" >> control for f in $TERMUX_SUBPKG_CONFFILES; do echo "$TERMUX_PREFIX/$f" >> conffiles; done diff --git a/scripts/build/termux_create_pacman_subpackages.sh b/scripts/build/termux_create_pacman_subpackages.sh index ba198ea016..271cd9e7d3 100644 --- a/scripts/build/termux_create_pacman_subpackages.sh +++ b/scripts/build/termux_create_pacman_subpackages.sh @@ -19,8 +19,11 @@ termux_create_pacman_subpackages() { local TERMUX_SUBPKG_ESSENTIAL=false local TERMUX_SUBPKG_BREAKS="" local TERMUX_SUBPKG_DEPENDS="" + local TERMUX_SUBPKG_RECOMMENDS="" + local TERMUX_SUBPKG_SUGGESTS="" local TERMUX_SUBPKG_CONFLICTS="" local TERMUX_SUBPKG_REPLACES="" + local TERMUX_SUBPKG_PROVIDES="" local TERMUX_SUBPKG_CONFFILES="" local TERMUX_SUBPKG_DEPEND_ON_PARENT="" local TERMUX_SUBPKG_GROUPS="" @@ -95,10 +98,22 @@ termux_create_pacman_subpackages() { tr ',' '\n' <<< "$TERMUX_SUBPKG_BREAKS" | sed 's|(||g; s|)||g; s| ||g; s|>>|>|g; s|<<|<|g' | awk '{ printf "conflict = " $1; if ( ($1 ~ // || $1 ~ /=/) && $1 !~ /-/ ) printf "-0"; printf "\n" }' fi + if [ -n "$TERMUX_SUBPKG_PROVIDES" ]; then + tr ',' '\n' <<< "$TERMUX_SUBPKG_REPLACES" | sed 's|(||g; s|)||g; s| ||g; s|>>|>|g; s|<<|<|g' | awk '{ printf "provides = " $1; if ( ($1 ~ // || $1 ~ /=/) && $1 !~ /-/ ) printf "-0"; printf "\n" }' + fi + if [ -n "$TERMUX_SUBPKG_DEPENDS" ]; then tr ',' '\n' <<< "${TERMUX_SUBPKG_DEPENDS/#, /}" | sed 's|(||g; s|)||g; s| ||g; s|>>|>|g; s|<<|<|g' | awk '{ printf "depend = " $1; if ( ($1 ~ // || $1 ~ /=/) && $1 !~ /-/ ) printf "-0"; printf "\n" }' | sed 's/|.*//' fi + if [ -n "$TERMUX_SUBPKG_RECOMMENDS" ]; then + tr ',' '\n' <<< "$TERMUX_SUBPKG_RECOMMENDS" | awk '{ printf "optdepend = %s\n", $1 }' + fi + + if [ -n "$TERMUX_SUBPKG_SUGGESTS" ]; then + tr ',' '\n' <<< "$TERMUX_SUBPKG_SUGGESTS" | awk '{ printf "optdepend = %s\n", $1 }' + fi + if [ -n "$TERMUX_SUBPKG_CONFFILES" ]; then tr ',' '\n' <<< "$TERMUX_SUBPKG_CONFFILES" | awk '{ printf "backup = '"${TERMUX_PREFIX:1}"'/%s\n", $1 }' fi