-
Notifications
You must be signed in to change notification settings - Fork 27
/
zeromq-4.1.4_install
executable file
·73 lines (61 loc) · 2.07 KB
/
zeromq-4.1.4_install
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
#!/usr/bin/env bash
set -o errexit -o nounset
for i in ${includes_dir:=$(dirname $0 2>/dev/null)/includes}/{module_maker,require}_inc.sh; do . $i; done
package_name="zeromq"
package_version="4.1.4"
src_urls=http://download.zeromq.org/zeromq-${package_version}.tar.gz
# Optional:
# package_variant=""
package_description="ZeroMQ is a distributed messaging library that supports many message-passing patterns and methods."
actual_file_name=zeromq-${package_version}.tar.gz
actual_file_md5=a611ecc93fffeb6d058c0e6edf4ad4fb
require gcc-libs/4.9.2
require compilers/gnu/4.9.2
require libsodium/1.0.6/gnu-4.9.2
_env_setup() {
owd=$(pwd)
package_label="${package_name}/${package_version}${package_variant:+-${package_variant}}/${COMPILER_TAG}"
install_prefix=${INSTALL_PREFIX:-/shared/ucl/apps/$package_label}
build_dir=${BUILD_DIR:-$(mktemp -d -t ${package_name}-build.XXXXXXXX)}
module_dir=${MODULE_DIR:-$(mktemp -d -t ${package_name}-modules.XXXXXXXX)}
basename=${basename:-$(basename -s .tar.gz $(cut -f 1 -d ' ' <<<$src_urls))}
cd $build_dir
}
_fetch_files() {
wget ${actual_file_name:+-O $actual_file_name} $src_urls
md5sum -c <<<"$actual_file_md5 $actual_file_name"
}
_setup_files() {
tar -xf $actual_file_name
}
_build() {
cd ${basename}
./configure --prefix=$install_prefix ${1:-}
make ${2:-}
make check || (echo "Note from build script: test_filter_ipc will probably fail. This looks like a known issue: https://github.com/zeromq/libzmq/issues/1462 ">&2)
make install
make distclean
echo "Installed to: $install_prefix"
}
_prepare_module() {
make_module -p $install_prefix \
-c "${package_name}" \
-o $module_dir/$package_label \
-r libsodium/1.0.6/gnu-4.9.2 \
-r gcc-libs/4.9.2 \
-w "Adds ${package_name} ${package_version} to your environment. ${package_description}"
echo "Module files put in: $module_dir" >&2
chmod a+rx $module_dir
}
_clean_up() {
cd $owd
if [ -n "$build_dir" ]; then
rm -Rf ${build_dir}
fi
}
_env_setup
_fetch_files
_setup_files
_build
_prepare_module
_clean_up