aboutsummaryrefslogtreecommitdiff
path: root/misc/grc
diff options
context:
space:
mode:
Diffstat (limited to 'misc/grc')
-rw-r--r--misc/grc/README17
-rw-r--r--misc/grc/doinst.sh17
-rw-r--r--misc/grc/grc.SlackBuild30
-rw-r--r--misc/grc/grc.bashrc-expanded35
-rw-r--r--misc/grc/grc.info6
-rw-r--r--misc/grc/grc.zsh40
6 files changed, 45 insertions, 100 deletions
diff --git a/misc/grc/README b/misc/grc/README
index 4a0ed4ba0e40..6f4aa1247fc1 100644
--- a/misc/grc/README
+++ b/misc/grc/README
@@ -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
diff --git a/misc/grc/doinst.sh b/misc/grc/doinst.sh
new file mode 100644
index 000000000000..b8ee3107a858
--- /dev/null
+++ b/misc/grc/doinst.sh
@@ -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
diff --git a/misc/grc/grc.SlackBuild b/misc/grc/grc.SlackBuild
index 99177d6e7e40..9285f69709ea 100644
--- a/misc/grc/grc.SlackBuild
+++ b/misc/grc/grc.SlackBuild
@@ -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/
diff --git a/misc/grc/grc.bashrc-expanded b/misc/grc/grc.bashrc-expanded
deleted file mode 100644
index e15fd6476453..000000000000
--- a/misc/grc/grc.bashrc-expanded
+++ /dev/null
@@ -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
diff --git a/misc/grc/grc.info b/misc/grc/grc.info
index 4d4f9c0e546a..5b172921d392 100644
--- a/misc/grc/grc.info
+++ b/misc/grc/grc.info
@@ -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=""
diff --git a/misc/grc/grc.zsh b/misc/grc/grc.zsh
deleted file mode 100644
index f02db3ab8307..000000000000
--- a/misc/grc/grc.zsh
+++ /dev/null
@@ -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