fix Termux hardcoded directories in mlocate, phpmyadmin, sc-im

This commit is contained in:
Leonid Pliushch 2020-10-30 22:38:10 +02:00
parent 9b92a45bc6
commit c41e10605a
5 changed files with 11 additions and 10 deletions

View File

@ -6,7 +6,7 @@ diff -u -r ../mlocate-0.26/src/conf.c ./src/conf.c
if (conf_scan_root == NULL)
{
- static char root[] = "/";
+ static char root[] = "/data/data/com.termux/files/";
+ static char root[] = "@TERMUX_BASE_DIR@/";
conf_scan_root = root;
}

View File

@ -16,5 +16,6 @@ termux_step_make_install() {
cp $TERMUX_PKG_SRCDIR/config.sample.inc.php $TERMUX_PREFIX/etc/phpmyadmin/config.inc.php
ln -s $TERMUX_PREFIX/etc/phpmyadmin/config.inc.php $TERMUX_PREFIX/usr/share/phpmyadmin
mkdir -p $TERMUX_PREFIX/etc/apache2/conf.d
cp $TERMUX_PKG_BUILDER_DIR/phpmyadmin.conf $TERMUX_PREFIX/etc/apache2/conf.d/
sed -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PKG_BUILDER_DIR/phpmyadmin.conf \
> $TERMUX_PREFIX/etc/apache2/conf.d/phpmyadmin.conf
}

View File

@ -1,6 +1,6 @@
Alias /phpmyadmin /data/data/com.termux/files/usr/share/phpmyadmin
Alias /phpmyadmin @TERMUX_PREFIX@/share/phpmyadmin
<Directory /data/data/com.termux/files/usr/share/phpmyadmin>
<Directory @TERMUX_PREFIX@/share/phpmyadmin>
Options Indexes FollowSymLinks
DirectoryIndex index.php
@ -16,7 +16,7 @@ Alias /phpmyadmin /data/data/com.termux/files/usr/share/phpmyadmin
</Directory>
# Authorize for setup
<Directory /data/data/com.termux/files/usr/share/phpmyadmin/setup>
<Directory @TERMUX_PREFIX@/share/phpmyadmin/setup>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
@ -26,11 +26,11 @@ Alias /phpmyadmin /data/data/com.termux/files/usr/share/phpmyadmin
</Directory>
# Disallow web access to directories that don't need it
<Directory /data/data/com.termux/files/usr/share/phpmyadmin/libraries>
<Directory @TERMUX_PREFIX@/share/phpmyadmin/libraries>
Order Deny,Allow
Deny from All
</Directory>
<Directory /data/data/com.termux/files/usr/share/phpmyadmin/setup/lib>
<Directory @TERMUX_PREFIX@/share/phpmyadmin/setup/lib>
Order Deny,Allow
Deny from All
</Directory>

View File

@ -11,6 +11,6 @@ TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_configure() {
CFLAGS+=" $CPPFLAGS -I$TERMUX_PREFIX/include/libandroid-support -I$TERMUX_PKG_BUILDER_DIR -DGNUPLOT"
cp $TERMUX_PKG_BUILDER_DIR/wordexp.c .
sed -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PKG_BUILDER_DIR/wordexp.c > ./wordexp.c
cp -rf src/* .
}

View File

@ -115,13 +115,13 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
if (!pid) {
if (p[1] == 1) fcntl(1, F_SETFD, 0);
else dup2(p[1], 1);
execl("/data/data/com.termux/files/usr/bin/sh", "sh", "-c",
execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c",
"eval \"printf %s\\\\\\\\0 x $1 $2\"",
"sh", s, redir, (char *)0);
_exit(1);
}
close(p[1]);
f = fdopen(p[0], "r");
if (!f) {
close(p[0]);