build-package.sh: fix metapackage creation

Metapackages shouldn't have data inside.

%ci:reset-backlog
This commit is contained in:
Leonid Pliushch 2019-08-13 01:59:25 +03:00
parent 52ceb56d3f
commit ceb385a9a8
2 changed files with 10 additions and 9 deletions

View File

@ -3,8 +3,8 @@ TERMUX_PKG_DESCRIPTION="A metapackage that installs essential development tools"
TERMUX_PKG_LICENSE="Public Domain"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=3.1
TERMUX_PKG_REVISION=3
TERMUX_PKG_METAPACKAGE=yes
TERMUX_PKG_REVISION=4
TERMUX_PKG_METAPACKAGE=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
#
@ -21,8 +21,3 @@ TERMUX_PKG_DEPENDS="autoconf, automake, bison, clang, cmake, flex, gperf, libtoo
# Other packages that may be interesting.
TERMUX_PKG_SUGGESTS="git, golang, nodejs, patchelf, proot, python, python2, ruby, rust, subversion"
termux_step_post_massage() {
cd "$TERMUX_PKG_MASSAGEDIR"
rm -rf data
}

View File

@ -8,8 +8,14 @@ termux_step_create_datatar() {
termux_error_exit "Package contains hard links: $HARDLINKS"
fi
if [ "${TERMUX_PKG_METAPACKAGE-false}" = "false" ] && [ "$(find . -type f)" = "" ]; then
termux_error_exit "No files in package"
if [ "${TERMUX_PKG_METAPACKAGE-false}" = "true" ]; then
# Metapackage doesn't have data inside.
rm -rf data
else
if [ "$(find . -type f)" = "" ]; then
termux_error_exit "No files in package"
fi
fi
tar -cJf "$TERMUX_PKG_PACKAGEDIR/data.tar.xz" .
}