Thu Jun 4 20:27:53 2015 UTC ()
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.


(youri)
diff -r0 -r1.1 pkgsrc/misc/cw/DESCR
diff -r0 -r1.1 pkgsrc/misc/cw/MESSAGE
diff -r0 -r1.1 pkgsrc/misc/cw/Makefile
diff -r0 -r1.1 pkgsrc/misc/cw/PLIST
diff -r0 -r1.1 pkgsrc/misc/cw/distinfo
diff -r0 -r1.1 pkgsrc/misc/cw/patches/patch-Makefile.in
diff -r0 -r1.1 pkgsrc/misc/cw/patches/patch-src_cw.c

File Added: pkgsrc/misc/cw/DESCR
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.

File Added: pkgsrc/misc/cw/Attic/MESSAGE
===========================================================================
$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.

===========================================================================

File Added: pkgsrc/misc/cw/Makefile
# $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"

File Added: pkgsrc/misc/cw/PLIST
@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@

File Added: pkgsrc/misc/cw/distinfo
$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

File Added: pkgsrc/misc/cw/patches/patch-Makefile.in
$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/

File Added: pkgsrc/misc/cw/patches/patch-src_cw.c
$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);
  }