python(2): fix bin/ and share/man/

Justification for the changes:

$ dpkg -S smtpd.py
python: /data/data/com.termux/files/usr/lib/python3.6/smtpd.py
python2: /data/data/com.termux/files/usr/lib/python2.7/smtpd.py
python2: /data/data/com.termux/files/usr/bin/smtpd.py

$ ls -l $PREFIX/bin/python-config
lrwxrwxrwx    1 u0_a312  u0_a312         14 May 18 01:09 /data/data/com.termux/files/usr/bin/python-config -> python2-config

$ ls -l $PREFIX/share/man/man1/python2.1
lrwxrwxrwx    1 u0_a312  u0_a312          9 May 18 01:09 /data/data/com.termux/files/usr/share/man/man1/python2.1 -> python2.1

$ dpkg -S bin/2to3
python: /data/data/com.termux/files/usr/bin/2to3
python: /data/data/com.termux/files/usr/bin/2to3-3.6

$ dpkg -S bin/pydoc
python2: /data/data/com.termux/files/usr/bin/pydoc
python: /data/data/com.termux/files/usr/bin/pydoc3.6
python: /data/data/com.termux/files/usr/bin/pydoc3
This commit is contained in:
Tom Yan
2018-05-18 04:40:42 +08:00
committed by Fredrik Fornwall
parent 2299660e77
commit 5ccf28cf8c
2 changed files with 13 additions and 6 deletions

View File

@@ -28,9 +28,12 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_buggy_getaddrinfo=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_little_endian_double=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --build=$TERMUX_BUILD_TUPLE --with-system-ffi --without-ensurepip"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-unicode=ucs4"
# Let 2to3 be in the python3 package:
TERMUX_PKG_RM_AFTER_INSTALL="bin/2to3"
TERMUX_PKG_RM_AFTER_INSTALL="
bin/smtpd.py
bin/python
bin/python-config
share/man/man1/python.1
"
termux_step_host_build () {
# We need a host-built Parser/pgen binary, copied into cross-compile build in termux_step_post_configure() below
@@ -63,8 +66,10 @@ termux_step_pre_configure() {
termux_step_post_make_install () {
# Avoid file clashes with the python (3) package:
mv $TERMUX_PREFIX/share/man/man1/{python.1,python2.1}
rm $TERMUX_PREFIX/bin/python
(cd $TERMUX_PREFIX/bin
mv 2to3 2to3-${_MAJOR_VERSION}
mv pydoc pydoc${_MAJOR_VERSION}
ln -sf pydoc${_MAJOR_VERSION} pydoc2)
# Restore path which termux_step_host_build messed with
export PATH=$TERMUX_ORIG_PATH
}