#!/bin/bash # iputils.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv5te" export LIBDIRSUFFIX="" ;; *) export SLKCFLAGS="-O2" ;; esac # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Extract source: cd $TMPBUILD tar xvf $CWD/iputils-$VERSION.tar.?z* || exit 1 cd iputils* || exit 1 slackhousekeeping # Build: make VPATH=/usr/lib${LIBDIRSUFFIX} $NUMJOBS || failmake make clockdiff rarpd rdisc || failmake ( cd doc ; make man ) pushd ninfod CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --infodir=/usr/info \ --disable-static \ --build=$ARCH-slackware-linux-gnueabi || exit 1 make $NUMJOBS || make || exit 1 popd # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Install into package: mkdir -vpm755 $PKG/{sbin,bin,usr/{bin,sbin,man/man8}} install -vpm755 clockdiff arping ninfod/ninfod \ $PKG/sbin install -vpm4711 ping6 ping \ $PKG/bin/ install -vpm755 rdisc rarpd \ $PKG/usr/sbin/ install -vpm755 tracepath6 tracepath \ $PKG/usr/bin/ install -vpm4711 traceroute6 \ $PKG/usr/bin/ ( cd doc install -vpm644 arping.8 clockdiff.8 ninfod.8 ping.8 rarpd.8 rdisc.8 tracepath.8 traceroute6.8 \ $PKG/usr/man/man8 cd $PKG/usr/man/man8 ln -vsf ping.8 ping6.8 ln -vsf tracepath.8 tracepath6.8 ) # Copy docs: mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION cp -a RELNOTES \ $PKG/usr/doc/$PKGNAM-$VERSION # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slack644docs # slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links