From ae7645384a12d98cf2d0ca2885be7e20b3d8b5ed Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 11 Feb 2022 19:40:34 -0500 Subject: system/dynamips: Fix 15.0 build. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- system/dynamips/dynamips.SlackBuild | 39 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/system/dynamips/dynamips.SlackBuild b/system/dynamips/dynamips.SlackBuild index 96b59d3145f7..6284f4698c69 100644 --- a/system/dynamips/dynamips.SlackBuild +++ b/system/dynamips/dynamips.SlackBuild @@ -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 -- cgit v1.2.3