audio/google-musicmanager: Fix 32-bit build.

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-03-22 16:36:18 -04:00 committed by Willy Sudiarto Raharjo
parent e48d132d7e
commit 7c0ed7b6a8
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -27,6 +27,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20220322 bkw: Modified by SlackBuilds.org: fix 32-bit build.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=google-musicmanager
@ -35,9 +37,21 @@ BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
case "$(uname -m)" in
i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ; ARCH=i386 ;;
x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ; ARCH=x86_64 ;;
# 20220322 bkw: changed this stuff to allow building a 32-bit package
# on x86_64 with 'export ARCH=i586', or build a 64-bit package on
# 32-bit with 'export ARCH=x86_64'. Please leave it this way; it makes
# testing ever so much simpler.
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
case "$ARCH" in
i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ;;
x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ;;
*) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
esac
@ -71,7 +85,14 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $PKG
ar p $CWD/$PRGNAM-${RELEASE}_current_${DEBARCH}.deb data.tar.xz | tar xvJ
# 20220322 bkw: 32-bit .deb has lzma compression, not xz. Handle either.
DEB=$CWD/$PRGNAM-${RELEASE}_current_${DEBARCH}.deb
for i in lzma xz; do
ar -t "$DEB" | fgrep -q data.tar.$i && COMP=$i
done
ar p $DEB data.tar.$COMP | $COMP -d | tar xv
# 20220218 bkw: absolute path symlink in deb, no good.
rm -f usr/bin/$PRGNAM