-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·69 lines (59 loc) · 1.89 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
#!/bin/bash
set -e
# Bash 4 is required for associative arrays.
if [ "${BASH_VERSINFO[0]}" -lt 4 ]
then
>&2 echo 'Bash 4+ is required by this script!'
exit 1
fi
# The INSPIRCD_VERSION variable must be set.
if [ -z "${INSPIRCD_VERSION}" ]
then
>&2 echo 'You must set the INSPIRCD_VERSION environment variable!'
exit 1
fi
# The INSPIRCD_REVISION variable may be set.
if [ -z "${INSPIRCD_REVISION}" ]
then
echo 'INSPIRCD_REVISION is not set; defaulting to 1.'
INSPIRCD_REVISION='1'
fi
# The INSPIRCD_REPOSITORY variable may be set.
if [ -z "${INSPIRCD_REPOSITORY}" ]
then
INSPIRCD_REPOSITORY='inspircd/inspircd'
fi
# The INSPIRCD_PACKAGES variable may be set.
if [ -z "${INSPIRCD_PACKAGES}" ]
then
echo "INSPIRCD_PACKAGES is not set; enabling all packages."
INSPIRCD_PACKAGES_DEFAULT='1'
INSPIRCD_PACKAGES='deb rpm html'
fi
# The INSPIRCD_MODULES variable may be set.
INSPIRCD_MODULES_DEFAULT=''
if [ -z "${INSPIRCD_MODULES}" ]
then
echo "INSPIRCD_MODULES is not set; enabling all modules."
INSPIRCD_MODULES_DEFAULT='1'
INSPIRCD_MODULES='argon2 geo_maxmind ldap log_json log_syslog mysql pgsql regex_pcre2 regex_posix regex_re2 sqlite3 ssl_gnutls ssl_openssl sslrehashsignal'
fi
# Modules which should not be packaged.
declare -Ax INSPIRCD_MODULE_WARNINGS=(
["geo_maxmind"]="libmaxminddb's license (Apache 2.0) is not compatible with InspIRCd's (GPLv2)"
["ssl_openssl"]="OpenSSL's license (custom) is not compatible with InspIRCd's (GPLv2)"
)
# The directory the current script is in.
export INSPIRCD_ROOT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
# The directory that packages are built in.
export INSPIRCD_BUILD_DIR="${INSPIRCD_ROOT_DIR}/build"
rm -fr ${INSPIRCD_BUILD_DIR}
mkdir -p ${INSPIRCD_BUILD_DIR}
# Build the packages.
for INSPIRCD_PACKAGE in ${INSPIRCD_PACKAGES}
do
if [ -d "${INSPIRCD_ROOT_DIR}/${INSPIRCD_PACKAGE}" ]
then
source "${INSPIRCD_ROOT_DIR}/${INSPIRCD_PACKAGE}/host.sh"
fi
done