xbps-src/hooks: most 05-rename-python3-c-bindings to post-install

This commit is contained in:
maxice8 2019-02-02 14:40:05 -02:00
parent cc97dab1c4
commit ab96ff356e
No known key found for this signature in database
GPG key ID: 543B9D4F4299F06B

View file

@ -1,16 +0,0 @@
# This hook executes the following tasks:
# - renames cpython binding files to not include the arch-specific extension suffix
hook() {
if [ ! -d ${PKGDESTDIR}/${py3_sitelib} ]; then
return 0
fi
find "${PKGDESTDIR}/${py3_sitelib}" -type f -executable -iname '*.cpython*.so' \
| while read -r file; do
filename="${file##*/}"
modulename="${filename%%.*}"
msg_warn "${pkgver}: renamed '${filename}' to '${modulename}.so'.\n"
mv ${file} ${file%/*}/${modulename}.so
done
}