Switching to a more "soft" solution which will be focused on apt only.
Apt will now send an application package name (com.termux) and prefix
(/data/data/com.termux/files/usr) as part of user-agent string. That
will allow to distinguish real Termux users from parties which download
our packages and binary-patching them for the custom prefix.
Note that this will disable user's possibility to set custom User-Agent
for apt.
In issue https://github.com/termux/termux-packages/issues/6160 I have found
that community repo "its-pointless.github.io" specifies us as maintainer
for its packages. This is NOT TRUE and potentially misleads people using
these packages.
Now TERMUX_PKG_MAINTAINER will contain a default value which is neutral
and not specify maintainer. So all packages now have to override it to
the correct value.
[skip ci]
%ci:no-build
Add a small stub which verifies whether /data/data/com.termux/files/usr is readable
into few important packages such like Bash or APT. If this check fails, e.g.
in case if binary was executed in program with different package name (non-Termux),
program will print warning and exit with error status immediately.
This should prevent use of prebuilt packages by third-party applications.
NOTE: for now it uses /data/data/com.termux/files/usr in reversed order to
prevent automatic "blind" patching with sed. Will replace with randomized
XOR-based variant in case if that measure won't be enough.
* build-package.sh: allow for arrays in TERMUX_PKG_{SRCURL,SHA256}
Packages that require several source archives can then set these parameters to
arrays instead of downloading them "manually" in termux_step_post_extract.
Downloaded files are extracted into subfolders in TERMUX_PKG_SRCDIR.
Tested for backward compatibility in a couple of packages and the combinations
tar + tar, zip + tar, tar + zip, zip + zip.
* perl: download perl-cross through TERMUX_PKG_SRCURL
* perl: remove $PREFIX/{lib/libperl.so,include/perl} before build
Otherwise building perl twice doesn't give the same results, symlinks are
messed up.
Also remove old remnant from when there was a Kid.pm.patch.
* bash: fix tiny typo
* ecj: remove hardcoded SHA256 and pkg version
* elfutils: download argp-standalone through TERMUX_PKG_SRCURL
* ldc: download all src archives through TERMUX_PKG_SRCURL
* libgc: download libatomic_ops through TERMUX_PKG_SRCURL
* libllvm: download all src archives through TERMUX_PKG_SRCURL
* linux-man-pages: download src archives through TERMUX_PKG_SRCURL
* ncurses: download all src archives through TERMUX_PKG_SRCURL
* pngquant: download lib sources through TERMUX_PKG_SRCURL
Use .zip for lib since the downloaded archives are otherwise both named
$TERMUX_PKG_VERSION.tar.gz and replace each other. This causes caching to
not work.