Browse Source

cowsay package updated

Signed-off-by: tuibuilder_pel7x64builder0 <tuibuilder@powerel.org>
master
tuibuilder_pel7x64builder0 6 years ago
parent
commit
e71066ee12
  1. 16
      SOURCES/animalsay
  2. 19
      SOURCES/cowsay-3.03-debian-01-empty_messages_fix.patch
  3. 28
      SOURCES/cowsay-3.03-debian-02-remove_trailing_spaces.patch
  4. 24
      SOURCES/cowsay-3.03-debian-utf8_width.patch
  5. 11
      SOURCES/cowsay-3.03-help.patch
  6. 45
      SOURCES/mech-and-cow.patch
  7. 154
      SPECS/cowsay.spec

16
SOURCES/animalsay

@ -0,0 +1,16 @@ @@ -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 "$@"

19
SOURCES/cowsay-3.03-debian-01-empty_messages_fix.patch

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
Description: Work-around for broken baloons with empty messages
Forwarded: no
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165218#5
Bug-Debian: http://bugs.debian.org/165218
Author: Jeronimo Pellegrini <pellegrini@mpcnet.com.br>

--- cowsay-3.03.orig/cowsay
+++ cowsay-3.03/cowsay
@@ -106,6 +106,10 @@ sub maxlength {
$l = length $i;
$m = $l if ($l > $m);
}
+## maxlength patch from Jeronimo Pellegrini (Closes: #165218)
+ if ($m == -1) {
+ $m = 0;
+ }
return $m;
}

28
SOURCES/cowsay-3.03-debian-02-remove_trailing_spaces.patch

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
Description: Removing trailing spaces
This is mainly to work-around broken word-wrapping by mail clients.
Forwarded: no
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276144#42
Bug-Debian: http://bugs.debian.org/276144
Author: Florian Ernst <florian@uni-hd.de>

