From 81aabda6adb8c01fbb849880714489f94c38ce83 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Feb 21 2015 23:07:42 +0000 Subject: include unicode and formatting fixes from Debian --- diff --git a/cowsay-3.03-debian-01-empty_messages_fix.patch b/cowsay-3.03-debian-01-empty_messages_fix.patch new file mode 100644 index 0000000..bb2ea7a --- /dev/null +++ b/cowsay-3.03-debian-01-empty_messages_fix.patch @@ -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 + +--- 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; + } + diff --git a/cowsay-3.03-debian-02-remove_trailing_spaces.patch b/cowsay-3.03-debian-02-remove_trailing_spaces.patch new file mode 100644 index 0000000..496439b --- /dev/null +++ b/cowsay-3.03-debian-02-remove_trailing_spaces.patch @@ -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 + +--- 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" + ); + } + diff --git a/cowsay-3.03-debian-utf8_width.patch b/cowsay-3.03-debian-utf8_width.patch new file mode 100644 index 0000000..0c3f86e --- /dev/null +++ b/cowsay-3.03-debian-utf8_width.patch @@ -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 + +--- 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"; diff --git a/cowsay.spec b/cowsay.spec index c9b9148..bca9bdd 100644 --- a/cowsay.spec +++ b/cowsay.spec @@ -1,7 +1,7 @@ %define compdir %(pkg-config --variable=completionsdir bash-completion) Name: cowsay Version: 3.03 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Configurable speaking/thinking cow Group: Amusements/Games License: GPLv2+ or Artistic @@ -11,6 +11,11 @@ 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 @@ -34,6 +39,10 @@ pictures of other animals. 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 @@ -61,6 +70,9 @@ cp %{SOURCE1} $RPM_BUILD_ROOT%{compdir}/ %changelog +* Fri Feb 20 2015 Matthew Miller - 3.03-17 +- include unicode and formatting fixes from Debian + * Fri Sep 26 2014 Rahul Sundaram - 3.03-16 - fix location of bash completion script - don't own /etc/bash_completion.d/