forked from pgroonga/pgroonga
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·66 lines (59 loc) · 1.89 KB
/
setup.sh
File metadata and controls
executable file
·66 lines (59 loc) · 1.89 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
#!/bin/bash
set -eux
source_dir="$(dirname "$0")"
if type sudo > /dev/null 2>&1; then
SUDO=sudo
else
SUDO=
fi
if [ -f /etc/debian_version ]; then
${SUDO} apt update
${SUDO} apt install -y -V lsb-release wget
fi
if type lsb_release > /dev/null 2>&1; then
distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
code_name=$(lsb_release --codename --short)
else
distribution=unknown
code_name=unknown
fi
case "${distribution}-${code_name}" in
debian-*|ubuntu-*)
wget https://packages.groonga.org/${distribution}/groonga-apt-source-latest-${code_name}.deb
${SUDO} apt install -y -V ./groonga-apt-source-latest-${code_name}.deb
;;
esac
case "${distribution}-${code_name}" in
debian-*|ubuntu-*)
${SUDO} apt install -y -V gpg
wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
${SUDO} gpg \
--no-default-keyring \
--keyring /usr/share/keyrings/pgdg.gpg \
--import -
(echo "Types: deb"; \
echo "URIs: http://apt.postgresql.org/pub/repos/apt"; \
echo "Suites: $(lsb_release --codename --short)-pgdg"; \
echo "Components: main"; \
echo "Signed-By: /usr/share/keyrings/pgdg.gpg") | \
${SUDO} tee /etc/apt/sources.list.d/pgdg.sources
${SUDO} apt update
latest_postgresql_version=$(cd "${source_dir}/packages" && \
echo postgresql-*-pgdg-pgroonga | \
grep -o '[0-9]*' | \
sort | \
tail -n 1)
${SUDO} apt install -y -V \
gcc \
groonga-token-filter-stem \
groonga-tokenizer-mecab \
libgroonga-dev \
libmsgpack-dev \
libxxhash-dev \
meson \
ninja-build \
postgresql-${latest_postgresql_version} \
postgresql-server-dev-${latest_postgresql_version} \
ruby
;;
esac