aboutsummaryrefslogtreecommitdiff
path: root/network/cmdiag/cmdiag.SlackBuild
diff options
context:
space:
mode:
authorMichal Bialozor <bialyy@o2.pl>2011-08-26 07:55:26 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-08-26 07:55:26 -0300
commit87e13d5b57e9d1768442779c4a27c7b5547cab99 (patch)
tree2efe9f6157212671056b8a963dd6f00e73e83003 /network/cmdiag/cmdiag.SlackBuild
parent0f7a939968db389357ca05902ecb04d39928d133 (diff)
network/cmdiag: Added (cable modem diagnostics tool)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/cmdiag/cmdiag.SlackBuild')
-rw-r--r--network/cmdiag/cmdiag.SlackBuild68
1 files changed, 68 insertions, 0 deletions
diff --git a/network/cmdiag/cmdiag.SlackBuild b/network/cmdiag/cmdiag.SlackBuild
new file mode 100644
index 0000000000000..f13ab2f5c523f
--- /dev/null
+++ b/network/cmdiag/cmdiag.SlackBuild
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# Slackware build script for cmdiag
+# Written by Michal Bialozor <bialyy@o2.pl>
+
+PRGNAM=cmdiag
+VERSION=0.2
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -ue
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+cat $CWD/cmdiag.cpp.patch | patch --verbose -p0 || exit 1
+
+# Use our CFLAGS
+sed -i "s/^CFLAGS = /CFLAGS += /g" Makefile
+
+CFLAGS="$SLKCFLAGS" \
+ make
+
+mkdir -p $PKG/usr/sbin
+cp -a $PRGNAM $PKG/usr/sbin
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.txt $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+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:-tgz}