--- cowsay-3.03.orig/cowsay
+++ cowsay-3.03/cowsay
@@ -128,15 +132,16 @@ sub construct_balloon {
@border = qw[ / \ \ / | | ];
}
}
+## no trailing spaces (#276144)
push(@balloon_lines,
- " " . ("_" x $max2) . " \n" ,
+ " " . ("_" x $max2) . "\n" ,
sprintf($format, $border[0], $message[0], $border[1]),
(@message < 2 ? "" :
map { sprintf($format, $border[4], $_, $border[5]) }
@message[1 .. $#message - 1]),
(@message < 2 ? "" :
sprintf($format, $border[2], $message[$#message], $border[3])),
- " " . ("-" x $max2) . " \n"
+ " " . ("-" x $max2) . "\n"
);
}

24
SOURCES/cowsay-3.03-debian-utf8_width.patch

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
Description: utf8 support in input, output and arguments on utf8-enabled locales
Note that this is not a complete solution (doesn't support Chinese/Japanese
characters for example) but it's better than what we had.
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=254557#27
Bug-Debian: http://bugs.debian.org/254557
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cowsay/+bug/393212
Author: Damyan Ivanov <dmn@debian.org>

--- a/cowsay
+++ b/cowsay
@@ -12,6 +12,13 @@ use File::Basename;
use Getopt::Std;
use Cwd;
+if (${^UTF8LOCALE}) {
+ binmode STDIN, ':utf8';
+ binmode STDOUT, ':utf8';
+ require Encode;
+ eval { $_ = Encode::decode_utf8($_,1) } for @ARGV;
+}
+
$version = "3.03";
$progname = basename($0);
$eyes = "oo";

11
SOURCES/cowsay-3.03-help.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
diff -rup cowsay-3.03.orig/cowsay cowsay-3.03/cowsay
--- cowsay-3.03.orig/cowsay 2007-09-17 13:27:32.000000000 +0200
+++ cowsay-3.03/cowsay 2007-09-17 13:28:04.000000000 +0200
@@ -185,3 +185,7 @@ Usage: $progname [-bdgpstwy] [-h] [-e ey
[-l] [-n] [-T tongue] [-W wrapcolumn] [message]
EOF
}
+
+sub main::HELP_MESSAGE {
+ display_usage;
+}

45
SOURCES/mech-and-cow.patch

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
--- cowsay/cows/mech-and-cow.cow 2007-10-07 12:17:44.000000000 +0200
+++ cowsay/cows/mech-and-cow.cow.new 2007-10-07 12:17:54.000000000 +0200
@@ -1,21 +1,22 @@
- ,-----.
- | |
- ,--| |-.
- __,----| | | |
- ,;:: | `_____' |
- `._______| i^i |
- `----| |---'| .
- ,-------._| |== ||//
- | |_|P`. /'/
- `-------' 'Y Y/'/'
- .==\ /_\
+$sthguoht = $thoughts;
+if ( $thoughts eq "\\" ) {
+ $sthguoht = "/";
+}
+$the_cow = <<"EOC";
+ $thoughts ,-----.
+ $sthguoht | |
+ $thoughts ,--| |-.
+ $sthguoht __,----| | | |
+ $thoughts ,;:: | `_____' |
+ $sthguoht `._______| i^i |
+ $thoughts `----| |---'| .
+ $sthguoht ,-------._| |== ||//
+ $thoughts | |_|P`. /'/
+ $sthguoht `-------' 'Y Y/'/'
+ $thoughts .==\ /_\
^__^ / /'| `i
- (oo)\_______ /' / | |
- (__)\ )\/\ /' / | `i
- ||----w | ___,;`----'.___L_,-'`\__
- || || i_____;----\.____i""\____\
-
-
-
-
-
+ ($eyes)\_______ /' / | |
+ (__)\ )\\/\\ /' / | `i
+ $tongue||----w|| ___,;`----'.___L_,-'`\__
+ || || i_____;----\.____i""\____\
+EOC

154
SPECS/cowsay.spec

@ -0,0 +1,154 @@ @@ -0,0 +1,154 @@
%global compdir %(pkg-config --variable=completionsdir bash-completion)
%global __requires_exclude .*Acme::Cow.*

Name: cowsay
Version: 3.04
Release: 4%{?dist}
Summary: Configurable speaking/thinking cow
Group: Amusements/Games
License: GPLv3+
URL: https://github.com/tnalpgge/rank-amateur-cowsay
Source0: %{url}/archive/%{name}-%{version}.tar.gz
Source1: cowsay.bashcomp
Source2: animalsay
Patch0: cowsay-3.03-help.patch
Patch1: mech-and-cow.patch
# these are from https://packages.debian.org/sid/cowsay
Patch2: cowsay-3.03-debian-01-empty_messages_fix.patch
Patch3: cowsay-3.03-debian-02-remove_trailing_spaces.patch
Patch4: cowsay-3.03-debian-utf8_width.patch

BuildArch: noarch
BuildRequires: bash-completion
#BuildRequires: perl-generators
Requires: perl-Encode

%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 -qn rank-amateur-cowsay-cowsay-%{version}
%patch0 -p1 -b .help
%{__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

mv cows/mech-and-cow cows/mech-and-cow.cow
%patch1 -p1

%patch2 -p1
%patch3 -p1
%patch4 -p1

%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}

# License issue
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/daemon.cow

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
mkdir -p $RPM_BUILD_ROOT%{compdir}/
cp %{SOURCE1} $RPM_BUILD_ROOT%{compdir}/

%files
%doc ChangeLog LICENSE README
%{_bindir}/*
%{_mandir}/man1/cow*
%{_datadir}/%{name}
%(dirname %{compdir})


%changelog
* Mon Jan 09 2017 Jon Ciesla <limburgher@gmail.com> - 3.04-4
- Require perl-Encode, BZ 1411168.

* Mon Dec 19 2016 Jon Ciesla <limburgher@gmail.com> - 3.04-3
- Fix license tag, BZ 1350114.

* Wed Dec 14 2016 Jon Ciesla <limburgher@gmail.com> - 3.04-2
- Drop bogus Acme::Cow requirement, BZ 1404804.

* Mon Dec 12 2016 Jon Ciesla <limburgher@gmail.com> - 3.04-1
- 3.04, new upstream location, BZ 1403460.

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.03-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Jan 17 2016 Hans Ulrich Niedermann <hun@n-dimensional.de> - 3.03-19
- replace %%define by %%global
- avoid license issue with daemon.cow by not shipping it in RPM

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Feb 20 2015 Matthew Miller <mattdm@fedoraproject.org> - 3.03-17
- include unicode and formatting fixes from Debian

* Fri Sep 26 2014 Rahul Sundaram <sundaram@fedoraproject.org> - 3.03-16
- fix location of bash completion script
- don't own /etc/bash_completion.d/
- drop redundant buildroot, defattr and clean

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 3.03-13
- Perl 5.18 rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.03-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jul 15 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 3.03-6
- fix license tag to prevent false positive

* Fri May 23 2008 Jon Stanley <jonstanley@gmail.com> - 3.03-5
- Fix license tag

* Tue Oct 09 2007 Michał Bentkowski <mr.ecik at gmail.com> - 3.03-4
- Fix mech-and-cow file (#250844)

* Mon Sep 17 2007 Lubomir Kundrak <lkundrak@redhat.com> - 3.03-3
- Make --help be a bit more sane (#293061)

* Tue Jan 02 2007 Michał Bentkowski <mr.ecik at gmail.com> - 3.03-2
- Use cp -p to keep timestamps
- Fix paths in manpage
- Add animalsay

* Sun Dec 31 2006 Michał Bentkowski <mr.ecik at gmail.com> - 3.03-1
- Initial release
Loading…
Cancel
Save