# Contributor: Michael Truog # Maintainer: Michael Truog # # 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). global pkgname := 'cloudi' global pkgver := '1.7.2' global pkgrel := '0' global pkgdesc := '"Cloud computing framework for efficient, scalable, and stable soft-realtime event processing.'" global url := '"http://cloudi.org/'" global license := '"MIT'" global arch := '"all !armhf'" # armhf: build error global depends := '"erlang g++'" global 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-ssl erlang-syntax-tools erlang-tools erlang-xmerl gmp-dev go libexecinfo-dev libtool nodejs openjdk8 perl php7 python3 python3-dev ruby '" global install := ''"" global subpackages := ''"" global source := ""https://downloads.sourceforge.net/project/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz 0005-Disable-tests-for-aports-buildservers.patch $pkgname.initd"" global builddir := ""$srcdir/cloudi-$pkgver/src"" # configure additional dependencies based on the package architecture global CONFIGURE_ARGS := ''"" # Enable Haskell on the appropriate architectures matchstr $CTARGET_ARCH { x86_64 | armhf { global makedepends := ""$makedepends ghc cabal zlib-dev"" global CONFIGURE_ARGS := ""$CONFIGURE_ARGS --enable-haskell-support"" } } # Enable OCaml on the appropriate architectures matchstr $CTARGET_ARCH { x86 | armhf | s390x { } * { global makedepends := ""$makedepends ocaml"" global CONFIGURE_ARGS := ""$CONFIGURE_ARGS --enable-ocaml-support"" } } proc prepare { cd $builddir default_prepare ./autogen.sh } proc build { cd $builddir export PATH="/usr/lib/jvm/java-1.8-openjdk/bin:$PATH" env 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 } proc check { cd $builddir make ct } proc package { cd $builddir make DESTDIR="$pkgdir" install install -m755 -D "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname } global sha512sums := '"8ba14f3436e354fbfc91135d05ea47a4af73f8150ffa2e687111e6aa9ee6b1db009cf9ef19a93cff36982b414cbefe0ad388c2d7725bea605b3f2e5c9b36a666 cloudi-1.7.2.tar.gz b2ef0cf07e207cbe62a34edb69ac4700bd5a75d9924e6597595e69f0988772d833d6af882cfa40278c9efe4b042da2952f9b7276b3c80c4b015b0c1490782b59 0005-Disable-tests-for-aports-buildservers.patch 053f860f656617012208a0e1909e43b2f8979d381a90d3fa5a745a9cf5021fe54556a641fef2badaa9955f2394d00e32183389cb9b501169dcbf8cbe4fbb0329 cloudi.initd'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(cloudi)} spids:[85])] spids: [85] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(1.7.2)} spids:[88])] spids: [88] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[91])] spids: [91] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: { (DQ ( "Cloud computing framework for efficient, scalable, and stable soft-realtime event processing." ) ) } spids: [94] ) ] spids: [94] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://cloudi.org/"))} spids: [99] ) ] spids: [99] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (MIT))} spids:[104])] spids: [104] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ ("all !armhf"))} spids:[109])] spids: [109] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("erlang\n") (" g++"))} spids: [117] ) ] spids: [117] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: { (DQ ("autoconf\n") (" automake\n") (" binutils-dev\n") (" boost-dev\n") (" boost-system\n") (" boost-thread\n") (" erlang-asn1\n") (" erlang-common-test\n") (" erlang-crypto\n") (" erlang-dev\n") (" erlang-erl-interface\n") (" erlang-eunit\n") (" erlang-inets\n") (" erlang-jinterface\n") (" erlang-public-key\n") (" erlang-reltool\n") (" erlang-sasl\n") (" erlang-snmp\n") (" erlang-ssl\n") (" erlang-syntax-tools\n") (" erlang-tools\n") (" erlang-xmerl\n") (" gmp-dev\n") (" go\n") (" libexecinfo-dev\n") (" libtool\n") (" nodejs\n") (" openjdk8\n") (" perl\n") (" php7\n") (" python3\n") (" python3-dev\n") (" ruby\n") (" ") ) } spids: [123] ) ] spids: [123] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:install) op:Equal rhs:{(DQ )} spids:[161])] spids: [161] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:subpackages) op:Equal rhs:{(DQ )} spids:[165])] spids: [165] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("https://downloads.sourceforge.net/project/") ($ VSub_Name "$pkgname") (/) ($ VSub_Name "$pkgver") (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (".tar.gz\n") (" 0005-Disable-tests-for-aports-buildservers.patch\n") (" ") ($ VSub_Name "$pkgname") (.initd) ) } spids: [169] ) ] spids: [169] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/cloudi-) ($ VSub_Name "$pkgver") (/src))} spids: [186] ) ] spids: [186] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:CONFIGURE_ARGS) op:Equal rhs:{(DQ )} spids:[198])] spids: [198] ) (Case to_match: {(DQ ($ VSub_Name "$CTARGET_ARCH"))} arms: [ (case_arm pat_list: [{(x86_64)} {(armhf)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ($ VSub_Name "$makedepends") (" ghc cabal zlib-dev"))} spids: [221] ) ] spids: [221] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CONFIGURE_ARGS) op: Equal rhs: {(DQ ($ VSub_Name "$CONFIGURE_ARGS") (" --enable-haskell-support"))} spids: [228] ) ] spids: [228] ) ] spids: [213 218 235 -1] ) ] spids: [205 211 237] ) (Case to_match: {(DQ ($ VSub_Name "$CTARGET_ARCH"))} arms: [ (case_arm pat_list:[{(x86)}{(armhf)}{(s390x)}] spids:[250259262-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ($ VSub_Name "$makedepends") (" ocaml"))} spids: [268] ) ] spids: [268] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CONFIGURE_ARGS) op: Equal rhs: {(DQ ($ VSub_Name "$CONFIGURE_ARGS") (" --enable-ocaml-support"))} spids: [275] ) ] spids: [275] ) ] spids: [264 265 282 -1] ) ] spids: [242 248 284] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(default_prepare)}) (C {(./autogen.sh)}) ] spids: [291] ) spids: [287 290] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(export)} {(Lit_VarLike "PATH=") (DQ ("/usr/lib/jvm/java-1.8-openjdk/bin:") ($ VSub_Name "$PATH")) } ) (SimpleCommand words: [ {(./configure)} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc)} {(--localstatedir) (Lit_Other "=") (/var)} {(--bindir) (Lit_Other "=") (/usr/sbin)} {(--mandir) (Lit_Other "=") (/usr/share/man)} {(--infodir) (Lit_Other "=") (/usr/share/info)} {(--host) (Lit_Other "=") (DQ ($ VSub_Name "$CHOST"))} {(--build) (Lit_Other "=") (DQ ($ VSub_Name "$CBUILD"))} {(--with-cxx-backtrace)} {(--with-python-version) (Lit_Other "=") (3)} {(--enable-go-support)} {($ VSub_Name "$CONFIGURE_ARGS")} ] more_env: [ (env_pair name:LIBS val:{(DQ (-lexecinfo))} spids:[332]) (env_pair name: CLOUDI_PID_FILE val: {(DQ (/run/cloudi.pid))} spids: [337] ) ] ) (C {(make)}) ] spids: [313] ) spids: [309 312] ) (FuncDef name: check body: (BraceGroup children: [(C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(make)} {(ct)})] spids: [422] ) spids: [418 421] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)}) (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/) ($ VSub_Name "$pkgname")} ) ] spids: [443] ) spids: [439 442] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "8ba14f3436e354fbfc91135d05ea47a4af73f8150ffa2e687111e6aa9ee6b1db009cf9ef19a93cff36982b414cbefe0ad388c2d7725bea605b3f2e5c9b36a666 cloudi-1.7.2.tar.gz\n" ) ( "b2ef0cf07e207cbe62a34edb69ac4700bd5a75d9924e6597595e69f0988772d833d6af882cfa40278c9efe4b042da2952f9b7276b3c80c4b015b0c1490782b59 0005-Disable-tests-for-aports-buildservers.patch\n" ) ( "053f860f656617012208a0e1909e43b2f8979d381a90d3fa5a745a9cf5021fe54556a641fef2badaa9955f2394d00e32183389cb9b501169dcbf8cbe4fbb0329 cloudi.initd" ) ) } spids: [487] ) ] spids: [487] ) ] )