system/dynamips: 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-11 19:40:34 -05:00 committed by Willy Sudiarto Raharjo
parent 5f4134fbd0
commit ae7645384a
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
1 changed files with 17 additions and 22 deletions

View File

@ -34,15 +34,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 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
@ -52,8 +49,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"
@ -77,30 +74,28 @@ cd $PRGNAM-$SRCVER-$SUFFIX
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 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
sed -i 's/^\(\.PHONY: all dynamips\)/# \1/' Makefile
sed -i "s/-L\/usr\/lib\ -L\.\ -ldl/-L\/usr\/lib${LIBDIRSUFFIX} -L. -ldl -lz/" stable/Makefile
if [ $ARCH == "x86_64" ]
then
make dynamips.stable DYNAMIPS_ARCH=amd64 DYNAMIPS_LIB=lib64
# 20220211 bkw: actually use SLKCFLAGS... and show me the compile commands.
sed -i -e "s,-O3,$SLKCFLAGS," \
-e 's,@\$(CC),$(CC),g' \
stable/Makefile
if [ $ARCH == "x86_64" ]; then
make -j1 dynamips.stable DYNAMIPS_ARCH=amd64 DYNAMIPS_LIB=lib64
else
make dynamips.stable
make -j1 dynamips.stable
fi
make install DESTDIR=$PKG/usr
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
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
make -j1 install DESTDIR=$PKG/usr
strip $PKG/usr/bin/*
gzip -9 $PKG/usr/man/man*/*
rm -rf $PKG/usr/etc # 'make install' creates this, empty, useless.
chmod 644 README.community
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION