# Contributor: Olivier Mauras # Maintainer: Francesco Colista global pkgname := 'consul' global pkgver := '0.9.2' global pkgrel := '0' global pkgdesc := '"A tool for service discovery, monitoring and configuration'" global url := '"https://www.consul.io/'" global arch := '"all !aarch64'" global license := '"MPL 2.0'" global depends := ''"" global makedepends := '"go bash'" global install := ""$pkgname.pre-install"" global pkgusers := '"consul'" global pkggroups := '"consul'" global source := ""$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/$pkgname/archive/v$pkgver.tar.gz consul.initd consul.confd acl.json.sample encrypt.json.sample server.json tls.json.sample"" global builddir := ""$srcdir/src/github.com/hashicorp/$pkgname"" proc check { cd $builddir env GOPATH=$srcdir go test } proc prepare { mkdir -p "$srcdir/src/github.com/hashicorp" mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 default_prepare } proc build { cd $builddir env GOPATH=$srcdir go build -v -o bin/$pkgname \ -ldflags "-X github.com/hashicorp/consul/version.GitDescribe='$(pkgver)'" \ --tags consul || return 1 } proc package { cd $builddir # Consul init script install -m755 -D "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 # Consul init conf install -m644 -D "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname || return 1 # Main binary install -m750 -o root -g consul \ -D bin/$(pkgname) \ "$pkgdir"/usr/sbin/$(pkgname) || return 1 # Consul datadir install -m750 -o consul -g consul -d "$pkgdir"/var/$(pkgname) || return 1 # Consul configdir install -m750 -o root -g consul -d "$pkgdir"/etc/$(pkgname) || return 1 # Consul sample config files for cf in [acl.json.sample encrypt.json.sample server.json tls.json.sample] { install -m640 -o root -g consul "$srcdir"/$cf "$pkgdir"/etc/$(pkgname) || return 1 } } global sha512sums := '"67f596083848715c3bca6787caef0cdd7e67fba68274cd5208affecea984dd9b4e4e72c469723f8cc7f7f7d34e2f5302b5763f5b1a951ee0d33be91e87bdcb1a consul-0.9.2.tar.gz b0b6ba59d5b2c07f269bf901a24d1dcfbf96953185582577cecf7e17a2909a98673ec780d107b6264e910425aeadcf21d4adcedb89d4616c4eb9840e08639c17 consul.initd f2c5af74dfcbca2fea8ebea31139d93f44455b93ef17ec611b880d7071af4125615dbbd23969d0d04ca636c26d7b4e7eb97f1266baa89252097f4cbc5173d817 consul.confd d4310dde63d3b8fc4791124bd255bf2a1402b86d00f6b1732e18b0caedb75eae6c77382e1a48f12469828ef4bb363db4580fb1aafa63fcdc97b1431f6ea96d58 acl.json.sample ec30ad73c13f9dd5ba15389567436dbf74c24e822cb959c6ccc40a35e36e212313c70f3cf1ccee3f63a7bb98760173d6c2478161a25b85e14dd889a47572aff1 encrypt.json.sample a8b984db03f0bfb652d541dbdd3f1bc9be22f16cce78f73e495cc54adea1e09e9ac0e2f306ca8436590433c80a2ef824641f790b30aea9acb806b01fcabc918e server.json 7582f1845a742cf570db5aa52077eb4c4cbfe68ee2ae9569cc2806444217eba0ee960a3a52f3edd1a7c36ca8b7811df5cab6dd062b060ab43ed57b8c811c85de tls.json.sample'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(consul)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(0.9.2)} spids:[9])] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("A tool for service discovery, monitoring and configuration"))} spids: [15] ) ] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("https://www.consul.io/"))} spids: [20] ) ] spids: [20] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ ("all !aarch64"))} spids:[25])] spids: [25] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ ("MPL 2.0"))} spids:[30])] spids: [30] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[35])] spids: [35] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:makedepends) op:Equal rhs:{(DQ ("go bash"))} spids:[39])] spids: [39] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (.pre-install))} spids: [44] ) ] spids: [44] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgusers) op:Equal rhs:{(DQ (consul))} spids:[50])] spids: [50] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkggroups) op:Equal rhs:{(DQ (consul))} spids:[55])] spids: [55] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (".tar.gz::https://github.com/hashicorp/") ($ VSub_Name "$pkgname") (/archive/v) ($ VSub_Name "$pkgver") (".tar.gz\n") ("\tconsul.initd\n") ("\tconsul.confd\n") ("\tacl.json.sample\n") ("\tencrypt.json.sample\n") ("\tserver.json\n") ("\ttls.json.sample") ) } spids: [60] ) ] spids: [60] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/src/github.com/hashicorp/) ($ VSub_Name "$pkgname"))} spids: [78] ) ] spids: [78] ) (FuncDef name: check body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (SimpleCommand words: [{(go)} {(test)}] more_env: [(env_pair name:GOPATH val:{(DQ ($ VSub_Name "$srcdir"))} spids:[100])] ) ] spids: [90] ) spids: [86 89] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$srcdir") (/src/github.com/hashicorp))}) (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") } {(DQ ($ VSub_Name "$builddir")) (/)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(default_prepare)}) ] spids: [116] ) spids: [112 115] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (SimpleCommand words: [ {(go)} {(build)} {(-v)} {(-o)} {(bin/) ($ VSub_Name "$pkgname")} {(-ldflags)} { (DQ ("-X github.com/hashicorp/consul/version.GitDescribe='") (${ VSub_Name pkgver) ("'") ) } {(--tags)} {(consul)} ] more_env: [(env_pair name:GOPATH val:{(DQ ($ VSub_Name "$srcdir"))} spids:[171])] ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [160] ) spids: [156 159] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/) ($ VSub_Name "$pkgname")} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-m644)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.confd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/conf.d/) ($ VSub_Name "$pkgname")} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-m750)} {(-o)} {(root)} {(-g)} {(consul)} {(-D)} {(bin/) (${ VSub_Name pkgname)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/sbin/) (${ VSub_Name pkgname)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-m750)} {(-o)} {(consul)} {(-g)} {(consul)} {(-d)} {(DQ ($ VSub_Name "$pkgdir")) (/var/) (${ VSub_Name pkgname)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(install)} {(-m750)} {(-o)} {(root)} {(-g)} {(consul)} {(-d)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/) (${ VSub_Name pkgname)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (ForEach iter_name: cf iter_words: [ {(acl.json.sample)} {(encrypt.json.sample)} {(server.json)} {(tls.json.sample)} ] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(install)} {(-m640)} {(-o)} {(root)} {(-g)} {(consul)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$cf")} {(DQ ($ VSub_Name "$pkgdir")) (/etc/) (${ VSub_Name pkgname)} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [419 455] ) spids: [409 417] ) ] spids: [218] ) spids: [214 217] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "67f596083848715c3bca6787caef0cdd7e67fba68274cd5208affecea984dd9b4e4e72c469723f8cc7f7f7d34e2f5302b5763f5b1a951ee0d33be91e87bdcb1a consul-0.9.2.tar.gz\n" ) ( "b0b6ba59d5b2c07f269bf901a24d1dcfbf96953185582577cecf7e17a2909a98673ec780d107b6264e910425aeadcf21d4adcedb89d4616c4eb9840e08639c17 consul.initd\n" ) ( "f2c5af74dfcbca2fea8ebea31139d93f44455b93ef17ec611b880d7071af4125615dbbd23969d0d04ca636c26d7b4e7eb97f1266baa89252097f4cbc5173d817 consul.confd\n" ) ( "d4310dde63d3b8fc4791124bd255bf2a1402b86d00f6b1732e18b0caedb75eae6c77382e1a48f12469828ef4bb363db4580fb1aafa63fcdc97b1431f6ea96d58 acl.json.sample\n" ) ( "ec30ad73c13f9dd5ba15389567436dbf74c24e822cb959c6ccc40a35e36e212313c70f3cf1ccee3f63a7bb98760173d6c2478161a25b85e14dd889a47572aff1 encrypt.json.sample\n" ) ( "a8b984db03f0bfb652d541dbdd3f1bc9be22f16cce78f73e495cc54adea1e09e9ac0e2f306ca8436590433c80a2ef824641f790b30aea9acb806b01fcabc918e server.json\n" ) ( "7582f1845a742cf570db5aa52077eb4c4cbfe68ee2ae9569cc2806444217eba0ee960a3a52f3edd1a7c36ca8b7811df5cab6dd062b060ab43ed57b8c811c85de tls.json.sample" ) ) } spids: [459] ) ] spids: [459] ) ] )