From 988345550c8856b8626cc6ea64545b2b2daecfa7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 16 Sep 2019 13:00:38 +0300 Subject: [PATCH] bzip2: clean up build --- core/bzip2/build | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/core/bzip2/build b/core/bzip2/build index 75fa4c5f..1b6020fd 100755 --- a/core/bzip2/build +++ b/core/bzip2/build @@ -1,23 +1,20 @@ -#!/bin/sh +#!/bin/sh -e -make CFLAGS="$CFLAGS -fPIC $LDFLAGS" LDFLAGS="$LDFLAGS" -f Makefile-libbz2_so -make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" bzip2recover libbz2.a +make CC="gcc $CFLAGS -fPIC $LDFLAGS" -f Makefile-libbz2_so +make CC="gcc $CFLAGS -fPIC $LDFLAGS" bzip2recover libbz2.a -install -Dm755 bzip2-shared "$1/usr/bin/bzip2" -ln -sf bzip2 "$1/usr/bin/bunzip2" -ln -sf bzip2 "$1/usr/bin/bzcat" -install -m755 bzdiff bzgrep bzmore bzip2recover "$1/usr/bin" +for bin in bzip2-shared bzdiff bzgrep bzip2recover bzmore; do + install -Dm755 "$bin" "$1/usr/bin/${bin%%-shared}" +done install -Dm755 libbz2.so.1.0.8 "$1/usr/lib/libbz2.so.1.0.8" -# Backwards compatibility with older programs -ln -s libbz2.so.1.0.8 "$1/usr/lib/libbz2.so" -ln -s libbz2.so.1.0.8 "$1/usr/lib/libbz2.so.1" -ln -s libbz2.so.1.0.8 "$1/usr/lib/libbz2.so.1.0" +install -Dm644 libbz2.a "$1/usr/lib/libbz2.a" +install -Dm644 bzip2.1 "$1/usr/share/man/man1/bzip2.1" +install -Dm644 bzlib.h "$1/usr/include/bzlib.h" -install -m644 libbz2.a "$1/usr/lib" -install -Dm644 bzlib.h "$1/usr/include/bzlib.h" +for lib in libbz2.so libbz2.so.1 libbz2.so.1.0; do + ln -sf libbz2.so.1.0.8 "$1/usr/lib/$lib" +done -install -Dm644 bzip2.1 "$1/usr/share/man/man1/bzip2.1" -ln -sf bzip2.1 "$1/usr/share/man/man1/bunzip2.1" -ln -sf bzip2.1 "$1/usr/share/man/man1/bzcat.1" -ln -sf bzip2.1 "$1/usr/share/man/man1/bzip2recover.1" +ln -sf bzip2 "$1/usr/bin/bunzip2" +ln -sf bzip2 "$1/usr/bin/bzcat"