network/cmdiag: Added (cable modem diagnostics tool)

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
Michal Bialozor 2011-08-26 07:55:26 -03:00 committed by Niels Horn
parent 0f7a939968
commit 87e13d5b57
5 changed files with 111 additions and 0 deletions

4
network/cmdiag/README Normal file
View File

@ -0,0 +1,4 @@
cmdiag is a Docsis cable modem diagnostic tool. It can get information from
Docsis 1.0, 1.1 and maybe 2.0 cable modems. It gathers information from the
cable modem via SNMP and displays various cable parameters in real time.
This small tool is writen in C++, it runs on Linux and FreeBSD.

View File

@ -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}

View File

@ -0,0 +1,10 @@
--- cmdiag.cpp.orig 2008-05-01 22:42:18.000000000 +0200
+++ cmdiag.cpp 2011-08-08 12:05:24.113372114 +0200
@@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#include "bar.h"
#include "pbar.h"
#include "globals.h"

View File

@ -0,0 +1,10 @@
PRGNAM="cmdiag"
VERSION="0.2"
HOMEPAGE="http://cmdiag.sourceforge.net"
DOWNLOAD="http://downloads.sourceforge.net/cmdiag/cmdiag-0.2.tar.gz"
MD5SUM="e1bde5ef9d1c0f976f4cfe0af990d4e8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Michal Bialozor"
EMAIL="bialyy@o2.pl"
APPROVED="Niels Horn"

19
network/cmdiag/slack-desc Normal file
View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
cmdiag: cmdiag (cable modem diagnostics tool)
cmdiag:
cmdiag: cmdiag can get information from Docsis 1.0, 1.1 and maybe 2.0 cable
cmdiag: modems. It gathers information from the cable modem via SNMP and
cmdiag: displays various cable parameters in real time.
cmdiag: This small tool is writen in C++, it runs on Linux and FreeBSD.
cmdiag:
cmdiag: Homepage: http://cmdiag.sourceforge.net/
cmdiag:
cmdiag:
cmdiag: