From ac0b70909acb3010cfd77f03aaeb842dc9e9a68e Mon Sep 17 00:00:00 2001 From: Zbigniew Baniewski Date: Sat, 8 Jan 2011 17:34:39 -0200 Subject: network/comgt: Added (3G/GPRS datacard management utility) Signed-off-by: Niels Horn --- network/comgt/01-comgt-0.32-directories.diff | 21 +++++++ network/comgt/README | 5 ++ network/comgt/comgt.SlackBuild | 91 ++++++++++++++++++++++++++++ network/comgt/comgt.info | 10 +++ network/comgt/doinst.sh | 18 ++++++ network/comgt/slack-desc | 20 ++++++ 6 files changed, 165 insertions(+) create mode 100644 network/comgt/01-comgt-0.32-directories.diff create mode 100644 network/comgt/README create mode 100644 network/comgt/comgt.SlackBuild create mode 100644 network/comgt/comgt.info create mode 100644 network/comgt/doinst.sh create mode 100644 network/comgt/slack-desc (limited to 'network') diff --git a/network/comgt/01-comgt-0.32-directories.diff b/network/comgt/01-comgt-0.32-directories.diff new file mode 100644 index 0000000000..30e957417a --- /dev/null +++ b/network/comgt/01-comgt-0.32-directories.diff @@ -0,0 +1,21 @@ +diff -Nur comgt.0.32/Makefile comgt.0.32.new/Makefile +--- comgt.0.32/Makefile 2006-10-20 14:49:46.000000000 +0000 ++++ comgt.0.32.new/Makefile 2010-12-16 00:03:14.416680046 +0000 +@@ -23,12 +23,12 @@ + # + # + +-LIB = -L/usr/local/lib +-INC = -I/usr/local/include +-EXE = /usr/local/bin +-MAN = /usr/share/man/man1 ++#LIB = -L/lib ++#INC = -I/usr/include ++EXE = $(DESTDIR)/usr/bin ++MAN = $(DESTDIR)/usr/man/man1 + CPROG = comgt +-SCRIPTPATH = /etc/comgt/ ++SCRIPTPATH = $(DESTDIR)/etc/comgt/ + SCRIPTSRC = ./scripts/ + BIN = $(CPROG) + MANP = comgt.1 sigmon.1 diff --git a/network/comgt/README b/network/comgt/README new file mode 100644 index 0000000000..f8ae2f57ae --- /dev/null +++ b/network/comgt/README @@ -0,0 +1,5 @@ +comgt is a scripting language interpreter useful for establishing +communications on serial lines and through PCMCIA modems as well as GPRS +and 3G datacards. comgt has some features that are rarely found in other +utilities of the same type. + diff --git a/network/comgt/comgt.SlackBuild b/network/comgt/comgt.SlackBuild new file mode 100644 index 0000000000..798786eb60 --- /dev/null +++ b/network/comgt/comgt.SlackBuild @@ -0,0 +1,91 @@ +#!/bin/sh + +# Slackware build script for comgt + +# Written by Zbigniew Baniewski, zb@ispid.com.pl + +PRGNAM=comgt +VERSION=0.32 +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 -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM.$VERSION +tar xvf $CWD/$PRGNAM.$VERSION.tgz + +cd $PRGNAM.$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# fix location of files +cat $CWD/01-comgt-0.32-directories.diff | patch -p1 || exit + +# fix Makefile to accept our CFLAGS +sed -i "s/CFLAGS =/CFLAGS +=/" Makefile + +mkdir -p $PKG/etc +mkdir -p $PKG/usr/bin +mkdir -p $PKG/usr/man/man1 + +CFLAGS=$SLKCFLAGS \ + make +make install DESTDIR=$PKG + +# rename configuration files to .new so that they don't overrite existing ones +for f in command dump operator sigmon; do + mv $PKG/etc/comgt/$f $PKG/etc/comgt/$f.new +done + +find $PKG | xargs 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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + CHANGELOG *.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 +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/comgt/comgt.info b/network/comgt/comgt.info new file mode 100644 index 0000000000..308557ceb0 --- /dev/null +++ b/network/comgt/comgt.info @@ -0,0 +1,10 @@ +PRGNAM="comgt" +VERSION="0.32" +HOMEPAGE="http://comgt.sourceforge.net/" +DOWNLOAD="http://downloads.sourceforge.net/comgt/comgt.0.32.tgz" +MD5SUM="db2452680c3d953631299e331daf49ef" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Zbigniew Baniewski" +EMAIL="zb@ispid.com.pl" +APPROVED="Niels Horn" diff --git a/network/comgt/doinst.sh b/network/comgt/doinst.sh new file mode 100644 index 0000000000..b3c6dabacc --- /dev/null +++ b/network/comgt/doinst.sh @@ -0,0 +1,18 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/comgt/command.new +config etc/comgt/dump.new +config etc/comgt/operator.new +config etc/comgt/sigmon.new + diff --git a/network/comgt/slack-desc b/network/comgt/slack-desc new file mode 100644 index 0000000000..14d67f1a96 --- /dev/null +++ b/network/comgt/slack-desc @@ -0,0 +1,20 @@ +# 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------------------------------------------------------| +comgt: comgt (3G/GPRS datacard management utility) +comgt: +comgt: comgt is a scripting language interpreter useful for establishing +comgt: communications on serial lines and through PCMCIA modems as well as +comgt: GPRS and 3G datacards. comgt has some features that are rarely found +comgt: in other utilities of the same type. +comgt: +comgt: http://comgt.sourceforge.net/ +comgt: +comgt: +comgt: + -- cgit v1.2.3