From 4d3416a492f7eb79b59e8ce31f3869aa52278d2a Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 14 Apr 2016 21:21:35 -0400 Subject: [PATCH] Add the iconic cowsay package (closes #191) --- packages/cowsay/build.sh | 12 +++++ packages/cowsay/install.sh.patch | 81 ++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 packages/cowsay/build.sh create mode 100644 packages/cowsay/install.sh.patch diff --git a/packages/cowsay/build.sh b/packages/cowsay/build.sh new file mode 100644 index 000000000..fa408dad1 --- /dev/null +++ b/packages/cowsay/build.sh @@ -0,0 +1,12 @@ +TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Cowsay +TERMUX_PKG_DESCRIPTION="Program which generates ASCII pictures of a cow with a message" +TERMUX_PKG_VERSION=3.03 +TERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/c/cowsay/cowsay_3.03+dfsg1.orig.tar.gz +TERMUX_PKG_FOLDERNAME=cowsay-3.03+dfsg1 +TERMUX_PKG_DEPENDS="perl" +TERMUX_PKG_PLATFORM_INDEPENDENT=yes + +termux_step_make_install () { + cd $TERMUX_PKG_SRCDIR + sh install.sh +} diff --git a/packages/cowsay/install.sh.patch b/packages/cowsay/install.sh.patch new file mode 100644 index 000000000..5adee6cd2 --- /dev/null +++ b/packages/cowsay/install.sh.patch @@ -0,0 +1,81 @@ +Only in .: install.pl +diff -u -r ../cowsay-3.03+dfsg1/install.sh ./install.sh +--- ../cowsay-3.03+dfsg1/install.sh 1999-11-01 15:19:21.000000000 -0500 ++++ ./install.sh 2016-04-14 21:14:44.715683710 -0400 +@@ -14,55 +14,8 @@ + + filelist='cows' + +-cat </dev/null 2>&1; then +- echo Found a good perl in $perl +- goodperls="$goodperls $perl" +- fi +-done +-echo The following perl executables will run cowsay: +-echo $goodperls +-echo I recommend the latest stable perl you can find. +-set $goodperls +-if [ -z "$1" ]; then +- echo Ack! You do not have Perl 5 installed correctly! +- echo Get thee to CPAN! +- exit 1 +-fi +-usethisperl=$1 +-echo I will be using $1 because I know it will work. +- +-echo Now I need an installation prefix. I will use /usr/local unless +-printf "you give me a better idea here: " +-if [ -n "$backdoor" ]; then +- prefix=$backdoor +- printf "%s (specified on command line)\n" $prefix +-else +- read prefix +-fi +- +-PREFIX=${prefix:-/usr/local} ++usethisperl=/data/data/com.termux/files/usr/bin/perl ++PREFIX=/data/data/com.termux/files/usr + + echo Okay, time to install this puppy. + +@@ -70,13 +23,13 @@ + echo s,%PREFIX%,$PREFIX,\; >> install.pl + set -x + mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin) +-$usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay ++perl -p install.pl cowsay > $PREFIX/bin/cowsay + chmod a+x $PREFIX/bin/cowsay + ln -s cowsay $PREFIX/bin/cowthink +-mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1) +-$usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1 +-chmod a+r $PREFIX/man/man1/cowsay.1 +-ln -s cowsay.1 $PREFIX/man/man1/cowthink.1 ++mkdir -p $PREFIX/share/man/man1 ++perl -p install.pl cowsay.1 > $PREFIX/share/man/man1/cowsay.1 ++chmod a+r $PREFIX/share/man/man1/cowsay.1 ++(cd $PREFIX/share/man/man1; ln -f -s cowsay.1 cowthink.1 ) + mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows) + tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -) + set +x