aboutsummaryrefslogtreecommitdiffstats
path: root/community/cloudi/APKBUILD
blob: 85038aabc27a60d6a5c35a21289ce3895972f207 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Contributor: Michael Truog <mjtruog@protonmail.com>
# Maintainer: Michael Truog <mjtruog@protonmail.com>
#
# INFO
#
# Why is the cloudi.initd file not using the openrc default start-stop-daemon?
#
#   With the Erlang VM it is possible to use the -heart erl command line
#   argument (which is possible with cloudi configuration of the
#   /etc/cloudi/vm.args file).  To allow the use of the heartbeat monitoring
#   of the Erlang runtime system, it is necessary to rely upon the cloudi
#   script for handling the cloudi pid and not utilize openrc for pidfile
#   creation or signal-based termination.
#
#   With a typical Erlang VM release, it is normally expected to provide
#   the ability to attach to the Erlang VM shell of the running node using
#   pipes.  The setup of the Erlang VM shell pipes needs to be handled with
#   Erlang VM execution that also handles detaching the daemon process.
#   If the openrc default start-stop-daemon execution was used instead,
#   it would not be possible to easily setup the Erlang VM shell pipes.
#
#   The termination of cloudi utilizes a 65000 millisecond timeout, allowing
#   all services a maximum of 60000 milliseconds for termination with
#   5000 millisecond for internal Erlang VM delays.  The cloudi script does
#   block for this termination to complete.
#
#   The pid file path is set during the configuration step
#   (shown below with the assignment of CLOUDI_PID_FILE).

pkgname=cloudi
pkgver=1.8.0
pkgrel=1
pkgdesc="Cloud computing framework for efficient, scalable, and stable soft-realtime event processing."
url="https://cloudi.org/"
license="MIT"
arch="all"
depends="erlang
	 g++"
makedepends="autoconf
	     automake
	     binutils-dev
	     boost-dev
	     boost-system
	     boost-thread
	     erlang-asn1
	     erlang-common-test
	     erlang-crypto
	     erlang-dev
	     erlang-erl-interface
	     erlang-eunit
	     erlang-inets
	     erlang-jinterface
	     erlang-public-key
	     erlang-reltool
	     erlang-sasl
	     erlang-snmp
	     erlang-ssh
	     erlang-ssl
	     erlang-syntax-tools
	     erlang-tools
	     erlang-xmerl
	     gmp-dev
	     go
	     libexecinfo-dev
	     libtool
	     nodejs
	     openjdk8
	     perl
	     php7
	     python3
	     python3-dev
	     ruby
	     "
subpackages="$pkgname-static $pkgname-openrc"
source="https://osdn.net/dl/cloudi/cloudi-$pkgver.tar.gz
	0005-Disable-tests-for-aports-buildservers.patch
	$pkgname.initd"

# configure additional dependencies based on the package architecture

# Enable OCaml on the appropriate architectures
case "$CTARGET_ARCH" in
armhf | armv7)
	;;
x86)
	# 4 tests out of 7 fail due to 'timetrap_timeout'
	options="$options !check"
	;;
*)
	makedepends="$makedepends ocaml"
	_configure_args="$_configure_args --enable-ocaml-support"
	;;
esac
# Enable Haskell on the appropriate architectures
case "$CTARGET_ARCH" in
x86_64)
	makedepends="$makedepends ghc cabal zlib-dev"
	_configure_args="$_configure_args --enable-haskell-support"
	# 1 test out of 7 fail due to 'timetrap_timeout'
	options="$options !check"
	;;
esac

prepare() {
	default_prepare
	cd "$builddir"/src
	./autogen.sh
}

build() {
	cd "$builddir"/src
	export PATH="/usr/lib/jvm/java-1.8-openjdk/bin:$PATH"
	LIBS="-lexecinfo" CLOUDI_PID_FILE="/run/cloudi.pid" ./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--bindir=/usr/sbin \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--host="$CHOST" \
		--build="$CBUILD" \
		--with-cxx-backtrace \
		--with-python-version=3 \
		--enable-go-support $_configure_args
	make
}

check() {
	cd "$builddir"/src
	make ct
}

package() {
	cd "$builddir"/src
	make DESTDIR="$pkgdir" install
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
}

sha512sums="53a99729fa37673cfcc7fb7e76e285ff7bd978a080a65d46259b53c6dd0854214ee91b0e93f090d6958045f7e1eb0b739fcfc13c86070780f518f48bd9732fc8  cloudi-1.8.0.tar.gz
8b3c67ce0899b64b9f48da749864b95e3d9747383c1daabdad7e6230ebb815329ccbdc7f69a956590ddda0a32ff74d073f98bdc0b15d5dc4728dd11640835a6c  0005-Disable-tests-for-aports-buildservers.patch
053f860f656617012208a0e1909e43b2f8979d381a90d3fa5a745a9cf5021fe54556a641fef2badaa9955f2394d00e32183389cb9b501169dcbf8cbe4fbb0329  cloudi.initd"