Compare commits

..

No commits in common. "rawhide" and "f33" have entirely different histories.

11 changed files with 208 additions and 134 deletions

5
.gitignore vendored
View file

@ -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

4
animalsay Executable file → Normal file
View file

@ -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

View file

@ -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;
}

View file

@ -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"
);
}

View file

@ -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
cowsay-3.03-help.patch Normal file
View file

@ -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;
+}

View file

@ -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])

View file

@ -1,156 +1,84 @@
%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: 16%{?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
# More cows:
Patch5: fox-cow.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
%patch5 -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 <releng@fedoraproject.org> - 3.8.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Mon Dec 02 2024 Gwyn Ciesla <gwync@protonmail.com> - 3.8.4-1
- 3.8.4
* Thu Aug 22 2024 Gwyn Ciesla <gwync@protonmail.com> - 3.8.3-1
- 3.8.3
* Tue Aug 20 2024 Gwyn Ciesla <gwync@protonmail.com> - 3.8.2-1
- 3.8.2
* Thu Aug 8 2024 Hans Ulrich Niedermann <hun@n-dimensional.de> - 3.8.1-2
- Install CHANGELOG.md doc file
* Thu Aug 08 2024 Gwyn Ciesla <gwync@protonmail.com> - 3.8.1-1
- 3.8.1
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Mon Mar 18 2024 Gwyn Ciesla <gwync@protonmail.com> - 3.7.0-13
- BR fix for bash-completion
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jan 18 2024 Perry Myers <pmyers@redhat.com> - 3.7.0-10
- Remove some additional tasteless content missed before
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Feb 28 2023 Gwyn Ciesla <gwync@protonmail.com> - 3.7.0-8
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Aug 22 2022 Hans Ulrich Niedermann <hun@n-dimensional.de> - 3.7.0-6
- ship /etc/cowsay/cowpath.d directory
* Mon Aug 15 2022 Hans Ulrich Niedermann <hun@n-dimensional.de> - 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 <hun@n-dimensional.de> - 3.7.0-4
- Stop packaging cows in the unsupported *.pm format
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Aug 13 2021 Gwyn Ciesla <gwync@protonmail.com> - 3.7.0-1
- 3.7.0i, new upstream.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.04-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 19 2020 Filipe Brandenburger <filbranden@gmail.com> - 3.04-16
- Add fox cow.

24
fox-cow.patch Normal file
View file

@ -0,0 +1,24 @@
Description: Add a fox cow
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888229#5
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888229
--- /dev/null
+++ b/cows/fox.cow
@@ -0,0 +1,18 @@
+$the_cow = <<EOC;
+ $thoughts ,-. .-,
+ $thoughts |-.\\ __ /.-|
+ $thoughts \\ ` ` /
+ /_ _ \\
+ < _`q p _ >
+ <.._=/ \\=_. >
+ {`\\()/`}`\\
+ { } \\
+ |{ } \\
+ \\ '--' .- \\
+ |- / \\
+ | | | | | ;
+ | | |.;.,..__ |
+ .-"";` `|
+ / | /
+ `-../____,..---'`
+EOC

45
mech-and-cow.patch Normal file
View file

@ -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

View file

@ -1 +1 @@
SHA512 (cowsay-3.8.4.tar.gz) = 58e6a28e3205a3dd50c899c207b58592c43f8485dc44d3dc8de41bc480ec6d7e5a14e74769c8bb983d401004dce99f040c7a095839056861b7aa6aae71e08bb7
SHA512 (cowsay-3.04.tar.gz) = 99d21ef9a7c7c76056cb7acb2c771fbdabfedde4f6edb5d3035337c59f9e88944690d1b43282c32827ad79339199716366c8be73b0dea09063ec2d52220c1b51