scripts: Add some `TERMUX_SUBPKG_*` variables

- `TERMUX_SUBPKG_RECOMMENDS`
- `TERMUX_SUBPKG_SUGGESTS`
- `TERMUX_SUBPKG_PROVIDES`
This commit is contained in:
Tee KOBAYASHI 2023-02-17 17:56:43 +09:00 committed by xtkoba
parent 95b0d1e2bd
commit c66453e44d
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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 ~ /=/) && $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 ~ /=/) && $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 ~ /=/) && $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