summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authoryouri <youri@pkgsrc.org>2015-06-04 20:27:53 +0000
committeryouri <youri@pkgsrc.org>2015-06-04 20:27:53 +0000
commitd7e955813dfd68dc63566f73614227531d53e4cc (patch)
tree9c54d9ea7bfd26662969b99f36674db6363e0e62 /misc
parent50b917e0003f0eb3d220d9c2cfe776348ab16582 (diff)
downloadpkgsrc-d7e955813dfd68dc63566f73614227531d53e4cc.tar.gz
Import cw-1.0.16 as misc/cw.
Cw is a non-intrusive real-time ANSI color wrapper for common unix-based command. It is designed to simulate the environment of the commands being executed, so that if a person types 'du', 'df', 'ping', etc. in their shell it will automatically color the output in real-time according to a definition file containing the color format desired. cw has support for wildcard match coloring, tokenized coloring, headers/footers, case scenario coloring, command line dependent definition coloring, and includes over 50 pre-made definition files.
Diffstat (limited to 'misc')
-rw-r--r--misc/cw/DESCR8
-rw-r--r--misc/cw/MESSAGE10
-rw-r--r--misc/cw/Makefile17
-rw-r--r--misc/cw/PLIST123
-rw-r--r--misc/cw/distinfo7
-rw-r--r--misc/cw/patches/patch-Makefile.in121
-rw-r--r--misc/cw/patches/patch-src_cw.c15
7 files changed, 301 insertions, 0 deletions
diff --git a/misc/cw/DESCR b/misc/cw/DESCR
new file mode 100644
index 00000000000..e4dad057ffb
--- /dev/null
+++ b/misc/cw/DESCR
@@ -0,0 +1,8 @@
+Cw is a non-intrusive real-time ANSI color wrapper for common unix-based
+command. It is designed to simulate the environment of the commands being
+executed, so that if a person types 'du', 'df', 'ping', etc. in their
+shell it will automatically color the output in real-time according to
+a definition file containing the color format desired. cw has support
+for wildcard match coloring, tokenized coloring, headers/footers, case
+scenario coloring, command line dependent definition coloring, and
+includes over 50 pre-made definition files.
diff --git a/misc/cw/MESSAGE b/misc/cw/MESSAGE
new file mode 100644
index 00000000000..52e6a41c407
--- /dev/null
+++ b/misc/cw/MESSAGE
@@ -0,0 +1,10 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2015/06/04 20:27:53 youri Exp $
+
+Please update the interpreter in cw scripts before using cw.
+
+ # cwu ${PREFIX}/lib/cw ${PREFIX}/bin/cw
+
+And add ${PREFIX}/lib/cw to your $PATH.
+
+===========================================================================
diff --git a/misc/cw/Makefile b/misc/cw/Makefile
new file mode 100644
index 00000000000..1408d241933
--- /dev/null
+++ b/misc/cw/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2015/06/04 20:27:53 youri Exp $
+
+DISTNAME= cw-1.0.16
+CATEGORIES= misc
+MASTER_SITES= http://cwrapper.sourceforge.net/
+
+MAINTAINER= youri@NetBSD.org
+HOMEPAGE= http://cwrapper.sourceforge.net/
+COMMENT= Non-intrusive color wrapper for common commands
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= gmake
+
+CHECK_INTERPRETER_SKIP= lib/cw/*
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/misc/cw/PLIST b/misc/cw/PLIST
new file mode 100644
index 00000000000..c25ca886212
--- /dev/null
+++ b/misc/cw/PLIST
@@ -0,0 +1,123 @@
+@comment $NetBSD: PLIST,v 1.1 2015/06/04 20:27:53 youri Exp $
+bin/color
+bin/colorcfg
+bin/cw
+bin/cwu
+lib/cw/arp
+lib/cw/arping
+lib/cw/auth.log@
+lib/cw/blockdev
+lib/cw/cal
+lib/cw/cksum
+lib/cw/clock
+lib/cw/configure
+lib/cw/cpuinfo@
+lib/cw/crontab@
+lib/cw/cw-pipe
+lib/cw/cw-test.cgi
+lib/cw/date
+lib/cw/df
+lib/cw/diff
+lib/cw/dig
+lib/cw/dmesg
+lib/cw/du
+lib/cw/env
+lib/cw/etc/1line-blu.ftr
+lib/cw/etc/1line-blu.hdr
+lib/cw/etc/1line-cyn.ftr
+lib/cw/etc/1line-cyn.hdr
+lib/cw/etc/1line-grn.ftr
+lib/cw/etc/1line-grn.hdr
+lib/cw/etc/1line-gry.ftr
+lib/cw/etc/1line-gry.hdr
+lib/cw/etc/1line-grydash.ftr
+lib/cw/etc/1line-grydash.hdr
+lib/cw/etc/1line-gryfade.ftr
+lib/cw/etc/1line-gryfade.hdr
+lib/cw/etc/1line-prp.ftr
+lib/cw/etc/1line-prp.hdr
+lib/cw/etc/1line-red.ftr
+lib/cw/etc/1line-red.hdr
+lib/cw/etc/1line-ylw.ftr
+lib/cw/etc/1line-ylw.hdr
+lib/cw/etc/README
+lib/cw/etc/bendingbars.ftr
+lib/cw/etc/bendingbars.hdr
+lib/cw/etc/chrome.ftr
+lib/cw/etc/chrome.hdr
+lib/cw/etc/goop-cyngrn.ftr
+lib/cw/etc/goop-cyngrn.hdr
+lib/cw/etc/goop-redprp.ftr
+lib/cw/etc/goop-redprp.hdr
+lib/cw/figlet
+lib/cw/file
+lib/cw/find
+lib/cw/finger
+lib/cw/free
+lib/cw/fstab@
+lib/cw/fuser
+lib/cw/g++
+lib/cw/gcc
+lib/cw/group@
+lib/cw/groups
+lib/cw/hdparm
+lib/cw/hexdump
+lib/cw/host
+lib/cw/hosts@
+lib/cw/id
+lib/cw/ifconfig
+lib/cw/inittab@
+lib/cw/iptables
+lib/cw/last
+lib/cw/lastlog
+lib/cw/lsattr
+lib/cw/lsmod
+lib/cw/lsof
+lib/cw/ltrace-color
+lib/cw/make
+lib/cw/md5sum
+lib/cw/meminfo@
+lib/cw/messages@
+lib/cw/mount
+lib/cw/mpg123
+lib/cw/netstat
+lib/cw/nfsstat
+lib/cw/nmap
+lib/cw/nslookup
+lib/cw/objdump
+lib/cw/passwd@
+lib/cw/ping
+lib/cw/pmap
+lib/cw/pmap_dump
+lib/cw/praliases
+lib/cw/profile@
+lib/cw/protocols@
+lib/cw/ps
+lib/cw/pstree
+lib/cw/quota
+lib/cw/quotastats
+lib/cw/resolv.conf@
+lib/cw/route
+lib/cw/routel
+lib/cw/sdiff
+lib/cw/services@
+lib/cw/showmount
+lib/cw/smbstatus
+lib/cw/stat
+lib/cw/strace-color
+lib/cw/sysctl
+lib/cw/syslog
+lib/cw/tar
+lib/cw/tcpdump
+lib/cw/tracepath
+lib/cw/traceroute
+lib/cw/umount
+lib/cw/uname
+lib/cw/uptime
+lib/cw/users
+lib/cw/vmstat
+lib/cw/w
+lib/cw/wc
+lib/cw/whereis
+lib/cw/who
+lib/cw/xferlog@
diff --git a/misc/cw/distinfo b/misc/cw/distinfo
new file mode 100644
index 00000000000..44128002e55
--- /dev/null
+++ b/misc/cw/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2015/06/04 20:27:53 youri Exp $
+
+SHA1 (cw-1.0.16.tar.gz) = aede60d3f7a9c384e98836a84072dc7b459ce616
+RMD160 (cw-1.0.16.tar.gz) = 7040d32ca9cc82d7a341a237343bfbb7cf9eda75
+Size (cw-1.0.16.tar.gz) = 85621 bytes
+SHA1 (patch-Makefile.in) = 483926acea84aad117ccdce0c4cd644c7ef08a94
+SHA1 (patch-src_cw.c) = 766b3d30a54ccbec1d08eaaadbf77b39c3bb3fb6
diff --git a/misc/cw/patches/patch-Makefile.in b/misc/cw/patches/patch-Makefile.in
new file mode 100644
index 00000000000..ed94132bdfb
--- /dev/null
+++ b/misc/cw/patches/patch-Makefile.in
@@ -0,0 +1,121 @@
+$NetBSD: patch-Makefile.in,v 1.1 2015/06/04 20:27:53 youri Exp $
+
+Fix the Makefile for DESTDIR support.
+
+--- Makefile.in.orig 2010-06-20 04:39:51.000000000 +0000
++++ Makefile.in
+@@ -2,101 +2,21 @@
+ PREFIX=@prefix@
+ BINDIR=${PREFIX}/bin
+ LIBDIR=${PREFIX}/lib
+-MANDIR=@mandir@
+ SHELL=@SHELL@
+ CC=@CC@
+-ECHO=echo
+-LN=ln
+-RM=rm
+-MKDIR=mkdir
+-INSTALL=@INSTALL@
+
+ all:
+- @$(ECHO) "* Type \"make local\" to just compile local binaries."
+- @$(ECHO) "* Type \"make installlocal\" to compile/install in"\
+- "your home directory."
+- @$(ECHO) "* Type \"make install\" to compile/install globally."
++ $(CC) src/cw.c -o bin/cw @CFLAGS@ @LIBS@ @DEFS@
++ $(CC) src/cwu.c -o bin/cwu @CFLAGS@
+
+-cw:
+- @$(ECHO) "* Compiling cw(color wrapper)..."
+- @$(CC) src/cw.c -o bin/cw @CFLAGS@ @LIBS@ @DEFS@
+-
+-cwu:
+- @$(ECHO) "* Compiling cwu(color wrapper directive updater)..."
+- @$(CC) src/cwu.c -o bin/cwu @CFLAGS@
+-
+-local: cw cwu
+-
+-installlocal: cleanlocal local
+- @$(ECHO) "* Installing color wrapper locally..."
+- @$(MKDIR) -m 755 $(HOME)/.cw $(HOME)/.cw/bin $(HOME)/.cw/def $(HOME)/.cw/def/etc
+- @for FILE in bin/*;do $(INSTALL) -m 755 $$FILE $(HOME)/.cw/bin/;done
+- @$(LN) -sf $(HOME)/.cw/bin/cw $(HOME)/.cw/bin/cwe
+- @$(ECHO) "* Installing color wrapper generic definition files..."
+- @for FILE in def/*;do $(INSTALL) -m 755 $$FILE $(HOME)/.cw/def/;done
+- @$(ECHO) "* Installing color wrapper generic header/footer files..."
+- @for FILE in etc/*;do $(INSTALL) -m 644 $$FILE $(HOME)/.cw/def/etc/;done
+- @$(ECHO) "* Updating definition files..."
+- @bin/cwu $(HOME)/.cw/def/ $(HOME)/.cw/bin/cw
+- @$(ECHO) "-----------------------------------------------------------"
+- @$(ECHO) "* Complete, definitions are stored in: ~/.cw/def"
+- @$(ECHO) "* For bash: place 'export PATH=\"~/.cw/def:\$$PATH\"'"\
+- "at the end of ~/.bash_profile"
+- @$(ECHO) "* For tcsh: place 'setenv PATH \"~/.cw/def:\$$PATH\"'"\
+- "at the end of ~/.login"
+- @$(ECHO) "* Or to automate the two lines above use the"\
+- "\"~/.cw/bin/colorcfg\" command. (and add optional anti-coloring"\
+- "precautions)"
+- @$(ECHO) "* Once the desired shell(s) are setup, use the"\
+- "\"~/.cw/bin/color\" command, or the environmental variable"\
+- "NOCOLOR=1 to turn color wrapping on and off."
+- @$(ECHO) ""
+- @$(ECHO) "* PLEASE view the ./README file for more information if"\
+- "you haven't already."
+-
+-install: cleanpub cw cwu
+- @$(ECHO) "* Installing color wrapper..."
+- @for FILE in bin/*;do $(INSTALL) -o 0 -g 0 -m 755 $$FILE $(BINDIR);done
+- @$(LN) -sf $(BINDIR)/cw $(BINDIR)/cwe
+- @$(ECHO) "* Installing color wrapper generic definition files..."
+- @$(MKDIR) -m 755 $(LIBDIR)/cw/
+- @for FILE in def/*;do $(INSTALL) -o 0 -g 0 -m 755 $$FILE $(LIBDIR)/cw/;done
+- @$(ECHO) "* Installing color wrapper generic header/footer files..."
+- @$(MKDIR) -m 755 $(LIBDIR)/cw/etc
+- @for FILE in etc/*;do $(INSTALL) -o 0 -g 0 -m 644 $$FILE $(LIBDIR)/cw/etc;done
+- @$(ECHO) "* Installing manual pages..."
+- @for FILE in man/*;do $(INSTALL) -o 0 -g 0 -m 644 $$FILE $(MANDIR)/man1/;done
+- @$(ECHO) "* Updating definition files..."
+- @$(BINDIR)/cwu $(LIBDIR)/cw $(BINDIR)/cw
+- @$(ECHO) "-----------------------------------------------------------"
+- @$(ECHO) "* Complete, definitions are stored in: $(LIBDIR)/cw"
+- @$(ECHO) "* For bash: place 'export PATH=\"$(LIBDIR)/cw:\$$PATH\"'"\
+- "at the end of ~/.bash_profile(or /etc/profile globally)"
+- @$(ECHO) "* For tcsh: place 'setenv PATH \"$(LIBDIR)/cw:\$$PATH\"'"\
+- "at the end of ~/.login(or /etc/csh.login globally)"
+- @$(ECHO) "* Or to automate the two lines above use the"\
+- "\"colorcfg\" command. (and add optional anti-coloring precautions)"
+- @$(ECHO) "* Once the desired shell(s) are setup, use the"\
+- "\"color\" command, or the environmental variable NOCOLOR=1 to turn"\
+- "color wrapping on and off."
+- @$(ECHO) ""
+- @$(ECHO) "* PLEASE view the ./README file for more information if"\
+- "you haven't already."
+-
+-clean:
+- @$(ECHO) "* Cleaning compiling content..."
+- @$(RM) -rf Makefile config.status config.cache config.log config.h\
+- bin/cw bin/cwu bin/cw.exe bin/cwu.exe
+-
+-cleanlocal:
+- @$(ECHO) "* Cleaning local content..."
+- @$(RM) -rf $(HOME)/.cw
+-
+-cleanpub:
+- @$(ECHO) "* Cleaning cw and cwu binaries, and definitions..."
+- @$(RM) -rf $(BINDIR)/cw $(BINDIR)/cwu $(BINDIR)/cwe\
+- $(BINDIR)/cw.exe $(BINDIR)/cwu.exe $(BINDIR)/color $(BINDIR)/colorcfg\
+- $(LIBDIR)/cw $(MANDIR)/man1/cw.1.gz $(MANDIR)/man1/cwu.1.gz\
+- $(MANDIR)/man1/cwe.1.gz
+-
+-cleanall: clean cleanlocal cleanpub
++.PHONY: install
++install:
++ mkdir -p $(DESTDIR)$(LIBDIR)/cw/etc
++ mkdir -p $(DESTDIR)$(LIBDIR)
++ mkdir -p $(DESTDIR)$(BINDIR)
++ install -pm 755 bin/cw $(DESTDIR)$(BINDIR)/
++ install -pm 755 bin/cwu $(DESTDIR)$(BINDIR)/
++ install -pm 755 bin/color $(DESTDIR)$(BINDIR)/
++ install -pm 755 bin/colorcfg $(DESTDIR)$(BINDIR)/
++ install -pm 755 def/* $(DESTDIR)$(LIBDIR)/cw/
++ install -pm 644 etc/* $(DESTDIR)$(LIBDIR)/cw/etc/
diff --git a/misc/cw/patches/patch-src_cw.c b/misc/cw/patches/patch-src_cw.c
new file mode 100644
index 00000000000..39f7bd620c5
--- /dev/null
+++ b/misc/cw/patches/patch-src_cw.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_cw.c,v 1.1 2015/06/04 20:27:53 youri Exp $
+
+fprintf requires the format.
+
+--- src/cw.c.orig 2010-06-20 04:39:51.000000000 +0000
++++ src/cw.c
+@@ -643,7 +643,7 @@ void sighandler(signed int sig){
+ else if(sig==SIGUSR1)ext=1;
+ else if(sig==SIGALRM)ext=2;
+ else if(sig==SIGPIPE||sig==SIGINT){
+- fprintf(stderr,pal2[16]);
++ fprintf(stderr,"%s\n",pal2[16]);
+ fflush(stderr);
+ cwexit(0,0);
+ }