diff options
Diffstat (limited to 'network/ethersrv-linux/ethersrv-linux.SlackBuild')
-rw-r--r-- | network/ethersrv-linux/ethersrv-linux.SlackBuild | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/network/ethersrv-linux/ethersrv-linux.SlackBuild b/network/ethersrv-linux/ethersrv-linux.SlackBuild new file mode 100644 index 0000000000..894f7caf1b --- /dev/null +++ b/network/ethersrv-linux/ethersrv-linux.SlackBuild @@ -0,0 +1,81 @@ +#!/bin/bash + +# Slackware build script for ethersrv-linux + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# TODO: +# - rc.d script. +# - use capabilities so it doesn't have to run as root. +# These are waiting on me to dig up an old machine to run MS-DOS on, +# right now I don't have a way to properly test this. pi31415 on +# IRC says it's possible to use this with qemu... + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=ethersrv-linux +VERSION=${VERSION:-20180203} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod -h 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod -h 644 {} + + +make CFLAGS="$SLKCFLAGS" +install -D -s -m0755 $PRGNAM $PKG/usr/sbin/$PRGNAM + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +CLIENT=$PKG/usr/share/$PRGNAM/client +mkdir -p $PKGDOC/client $CLIENT + +cp -a *.txt $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +# be nice, include the client + its docs in the package. +unzip -LL $CWD/etherdfs.zip -d $PKGDOC/client +mv $PKGDOC/client/*exe $CLIENT + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |