-
Notifications
You must be signed in to change notification settings - Fork 18
/
install_t1utils.sh
executable file
·47 lines (37 loc) · 1.45 KB
/
install_t1utils.sh
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
#!/bin/bash -e
# Installs the T1Utils suite for working with Adobe Type1 fonts.
# Requires autoconf and automake on macOS.
if cat /etc/*release | grep ^NAME | egrep 'CentOS|Red|Fedora'; then
echo "Installing t1utils with yum..."
sudo yum install -y t1utils
exit 0
elif cat /etc/*release | grep ^NAME | egrep 'Ubuntu|Debian|Mint|Knoppix'; then
echo "Installing t1utils with apt-get..."
sudo apt-get install -y t1utils
exit 0
elif ! echo `uname -a` | grep Darwin 2>&1 >/dev/null; then
echo "OS NOT DETECTED, couldn't install t1utils"
exit 1;
fi
echo "macOS detected, building t1utils from source..."
for required_build_tool in automake autoconf make; do
if ! which $required_build_tool >/dev/null; then
echo "Missing $required_build_tool. You may need to run something like 'brew install $required_build_tool'."
fi
done
SCRIPT_PATH=$(dirname -- "$(readlink -f -- "$0";)";)
source "$SCRIPT_PATH/lib/project_paths.sh"
TMP_DIR="$PDFALYZER_PROJECT_PATH/tmp"
mkdir -p "$TMP_DIR"
pushd "$TMP_DIR" >/dev/null
git clone https://github.com/kohler/t1utils.git
cd t1utils
command autoreconf -i
./configure
echo "Successfully configured, building with 'make'..."
make
echo "About to run 'make install' as sudo which will place binaries in /usr/local/bin. You will be asked for your password."
echo "For a different install location you'll need to manually intervene here."
sudo mkdir -p /usr/local/bin
sudo make install
popd >/dev/null