summaryrefslogtreecommitdiff
path: root/data/cowsay/install.diff
blob: 6e709280aff5f340cb8f7379edba3193292eeddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff -ur rank-amateur-cowsay-cowsay-3.04/install.sh rank-amateur-cowsay-cowsay-3.04+iPhone/install.sh
--- rank-amateur-cowsay-cowsay-3.04/install.sh	2016-06-25 02:45:15.000000000 +0000
+++ rank-amateur-cowsay-cowsay-3.04+iPhone/install.sh	2019-05-13 18:42:49.989430244 +0000
@@ -22,68 +22,32 @@
 Searching for useful perl executables...
 DOG
 
-backdoor=$1
-
-pathdirs=`echo $PATH | tr : " "`
-for p in $pathdirs; do
-	set $p/perl $p/perl5*
-	while [ ! -z "$1" ]; do
-		if [ -x "$1" ]; then
-			echo Found perl in $1
-			perls="$perls $1"
-		fi
-		shift
-	done
-done
-for perl in $perls; do
-	if $perl -MText::Wrap -e0 >/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}
+PREFIX=${PREFIX:-/usr/local}
 
 echo Okay, time to install this puppy.
 
 echo s,%BANGPERL%,!$usethisperl,\; > install.pl
 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
-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/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows)
-tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -)
+mkdir -p ${DESTDIR}$PREFIX/bin || (mkdir ${DESTDIR}$PREFIX; mkdir ${DESTDIR}$PREFIX/bin)
+perl -p install.pl cowsay > ${DESTDIR}$PREFIX/bin/cowsay
+chmod a+x ${DESTDIR}$PREFIX/bin/cowsay
+ln -s cowsay ${DESTDIR}$PREFIX/bin/cowthink
+mkdir -p ${DESTDIR}$PREFIX/man/man1 || ($mkdir ${DESTDIR}$PREFIX; mkdir ${DESTDIR}$PREFIX/man; mkdir ${DESTDIR}$PREFIX/man/man1)
+perl -p install.pl cowsay.1 > ${DESTDIR}$PREFIX/man/man1/cowsay.1
+chmod a+r ${DESTDIR}$PREFIX/man/man1/cowsay.1
+ln -s cowsay.1 ${DESTDIR}$PREFIX/man/man1/cowthink.1
+mkdir -p ${DESTDIR}$PREFIX/share/cows || (mkdir ${DESTDIR}$PREFIX; mkdir ${DESTDIR}$PREFIX/share; mkdir ${DESTDIR}$PREFIX/share/cows)
+tar -cf - $filelist | (cd ${DESTDIR}$PREFIX/share && tar -xvf -)
 set +x
 
 echo Okay, let us see if the install actually worked.
 
-if [ ! -f $PREFIX/share/cows/default.cow ]; then
+if [ ! -f ${DESTDIR}$PREFIX/share/cows/default.cow ]; then
     echo The default cow file did not make it across!
     echo Ooops, it failed...sorry!
     exit 1