diff --git a/.gitignore b/.gitignore index 6f3c533..5016d90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,2 @@ cowsay-3.03.tar.gz /cowsay-3.04.tar.gz -/cowsay-3.7.0.tar.gz -/cowsay-3.8.1.tar.gz -/cowsay-3.8.2.tar.gz -/cowsay-3.8.3.tar.gz -/cowsay-3.8.4.tar.gz diff --git a/animalsay b/animalsay old mode 100755 new mode 100644 index b717763..77c3461 --- a/animalsay +++ b/animalsay @@ -2,13 +2,13 @@ NUM=0 TOL=0 -for cow in /usr/share/cowsay/cows/*.cow ; do +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/cows/*.cow ; do +for cow in /usr/share/cowsay/*.cow ; do NUM=$((NUM+1)) if [ $NUM = $SELECT ] ; then break ; fi done 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-3.03-help.patch b/cowsay-3.03-help.patch new file mode 100644 index 0000000..1fc4b4a --- /dev/null +++ b/cowsay-3.03-help.patch @@ -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; ++} diff --git a/cowsay.bashcomp b/cowsay.bashcomp index bc341c8..77d8be9 100644 --- a/cowsay.bashcomp +++ b/cowsay.bashcomp @@ -20,8 +20,8 @@ _cowsay() { case "${prev}" in -f) - COMPREPLY=( $( command ls /usr/share/cowsay/cows| \ - sed -ne 's|^\('$cur'.*\)\.cow$|\1|p') ) + COMPREPLY=( $( command ls /usr/share/cowsay| \ + sed -ne 's/^\('$cur'.*\)\.cow$/\1/p') ) return 0 ;; -[eTW]) diff --git a/cowsay.spec b/cowsay.spec index 53c8eb6..e3dedfb 100644 --- a/cowsay.spec +++ b/cowsay.spec @@ -1,171 +1,80 @@ %global compdir %(pkg-config --variable=completionsdir bash-completion) %global __requires_exclude .*Acme::Cow.* -%global cowsdir %{_datadir}/%{name}/cows -%global sitecowsdir %{_datadir}/%{name}/site-cows - Name: cowsay -Version: 3.8.4 -Release: 3%{?dist} +Version: 3.04 +Release: 11%{?dist} Summary: Configurable speaking/thinking cow -License: GPL-2.0-or-later -URL: https://github.com/cowsay-org/cowsay -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +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: pkgconfig(bash-completion) +BuildRequires: bash-completion BuildRequires: perl-generators -Requires: perl-Encode -# introduced /usr/share/bash-completion/... -Requires: filesystem >= 3.6-1 +Requires: perl-Encode %description cowsay is a configurable talking cow, written in Perl. It operates -much as the figlet program does, and it is written in the same spirit +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 +%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 -# At least for cowsay-3.7.0, replace upstream's "make install" by our -# own installation code. -install -d -m 0755 $RPM_BUILD_ROOT%{_bindir} -install -p -m 0755 bin/%{name} $RPM_BUILD_ROOT%{_bindir} -ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/cowthink - -install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man1 -install -p -m 0644 man/man1/%{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1 -ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/cowthink.1 - -install -d -m 0755 $RPM_BUILD_ROOT%{cowsdir} -install -p -m 0644 share/cowsay/cows/* $RPM_BUILD_ROOT%{cowsdir} - -install -d -m 0755 $RPM_BUILD_ROOT%{sitecowsdir} - -install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cowpath.d - -# Install actions specific to the Fedora package +# 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}/cows/daemon.cow -# animalsay -install -p -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir} -# bash completion file -install -d -m 0755 $RPM_BUILD_ROOT%{compdir} -install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{compdir}/%{name} +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.md LICENSE.txt README README.md -%dir %{_sysconfdir}/%{name} -%dir %{_sysconfdir}/%{name}/cowpath.d -%{_bindir}/animalsay -%{_bindir}/cowsay -%{_bindir}/cowthink -%{_mandir}/man1/cowsay.1* -%{_mandir}/man1/cowthink.1* -%dir %{_datadir}/%{name} -%{cowsdir} -%exclude %{cowsdir}/bong.cow -%exclude %{cowsdir}/head-in.cow -%exclude %{cowsdir}/mutilated.cow -%dir %{sitecowsdir} -%{compdir}/%{name} +%doc ChangeLog LICENSE README +%{_bindir}/* +%{_mandir}/man1/cow* +%{_datadir}/%{name} +%exclude %{_datadir}/cowsay/bong.cow +%exclude %{_datadir}/cowsay/sodomized.cow +%exclude %{_datadir}/cowsay/satanic.cow +%(dirname %{compdir}) %changelog -* Wed Jul 23 2025 Fedora Release Engineering - 3.8.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Thu Jan 16 2025 Fedora Release Engineering - 3.8.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Mon Dec 02 2024 Gwyn Ciesla - 3.8.4-1 -- 3.8.4 - -* Thu Aug 22 2024 Gwyn Ciesla - 3.8.3-1 -- 3.8.3 - -* Tue Aug 20 2024 Gwyn Ciesla - 3.8.2-1 -- 3.8.2 - -* Thu Aug 8 2024 Hans Ulrich Niedermann - 3.8.1-2 -- Install CHANGELOG.md doc file - -* Thu Aug 08 2024 Gwyn Ciesla - 3.8.1-1 -- 3.8.1 - -* Wed Jul 17 2024 Fedora Release Engineering - 3.7.0-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Mon Mar 18 2024 Gwyn Ciesla - 3.7.0-13 -- BR fix for bash-completion - -* Wed Jan 24 2024 Fedora Release Engineering - 3.7.0-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 3.7.0-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Thu Jan 18 2024 Perry Myers - 3.7.0-10 -- Remove some additional tasteless content missed before - -* Wed Jul 19 2023 Fedora Release Engineering - 3.7.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Feb 28 2023 Gwyn Ciesla - 3.7.0-8 -- migrated to SPDX license - -* Thu Jan 19 2023 Fedora Release Engineering - 3.7.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Mon Aug 22 2022 Hans Ulrich Niedermann - 3.7.0-6 -- ship /etc/cowsay/cowpath.d directory - -* Mon Aug 15 2022 Hans Ulrich Niedermann - 3.7.0-5 -- Ensure /usr/bin/animalsay file mode is 0755 -- Use "install" command for installing dirs and files -- Change name of bash completion file to just "cowsay" -- Define and use macro for cows directory -- Install empty site-cows directory for site specific cows -- Fix bash completion to look in actual cows/ directory - -* Wed Aug 10 2022 Hans Ulrich Niedermann - 3.7.0-4 -- Stop packaging cows in the unsupported *.pm format - -* Wed Jul 20 2022 Fedora Release Engineering - 3.7.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Wed Jan 19 2022 Fedora Release Engineering - 3.7.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Aug 13 2021 Gwyn Ciesla - 3.7.0-1 -- 3.7.0i, new upstream. - -* Tue Jan 26 2021 Fedora Release Engineering - 3.04-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Thu Nov 19 2020 Filipe Brandenburger - 3.04-16 -- Add fox cow. - -* Mon Jul 27 2020 Fedora Release Engineering - 3.04-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jan 28 2020 Fedora Release Engineering - 3.04-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Wed Jul 24 2019 Fedora Release Engineering - 3.04-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Thu Jan 31 2019 Fedora Release Engineering - 3.04-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - * Thu Jul 12 2018 Fedora Release Engineering - 3.04-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/mech-and-cow.patch b/mech-and-cow.patch new file mode 100644 index 0000000..c8e97b2 --- /dev/null +++ b/mech-and-cow.patch @@ -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 diff --git a/sources b/sources index aa7d49c..2aec0b5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cowsay-3.8.4.tar.gz) = 58e6a28e3205a3dd50c899c207b58592c43f8485dc44d3dc8de41bc480ec6d7e5a14e74769c8bb983d401004dce99f040c7a095839056861b7aa6aae71e08bb7 +SHA512 (cowsay-3.04.tar.gz) = 99d21ef9a7c7c76056cb7acb2c771fbdabfedde4f6edb5d3035337c59f9e88944690d1b43282c32827ad79339199716366c8be73b0dea09063ec2d52220c1b51