-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanope-install.sh
53 lines (44 loc) · 1.26 KB
/
anope-install.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
#!/bin/bash
set -e
set -x
BASE_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
add_snoonet_module() {
ln -s "$PWD/anope-modules-master/modules/$1" "$PWD/modules/third/$1"
}
add_vendor_extra() {
pushd "$PWD/modules" || exit 1
ln -s "extra/$1" "$1"
popd || exit 1
}
install_extras() {
add_snoonet_module 'hs_reghost.cpp'
add_snoonet_module 'os_server_news.cpp'
add_snoonet_module 'm_store_server.cpp'
add_snoonet_module 'm_eventlog.cpp'
add_snoonet_module 'json_api.h'
add_snoonet_module 'mail_template.h'
add_snoonet_module 'snoo_types.h'
add_snoonet_module 'm_token_auth.h'
add_snoonet_module 'm_register_api'
add_snoonet_module 'os_save.cpp'
add_vendor_extra 'm_mysql.cpp'
add_vendor_extra 'm_ssl_openssl.cpp'
add_vendor_extra 'm_regex_posix.cpp'
add_vendor_extra 'm_regex_pcre.cpp'
}
install() {
local version="$1"
local version_name="anope-${version}"
cd "${BASE_DIR:?}/${version_name}" || exit 1
install_extras
cat << EOF > config.cache
UMASK=022
INSTDIR="$PWD/services"
EOF
export CXXFLAGS="-std=c++11"
./Config -nointro -quick
cd build || exit 1
make --jobs "$(nproc)" && make install
}
VERSION="${1?No install version specified, exiting...}"
install "${VERSION}"