system/mhddfs: Fix 15.0 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-02-10 14:31:46 -05:00 committed by Willy Sudiarto Raharjo
parent 9ffffd6255
commit 5e0f80952d
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
1 changed files with 19 additions and 19 deletions

View File

@ -22,6 +22,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20220210 bkw: Modified by SlackBuilds.org.
# - don't write to $CWD.
# - fix build on 15.0.
# - actually use SLKCFLAGS.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=mhddfs
@ -32,19 +37,12 @@ PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ -f ${PRGNAM}_${VERSION}.tar.gz ]; then
mv ${PRGNAM}_${VERSION}.tar.gz ${PRGNAM}-${VERSION}.tar.gz
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
@ -54,8 +52,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@ -74,26 +72,28 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
tar xvf $CWD/${PRGNAM}_${VERSION}.tar.gz
cd $PRGNAM-$VERSION
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 \
-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 {} \;
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
# 20220210 bkw: use correct include path for xattr.h
sed -i 's,<attr,<sys/,' src/*.c
# 20220210 bkw: actually use SLKCFLAGS (and build stripped)
sed -i "s|-Wall|& $SLKCFLAGS -Wl,-s|" Makefile
make
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
mkdir -p $PKG/usr/man/man1
gzip -9 mhddfs.1
mv mhddfs.1.gz $PKG/usr/man/man1
gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING ChangeLog LICENSE README* mhddfs.spec $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING ChangeLog LICENSE README* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install