2013-06-17 01:18:02 +02:00
|
|
|
#!/usr/bin/env sh
|
2012-08-20 21:35:20 +02:00
|
|
|
|
2013-07-01 09:44:22 +02:00
|
|
|
# Compatible with bash dash zsh mksh ksh ksh93
|
2017-07-19 09:14:20 +02:00
|
|
|
# but not with fish powershell
|
2013-01-24 03:36:20 +01:00
|
|
|
# problematic with tcsh csh
|
2017-07-19 09:14:20 +02:00
|
|
|
#
|
|
|
|
# Therefor to ensure it work always this shebang to standard POSIX shell
|
2012-10-29 23:02:31 +01:00
|
|
|
|
|
|
|
|
2012-10-29 22:28:21 +01:00
|
|
|
br=0 # build required
|
|
|
|
bs=0 # build recommended
|
|
|
|
bo=0 # build optional
|
|
|
|
rr=0 # runtime required
|
|
|
|
ro=0 # runtime optional
|
|
|
|
pv=0 # python version
|
|
|
|
|
2012-10-29 22:58:33 +01:00
|
|
|
|
2012-10-29 22:28:21 +01:00
|
|
|
(hash chmod 2>/dev/null) || (br=1 ; ro=1 ; echo 'Missing chmod, install coreutils [build+runtime required]')
|
|
|
|
|
|
|
|
(hash gzip 2>/dev/null) || (bo=1 ; echo 'Missing gzip, install gzip [build optional]')
|
|
|
|
(hash makeinfo 2>/dev/null) || (bo=1 ; echo 'Missing makeinfo, install texinfo [build optional]')
|
|
|
|
(hash install-info 2>/dev/null) || (bo=1 ; echo 'Missing install-info, install info [build optional]')
|
|
|
|
|
|
|
|
(hash python 2>/dev/null) || (br=1 ; rr=1 ; echo 'Missing python, install python>=3 [build+runtime required]')
|
2012-08-20 21:35:20 +02:00
|
|
|
|
|
|
|
(hash cut 2>/dev/null) && (hash python 2>/dev/null) &&
|
|
|
|
(test ! $(env python --version 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1) = 3) && (
|
2012-10-29 22:58:33 +01:00
|
|
|
(hash python3 2>/dev/null) ||
|
|
|
|
(br=1 ; rr=1 ; pv=1 ; echo 'Missing python>=3, install python (may be named python3) [build+runtime required]'))
|
2012-10-25 01:47:39 +02:00
|
|
|
|
2012-10-29 22:28:21 +01:00
|
|
|
(hash stty 2>/dev/null) || (rr=1 ; echo 'Missing stty, install coreutils [runtime required]')
|
2012-08-20 21:35:20 +02:00
|
|
|
|
2013-04-01 16:13:46 +02:00
|
|
|
(hash ponytool 2>/dev/null) || (ro=1 ; echo 'Missing ponytool, install util-say [runtime optional]')
|
|
|
|
(hash chmod 2>/dev/null) || (rr=1 ; echo 'Missing chmod, install coreutils [runtime optional]')
|
2012-08-20 21:35:20 +02:00
|
|
|
|
2012-10-29 22:28:21 +01:00
|
|
|
( (test $br = 1) || (test $rr = 1) || (test $ro = 1) || (test $pv = 1) ) && echo
|
2012-08-20 21:35:20 +02:00
|
|
|
|
|
|
|
(test $br = 1) && echo 'You will not be able to build and install ponysay.'
|
|
|
|
(test $rr = 1) && echo 'You will not be able to run ponysay.'
|
2012-10-29 22:28:21 +01:00
|
|
|
(test $pv = 1) && echo 'Unable to verify version of python.'
|
2012-08-20 21:35:20 +02:00
|
|
|
|
|
|
|
(test $br = 0) && (test $bs = 0) && (test $bo = 0) && (test $rr = 0) && (test $ro = 0) &&
|
|
|
|
echo && echo 'Everything appears to be in order, enjoy ponysay!'
|
|
|
|
|
|
|
|
echo
|
2012-10-29 22:58:33 +01:00
|
|
|
|