From 7b81e6ff3e938bfdc4ca4e81dcd0ebd84bb788fb Mon Sep 17 00:00:00 2001 From: Michał Bentkowski Date: Jan 02 2007 19:05:28 +0000 Subject: auto-import cowsay-3.03-2 on branch devel from cowsay-3.03-2.src.rpm --- diff --git a/.cvsignore b/.cvsignore index e69de29..53e94e0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +cowsay-3.03.tar.gz diff --git a/animalsay b/animalsay new file mode 100644 index 0000000..77c3461 --- /dev/null +++ b/animalsay @@ -0,0 +1,16 @@ +#!/bin/sh + +NUM=0 +TOL=0 +for cow in /usr/share/cowsay/*.cow ; do + TOL=$((TOL+1)) +done + +SELECT=$(((`date +%M | sed -e 's|^0||'`*60+`date +%S | sed -e 's|^0||'`)%(TOL))) + +for cow in /usr/share/cowsay/*.cow ; do + NUM=$((NUM+1)) + if [ $NUM = $SELECT ] ; then break ; fi +done + +exec /usr/bin/cowsay -f $cow "$@" diff --git a/cowsay.bashcomp b/cowsay.bashcomp new file mode 100644 index 0000000..77d8be9 --- /dev/null +++ b/cowsay.bashcomp @@ -0,0 +1,34 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/games-misc/cowsay/files/cowsay.bashcomp,v 1.1 2005/02/06 14:37:54 ka0ttic Exp $ + +# bash command-line completion for cowsay +# Author: Aaron Walker +# Modified by: Michal Bentkowski + +_cowsay() { + local cur prev opts x + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-e -f -h -l -n -T -W -b -d -g -p -s -t -w -y" + + if [[ "${cur}" == -* || ${COMP_CWORD} -eq 1 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi + + case "${prev}" in + -f) + COMPREPLY=( $( command ls /usr/share/cowsay| \ + sed -ne 's/^\('$cur'.*\)\.cow$/\1/p') ) + return 0 + ;; + -[eTW]) + COMPREPLY=() + ;; + esac +} +complete -o filenames -F _cowsay cowsay cowthink + +# vim: set ft=sh tw=80 sw=4 et : diff --git a/cowsay.spec b/cowsay.spec new file mode 100644 index 0000000..1b04b67 --- /dev/null +++ b/cowsay.spec @@ -0,0 +1,66 @@ +Name: cowsay +Version: 3.03 +Release: 2%{?dist} +Summary: Configurable speaking/thinking cow +Group: Amusements/Games +License: Artistic or GPL +URL: http://www.nog.net/~tony/warez/cowsay.shtml +Source0: http://www.nog.net/~tony/warez/%{name}-%{version}.tar.gz +Source1: cowsay.bashcomp +Source2: animalsay +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +%description +cowsay is a configurable talking cow, written in Perl. It operates +much as the figlet program does, and it written in the same spirit +of silliness. +It generates ASCII pictures of a cow with a message. It can also generate +pictures of other animals. + + +%prep +%setup -q +%{__sed} -e 's#%PREFIX%/share/cows#%{_datadir}/%{name}#' \ + -e 's#%BANGPERL%#!%{__perl}#' -i %{name} +%{__sed} -e 's#%PREFIX%/share/cows#%{_datadir}/%{name}#' \ + -e 's#/usr/local/share/cows#%{_datadir}/%{name}#' -i %{name}.1 + +%build +echo No need to build anything + +%install +rm -rf $RPM_BUILD_ROOT +# using install.sh is not a good idea so let's make the install manually +mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_datadir}/%{name},%{_sysconfdir}/bash_completion.d} +cp -p %{name} $RPM_BUILD_ROOT%{_bindir} +cp -p cows/* $RPM_BUILD_ROOT%{_datadir}/%{name} +cp -p %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1 +cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} + +chmod +x $RPM_BUILD_ROOT%{_bindir}/animalsay +ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/cowthink +ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/cowthink.1 + +cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc ChangeLog LICENSE README +%{_bindir}/* +%{_mandir}/man1/cow* +%{_datadir}/%{name} +%{_sysconfdir}/bash_completion.d + +%changelog +* Tue Jan 02 2007 Michał Bentkowski - 3.03-2 +- Use cp -p to keep timestamps +- Fix paths in manpage +- Add animalsay + +* Sun Dec 31 2006 Michał Bentkowski - 3.03-1 +- Initial release diff --git a/sources b/sources index e69de29..085bb53 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b29169797359420dadb998079021a494 cowsay-3.03.tar.gz