libraries/avbin: Handle weird download filenames.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2022-02-16 16:39:03 -05:00 committed by Willy Sudiarto Raharjo
parent ec5329570f
commit 64cfcf14f0
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
1 changed files with 10 additions and 12 deletions

View File

@ -38,9 +38,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -73,23 +70,24 @@ fi
SRCNAM=install-$PRGNAM-linux-x86-$AR-v$VERSION
# 20220216 bkw: depending on what was used to download the file, it
# may have a bunch of amazon-gibberish in the filename
CWDSRC="$CWD/$SRCNAM"
if [ ! -e "$CWDSRC" ]; then
CWDSRC="$( /bin/ls $CWDSRC\?* | head -1)"
fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
chmod 0755 $CWD/$SRCNAM
sh $CWD/$SRCNAM --noexec --target .
sh "$CWDSRC" --noexec --target .
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
chmod 644 *
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
strip --strip-unneeded *.so.*
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
install -D -m0755 lib${PRGNAM}.so.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX}