misc/grc: Updated for version 1.10.

Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
This commit is contained in:
Edinaldo P. Silva 2017-01-28 23:08:35 +00:00 committed by Willy Sudiarto Raharjo
parent 336e4c2d0d
commit c2b699753b
No known key found for this signature in database
GPG key ID: 887B8374D7333381
6 changed files with 45 additions and 100 deletions

View file

@ -1,14 +1,13 @@
grc (generic colouriser)
grc provides two programs: grc and grcat. The main is grcat, which
acts as a filter, i.e. taking standard input, colourising it and
writing to standard output. grcat takes as a parameter the name of
grc provides two programs: grc and grcat. The main is grcat, which
acts as a filter, i.e. taking standard input, colourising it and
writing to standard output. grcat takes as a parameter the name of
configuration file.
To use, add following lines into your ~/.bashrc or ~/.zshrc:
To use, add following lines into your ~/.bashrc, ~/.zshrc or in
~/.config/fish/config.fish:
[[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh
Or put the entire content of /usr/doc/grc-1.9/grc.bashrc-expanded
example into these files.
[[ -s "/etc/profile.d/grc.bashrc" ]] && source /etc/profile.d/grc.bashrc
[[ -s "/etc/profile.d/grc.zsh" ]] && source /etc/profile.d/grc.zsh
[[ -s "/etc/profile.d/grc.fish" ]] && source /etc/profile.d/grc.fish

17
misc/grc/doinst.sh Normal file
View file

@ -0,0 +1,17 @@
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/grc.conf.new
config etc/grc.bashrc.new
config etc/grc.zsh.new
config etc/grc.fish.new

View file

@ -2,7 +2,7 @@
#
# Slackware build script for grc.
#
# Copyright 2015 Edinaldo P. Silva, Rio de Janeiro, Brazil.
# Copyright 2015-2017 Edinaldo P. Silva, Rio de Janeiro, Brazil.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -23,13 +23,13 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM="grc"
VERSION=${VERSION:-1.9}
VERSION=${VERSION:-1.10}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@ -40,8 +40,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@ -56,21 +56,25 @@ fi
set -e
SRCVER="v$VERSION"
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$SRCVER.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
install -d $PKG/etc
install -D -m644 {grc.conf,grc.bashrc,$CWD/grc.zsh} $PKG/etc
install -d $PKG/etc/profile.d
install -D -m644 grc.conf $PKG/etc/grc.conf.new
install -D -m644 grc.bashrc $PKG/etc/profile.d/grc.bashrc.new
install -D -m644 grc.zsh $PKG/etc/profile.d/grc.zsh.new
install -D -m644 grc.fish $PKG/etc/profile.d/grc.fish.new
install -d $PKG/usr/bin
install -D -m755 {grc,grcat} $PKG/usr/bin/
install -D -m755 {grc,grcat} $PKG/usr/bin
install -d $PKG/usr/share/grc
install -D -m644 conf.* $PKG/usr/share/grc
install -d $PKG/usr/man/man1
install -D -m644 {grc.1,grcat.1} $PKG/usr/man/man1
@ -81,8 +85,8 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r
install -d $PKG/usr/share/$PRGNAM
install -D -m644 conf.* $PKG/usr/share/$PRGNAM
DOCS="$CWD/grc.bashrc-expanded contrib debian/changelog debian/copyright \
CREDITS INSTALL README Regexp.txt TODO"
DOCS="contrib debian/changelog debian/copyright CREDITS INSTALL \
README.markdown Regexp.txt TODO"
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION/

View file

@ -1,35 +0,0 @@
GRC=`which grc`
if [ "$TERM" != dumb ] && [ -n "$GRC" ]
then
alias colourify="$GRC -es --colour=auto"
alias cfg='colourify ./configure'
alias configure='colourify ./configure'
alias as='colourify as'
alias cvs='colourify cvs'
alias df='colourify df'
alias diff='colourify diff'
alias dig='colourify dig'
alias g++='colourify g++'
alias gas='colourify gas'
alias gcc='colourify gcc'
alias esperanto='colourify esperanto'
alias head='colourify head'
alias ifconfig='colourify ifconfig'
alias irclog='colourify irclog'
alias ld='colourify ld'
alias ldap='colourify ldap'
alias log='colourify log'
alias ls='colourify ls'
alias make='colourify make'
alias mount='colourify mount'
alias mount2='colourify mount2'
alias mtr='colourify mtr'
alias netstat='colourify netstat'
alias ping='colourify ping'
alias php='colourify php'
alias proftpd='colourify proftpd'
alias ps='colourify ps'
alias tail='colourify tail'
alias traceroute='colourify /usr/sbin/traceroute'
alias wdiff='colourify wdiff'
fi

View file

@ -1,8 +1,8 @@
PRGNAM="grc"
VERSION="1.9"
VERSION="1.10"
HOMEPAGE="https://github.com/garabik/grc"
DOWNLOAD="https://github.com/garabik/grc/archive/v1.9.tar.gz"
MD5SUM="2d2d2d4fb465e7f1974b5fecb6903206"
DOWNLOAD="https://github.com/garabik/grc/archive/v1.10/grc-1.10.tar.gz"
MD5SUM="fdc101dbaaf38011d75d21a8760e0e5c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""

View file

@ -1,40 +0,0 @@
if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then
# Prevent grc aliases from overriding zsh completions.
setopt COMPLETE_ALIASES
# Supported commands
cmds=(
cc \
configure \
cvs \
df \
diff \
dig \
gcc \
gmake \
ifconfig \
last \
ldap \
ls \
make \
mount \
mtr \
netstat \
ping \
ping6 \
ps \
traceroute \
traceroute6 \
wdiff \
);
# Set alias for available commands.
for cmd in $cmds ; do
if (( $+commands[$cmd] )) ; then
alias $cmd="grc --colour=auto $cmd"
fi
done
# Clean up variables
unset cmds cmd
fi