-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·95 lines (81 loc) · 2.7 KB
/
configure
File metadata and controls
executable file
·95 lines (81 loc) · 2.7 KB
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
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
## DocPatch -- patching documents that matter
## Copyright (C) 2012-18 Benjamin Heisig <https://benjamin.heisig.name/>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
## configure script
## TODO This is only a quick'n'dirty version.
##
echo "Check system configuration for docpatch..."
makefile="Makefile"
function check_availability {
echo -n "Check ${1}... "
path_to_exe=$(which $1)
if [ $? -gt 0 ]; then
echo "[FAILED]"
VAR=`echo "${1}" | tr 'a-z' 'A-Z'`
echo " Could not find a «$1» program."
echo " If you are sure you have it, please adjust the $VAR variable in Makefile."
echo " Otherwise, please install $1."
adjust="PLEASE"
# abort 1
fi
echo "[DONE]"
}
function abort {
echo "Failed to configure system."
exit $1
}
## version control
check_availability "git"
check_availability "gpg"
check_availability "quilt"
## rendering
check_availability "pandoc"
## *N*X tools
check_availability "awk"
check_availability "basename"
check_availability "cat"
check_availability "cp"
check_availability "date"
check_availability "echo"
check_availability "getopt"
getopt_version="`getopt --version`"
if [[ "$getopt_version" != *enhanced* ]] && [[ "$getopt_version" != *util-linux* ]] ; then
echo " WARNING: We need a modern version of getopt, as provided on most"
echo " versions of Linux."
echo " It is available at"
echo " http://software.frodo.looijaard.name/getopt/download.php"
echo " It is also available e.g. as a port in MacPorts or FreeBSD."
echo " Such a version may be installed with a different name than"
echo " 'getopt', in which case you have to adjust the Makefile."
echo
fi
check_availability "grep"
check_availability "gzip"
check_availability "head"
check_availability "man"
check_availability "pwd"
check_availability "renice"
check_availability "rm"
check_availability "sed"
check_availability "wc"
echo
if [ -z $adjust ] ; then
echo "Everything available. You can continue with 'make'."
else
echo "Please adjust the Makefile as indicated or install the missing dependencies"
echo "before continuing with 'make'."
fi