forked from jacobalberty/firebird-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·78 lines (73 loc) · 2.5 KB
/
build.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
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
#!/usr/bin/env bash
set -e
CPUC=$(getconf _NPROCESSORS_ONLN)
apt-get update
apt-get install -qy --no-install-recommends \
libicu67 \
libncurses6 \
libtommath1 \
netbase \
procps
apt-get install -qy --no-install-recommends \
bzip2 \
ca-certificates \
curl \
file \
g++ \
gcc \
libicu-dev \
libncurses-dev \
libtommath-dev \
make \
zlib1g-dev
if [ -d "/home/pre_build/$(dpkg --print-architecture)" ]; then
find "/home/pre_build/$(dpkg --print-architecture)" -type f -exec '{}' \;
fi
if [ -d "/home/pre_build/all" ]; then
find "/home/pre_build/all" -type f -exec '{}' \;
fi
mkdir -p /home/firebird
cd /home/firebird
curl -L -o firebird-source.tar.bz2 -L \
"${FBURL}"
tar --strip=1 -xf firebird-source.tar.bz2
./configure \
--prefix="${PREFIX}"/ --with-fbbin="${PREFIX}"/bin/ --with-fbsbin="${PREFIX}"/bin/ --with-fblib="${PREFIX}"/lib/ \
--with-fbinclude="${PREFIX}"/include/ --with-fbdoc="${PREFIX}"/doc/ --with-fbudf="${PREFIX}"/UDF/ \
--with-fbsample="${PREFIX}"/examples/ --with-fbsample-db="${PREFIX}"/examples/empbuild/ --with-fbhelp="${PREFIX}"/help/ \
--with-fbintl="${PREFIX}"/intl/ --with-fbmisc="${PREFIX}"/misc/ --with-fbplugins="${PREFIX}"/ \
--with-fbconf="${VOLUME}/etc/" --with-fbmsg="${PREFIX}"/ \
--with-fblog="${VOLUME}/log/" --with-fbglock=/var/firebird/run/ \
--with-fbsecure-db="${VOLUME}/system"
make -j"${CPUC}"
make silent_install
cd /
rm -rf /home/firebird
if [ -d "/home/post_build/$(dpkg --print-architecture)" ]; then
find "/home/post_build/$(dpkg --print-architecture)" -type f -exec '{}' \;
fi
if [ -d "/home/post_build/all" ]; then
find "/home/post_build/all" -type f -exec '{}' \;
fi
find "${PREFIX}" -name .debug -prune -exec rm -rf {} \;
apt-get purge -qy --auto-remove \
bzip2 \
ca-certificates \
curl \
file \
g++ \
gcc \
libicu-dev \
libncurses-dev \
libtommath-dev \
make \
zlib1g-dev
rm -rf /var/lib/apt/lists/*
mkdir -p "${PREFIX}/skel/"
# This allows us to initialize a random value for sysdba password
mv "${VOLUME}/system/security3.fdb" "${PREFIX}/skel/security3.fdb"
# Cleaning up to restrict access to specific path and allow changing that path easily to
# something standard. See github issue https://github.com/jacobalberty/firebird-docker/issues/12
sed -i 's/^#DatabaseAccess/DatabaseAccess/g' "${VOLUME}/etc/firebird.conf"
sed -i "s~^\(DatabaseAccess\s*=\s*\).*$~\1Restrict ${DBPATH}~" "${VOLUME}/etc/firebird.conf"
mv "${VOLUME}/etc" "${PREFIX}/skel"