%define cwlib %{_libdir}/cw %define cwbin %{_bindir}/cw Name: cw Summary: cw - ANSI color wrapper for common commands Copyright: GPL Group: System/Console Version: 1.0.4 Release: 0.mv.1.SuSE9.2 Packager: Martin Väth Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Prefix: %{_prefix} %description %{name} is a non-intrusive real-time ANSI color wrapper for common unix-based commands on GNU/linux. %{name} 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. %{name}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. Since %{name} may cause problems with some shell scripts, it must be enabled manually: For bash: place 'export PATH="${cwlib}:$PATH"' at the end of ~/.bash_profile (or /etc/profile globally) For tcsh: place 'setenv PATH "${cwlib}:$PATH"' at the end of ~/.login (or /etc/csh.login globally Once the desired shell(s) are setup, use the "color" command, or the environmental variable NOCOLOR=1 to turn color wrapping on and off. %prep umask 022 test -n '%{buildroot}' || { echo "Must use buildroot" ; exit 1 ; } %if %{?fake:%fake}%{!?fake:0} %setup -T -D -c %else %setup -c test -d %{name}-%{version} && mv %{name}-%{version}/* . test -d %{name} && mv %{name}/* . %endif %build umask 022 cd "$RPM_BUILD_DIR"/%{name}-%{version} %if %{?fake:%fake}%{!?fake:0} %else make local strip bin/cw* for i in man/cwu.1 man/cw.1 ; do zcat "$i.gz" | sed 's!NONE/lib/cw!%{cwlib}!g' > "$i" touch --reference="$i.gz" "$i" rm "$i.gz" gzip -9 "$i" done pushd def for i in * ; do sed 's+^#!.*/cw$+#!%{cwbin}+' "$i" > "../TEMPFILE" touch --reference="$i" "../TEMPFILE" mv ../TEMPFILE "$i" done %endif %install umask 022 cd "$RPM_BUILD_DIR"/%{name}-%{version} test -n '%{buildroot}' test -d '%{buildroot}' && rm -rf '%{buildroot}' install -d -m 755 '%{buildroot}%{_bindir}' install -p -m 755 -s bin/* '%{buildroot}%{_bindir}' install -d -m 755 '%{buildroot}%{cwlib}' install -p -m 755 def/* '%{buildroot}%{cwlib}' install -d -m 755 '%{buildroot}%{_mandir}/man1' install -p -m 644 man/* '%{buildroot}%{_mandir}/man1' %clean test -n '%{buildroot}' -a -d '%{buildroot}' && rm -rf '%{buildroot}' %files %defattr(-,root,root) %doc COPYING CHANGES CONTRIB README %{_bindir}/* %{_mandir}/man1/* %{cwlib} %changelog * Sun Aug 22 2004 Martin Väth - built from scratch