-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·53 lines (40 loc) · 857 Bytes
/
configure
File metadata and controls
executable file
·53 lines (40 loc) · 857 Bytes
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
#!/bin/bash
#set -o nounset
set -o errexit
#
#----Default settings
#
readonly DEFAULT_BIN_PATH="/"
readonly DEFAULT_MAN_PATH="/usr/share/man/"
#
#----Functions
#
function usage() {
echo "$0 [-b <bin_path>] [-m <man_path>]"
echo " e.g., $0 -b /opt -m /usr/share/man"
echo " The binary would be installed in /opt/bin,"
echo " the man page would be installed in /usr/share/man/man1"
}
#
#----Execution
#
while getopts "b:m:" option; do
case "${option}"
in
b) BIN_PATH=${OPTARG};;
m) MAN_PATH=${OPTARG};;
*)
usage
exit 1
;;
esac
done
if [ "x${BIN_PATH}" == "x" ]; then
readonly BIN_PATH="$DEFAULT_BIN_PATH"
fi
if [ "x${MAN_PATH}" == "x" ]; then
readonly MAN_PATH="$DEFAULT_MAN_PATH"
fi
\cp Makefile.template Makefile
\perl -i -pe s:BIN_PATH_VAL:"$BIN_PATH":g Makefile
\perl -i -pe s:MAN_PATH_VAL:"$MAN_PATH":g Makefile