6 ## Installation script for cowsay.
8 ## $Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $
10 ## This file is part of cowsay. (c) 1999 Tony Monroe.
13 rcs_id
='$Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $'
22 Searching for useful perl executables...
27 pathdirs
=`echo $PATH | tr : " "`
28 for p
in $pathdirs; do
30 while [ ! -z "$1" ]; do
38 for perl
in $perls; do
39 if $perl -MText::Wrap
-e0 >/dev
/null
2>&1; then
40 echo Found a good perl
in $perl
41 goodperls
="$goodperls $perl"
44 echo The following perl executables will run cowsay
:
46 echo I recommend the latest stable perl you can
find.
49 echo Ack
! You
do not have Perl
5 installed correctly
!
50 echo Get thee to CPAN
!
54 echo I will be using
$1 because I know it will work.
56 echo Now I need an installation prefix. I will use
/usr
/local unless
57 printf "you give me a better idea here: "
58 if [ -n "$backdoor" ]; then
60 printf "%s (specified on command line)\n" $prefix
65 PREFIX
=${prefix:-/usr/local}
67 echo Okay
, time to
install this puppy.
69 echo s
,%BANGPERL
%,!$usethisperl,\
; > install.pl
70 echo s
,%PREFIX
%,$PREFIX,\
; >> install.pl
72 mkdir
-p $PREFIX/bin ||
(mkdir
$PREFIX; mkdir
$PREFIX/bin
)
73 $usethisperl -p install.pl cowsay
> $PREFIX/bin
/cowsay
74 chmod a
+x
$PREFIX/bin
/cowsay
75 ln -s cowsay
$PREFIX/bin
/cowthink
76 mkdir
-p $PREFIX/man
/man1 ||
($mkdir $PREFIX; mkdir
$PREFIX/man
; mkdir
$PREFIX/man
/man1
)
77 $usethisperl -p install.pl cowsay
.1 > $PREFIX/man
/man
1/cowsay
.1
78 chmod a
+r
$PREFIX/man
/man
1/cowsay
.1
79 ln -s cowsay
.1 $PREFIX/man
/man
1/cowthink
.1
80 mkdir
-p $PREFIX/share
/cows ||
(mkdir
$PREFIX; mkdir
$PREFIX/share
; mkdir
$PREFIX/share
/cows
)
81 tar -cf - $filelist |
(cd $PREFIX/share
&& tar -xvf -)
84 echo Okay
, let us see
if the
install actually worked.
86 if [ ! -f $PREFIX/share
/cows
/default.cow
]; then
87 echo The default cow
file did not
make it across
!
88 echo Ooops
, it failed...sorry
!
92 echo Installation complete
! Enjoy the cows
!