# Contributor: Ɓukasz Jendrysik # Maintainer: Natanael Copa global pkgname := 'collectd' global pkgver := '5.7.2' global pkgrel := '0' global pkgdesc := '"The system statistics collection daemon'" global url := '"http://collectd.org'" global arch := '"all'" global license := '"GPL2'" global depends := ''"" global makedepends := '"curl-dev net-snmp-dev postgresql-dev perl-dev python2-dev libgcrypt-dev mariadb-dev zlib-dev libressl-dev iptables-dev rrdtool-dev yajl-dev libvirt-dev lm_sensors-dev libxml2-dev hiredis-dev eudev-dev mosquitto-dev lua-dev lvm2-dev openipmi-dev libpcap-dev liboping-dev autoconf automake libtool'" global install := ''"" global subpackages := ""$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-perl $pkgname-snmp $pkgname-curl:_curl $pkgname-utils $pkgname-write_http $pkgname-nginx $pkgname-apache $pkgname-postgresql $pkgname-network $pkgname-mysql $pkgname-rrdtool $pkgname-sensors $pkgname-python:_python $pkgname-iptables:_ipt $pkgname-bind $pkgname-ascent $pkgname-virt $pkgname-redis $pkgname-write_redis $pkgname-log_logstash $pkgname-ceph $pkgname-disk $pkgname-lvm $pkgname-lua $pkgname-mqtt $pkgname-ipmi $pkgname-ping $pkgname-dns"" global install := ""$pkgname.pre-install"" global pkgusers := '"collectd'" global pkggroups := '"collectd'" global source := ""http://collectd.org/files/collectd-$pkgver.tar.bz2 collectd.initd gnu_source.patch collectd.pre-install"" global builddir := ""$srcdir"/$pkgname-$pkgver" # security fixes: # 5.5.2-r0: # - CVE-2016-6254 proc build { cd $builddir autoreconf -vif || return 1 ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc/collectd \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstate=/var \ --with-libiptc \ --enable-rrdtool \ --enable-libvirt \ --enable-bind \ --disable-werror \ --with-perl-bindings=INSTALLDIRS=vendor \ || return 1 make || return 1 # disable plugins by default since its in a subpackage sed -i -e 's/^LoadPlugin network/#LoadPlugin network/' \ src/collectd.conf || return 1 sed -i -e 's/^LoadPlugin rrdtool/#LoadPlugin rrdtool/' \ src/collectd.conf || return 1 } proc package { cd $builddir make DESTDIR="$pkgdir" install || return 1 chown root:collectd "$pkgdir"/etc/collectd/collectd.conf || return 1 find $pkgdir '(' -name perllocal.pod -o -name .packlist ')' -delete install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname } proc perl { global pkgdesc := '"perl bindings to collectd'" mkdir -p "$subpkgdir"/usr/lib/collectd \ "$subpkgdir"/usr/share || return 1 mv "$pkgdir"/usr/lib/collectd/perl.so \ "$subpkgdir"/usr/lib/collectd/ || return 1 mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/ || return 1 mv "$pkgdir"/usr/share/perl* "$subpkgdir"/usr/share/ } proc utils { global pkgdesc := ""$pkgname utilities"" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ } proc _plugin { var mod = $1 var desc = $(2:-$mod) global pkgdesc := ""$desc pluin for collectd"" global depends := '"collectd'" install -d "$subpkgdir"/usr/lib/collectd mv "$pkgdir"/usr/lib/collectd/$mod.so "$subpkgdir"/usr/lib/collectd/ } proc snmp { _plugin snmp; } proc _curl { _plugin 'curl*'; } proc write_http { _plugin write_http; } proc nginx { _plugin nginx; } proc apache { _plugin apache; } proc postgresql { _plugin postgresql; } proc mysql { _plugin mysql; } proc network { _plugin network; } proc rrdtool { _plugin 'rrd*'; } proc sensors { _plugin sensors; } proc _python { _plugin python; } proc _ipt { _plugin iptables; } proc bind { _plugin bind; } proc ascent { _plugin ascent; } proc redis { _plugin redis; } proc write_redis { _plugin write_redis; } proc log_logstash { _plugin log_logstash; } proc ceph { _plugin ceph; } proc disk { _plugin disk; } proc lvm { _plugin lvm; } proc lua { _plugin lua; } proc mqtt { _plugin mqtt; } proc virt { _plugin virt; global provides := ""$pkgname-libvirt""; } proc ipmi { _plugin ipmi; } proc ping { _plugin ping; } proc dns { _plugin dns; } global sha512sums := '"8844b67159f8da2203b5ac57ef19fce0a01050a016174d196b48b5fb24925ad2935af9bdd9af06097ff663499abc496cdcc2d9e9a10f403f8d707c465c1a88f3 collectd-5.7.2.tar.bz2 a286c2164af196154d017658d6e5aa3cc4f76dadf90b68c3021418979d9f0377776bb990d737ae5c916c04475725365aea8b78e3bc5e2f3679d5a99f8b9af13e collectd.initd 519fa563d319928e35e0235dd2bc38e7e53dbaae93ede1c93622dab2d00e1ac3baa93200f9e3e62cb81c1c9d808171b4648db864191d57a703ac7874b9c5fb95 gnu_source.patch cb0efcd3b9bd5620b7d812d5f038ebd60253f1ce9006da0a1b4b56666202a4254e80ab6a84d675b6cb099ecda1897de17b51a9e3f0d83e8b0455343f5f6d24d7 collectd.pre-install'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(collectd)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(5.7.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 ("The system statistics collection daemon"))} spids: [15] ) ] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://collectd.org"))} spids: [20] ) ] spids: [20] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[25])] spids: [25] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (GPL2))} 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 ("curl-dev net-snmp-dev postgresql-dev perl-dev python2-dev\n") ("\tlibgcrypt-dev mariadb-dev zlib-dev libressl-dev iptables-dev\n") ("\trrdtool-dev yajl-dev libvirt-dev lm_sensors-dev libxml2-dev\n") ("\thiredis-dev eudev-dev mosquitto-dev lua-dev lvm2-dev openipmi-dev\n") ("\tlibpcap-dev liboping-dev\n") ("\tautoconf automake libtool") ) } spids: [39] ) ] spids: [39] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:install) op:Equal rhs:{(DQ )} spids:[49])] spids: [49] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("-dev ") ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") ("-libs\n") ("\t") ($ VSub_Name "$pkgname") ("-perl ") ($ VSub_Name "$pkgname") ("-snmp ") ($ VSub_Name "$pkgname") ("-curl:_curl ") ($ VSub_Name "$pkgname") ("-utils\n") ("\t") ($ VSub_Name "$pkgname") ("-write_http ") ($ VSub_Name "$pkgname") ("-nginx ") ($ VSub_Name "$pkgname") ("-apache ") ($ VSub_Name "$pkgname") ("-postgresql\n") ("\t") ($ VSub_Name "$pkgname") ("-network ") ($ VSub_Name "$pkgname") ("-mysql ") ($ VSub_Name "$pkgname") ("-rrdtool ") ($ VSub_Name "$pkgname") ("-sensors\n") ("\t") ($ VSub_Name "$pkgname") ("-python:_python ") ($ VSub_Name "$pkgname") ("-iptables:_ipt ") ($ VSub_Name "$pkgname") ("-bind\n") ("\t") ($ VSub_Name "$pkgname") ("-ascent ") ($ VSub_Name "$pkgname") ("-virt ") ($ VSub_Name "$pkgname") ("-redis ") ($ VSub_Name "$pkgname") ("-write_redis\n") ("\t") ($ VSub_Name "$pkgname") ("-log_logstash ") ($ VSub_Name "$pkgname") ("-ceph ") ($ VSub_Name "$pkgname") ("-disk ") ($ VSub_Name "$pkgname") ("-lvm\n") ("\t") ($ VSub_Name "$pkgname") ("-lua ") ($ VSub_Name "$pkgname") ("-mqtt ") ($ VSub_Name "$pkgname") ("-ipmi ") ($ VSub_Name "$pkgname") ("-ping ") ($ VSub_Name "$pkgname") (-dns) ) } spids: [53] ) ] spids: [53] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:install) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (.pre-install))} spids: [126] ) ] spids: [126] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgusers) op:Equal rhs:{(DQ (collectd))} spids:[132])] spids: [132] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkggroups) op:Equal rhs:{(DQ (collectd))} spids:[137])] spids: [137] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://collectd.org/files/collectd-") ($ VSub_Name "$pkgver") (".tar.bz2\n") ("\tcollectd.initd\n") ("\tgnu_source.patch\n") ("\tcollectd.pre-install") ) } spids: [142] ) ] spids: [142] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver")} spids: [153] ) ] spids: [153] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(autoreconf)} {(-vif)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc/collectd)} {(--mandir) (Lit_Other "=") (/usr/share/man)} {(--infodir) (Lit_Other "=") (/usr/share/info)} {(--localstate) (Lit_Other "=") (/var)} {(--with-libiptc)} {(--enable-rrdtool)} {(--enable-libvirt)} {(--enable-bind)} {(--disable-werror)} {(--with-perl-bindings) (Lit_Other "=") (Lit_VarLike "INSTALLDIRS=") (vendor)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [(C {(make)}) (ControlFlow token: arg_word:{(1)})] op_id: Op_DPipe ) (AndOr children: [ (C {(sed)} {(-i)} {(-e)} {(SQ <"s/^LoadPlugin network/#LoadPlugin network/">)} {(src/collectd.conf)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(sed)} {(-i)} {(-e)} {(SQ <"s/^LoadPlugin rrdtool/#LoadPlugin rrdtool/">)} {(src/collectd.conf)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [177] ) spids: [173 176] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(chown)} {(root) (Lit_Other ":") (collectd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/collectd/collectd.conf)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(find)} {(DQ ($ VSub_Name "$pkgdir"))} {(EscapedLiteralPart token:)} {(-name)} {(perllocal.pod)} {(-o)} {(-name)} {(.packlist)} {(EscapedLiteralPart token:)} {(-delete)} ) (C {(install)} {(-m755)} {(-D)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$pkgname") (.initd)} {(DQ ($ VSub_Name "$pkgdir")) (/etc/init.d/) ($ VSub_Name "$pkgname")} ) ] spids: [339] ) spids: [335 338] ) (FuncDef name: perl body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("perl bindings to collectd"))} spids: [435] ) ] spids: [435] ) (AndOr children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/collectd)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/collectd/perl.so)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/collectd/)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/perl) (Lit_Other "*")} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/perl) (Lit_Other "*")} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/)} ) ] spids: [432] ) spids: [428 431] ) (FuncDef name: utils body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (" utilities"))} spids: [528] ) ] spids: [528] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin/) (Lit_Other "*")} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin/)} ) ] spids: [525] ) spids: [521 524] ) (FuncDef name: _plugin body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:mod) op: Equal rhs: {($ VSub_Number "$1")} spids: [570] ) ] spids: [568] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:desc) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {($ VSub_Name "$mod")} ) spids: [577 581] ) } spids: [576] ) ] spids: [574] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$desc") (" pluin for collectd"))} spids: [584] ) ] spids: [584] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ (collectd))} spids: [591] ) ] spids: [591] ) (C {(install)} {(-d)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/collectd)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/collectd/) ($ VSub_Name "$mod") (.so)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/collectd/)} ) ] spids: [565] ) spids: [561 564] ) (FuncDef name: snmp body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(snmp)}) terminator:)] spids: [628] ) spids: [624 627] ) (FuncDef name: _curl body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(SQ <"curl*">)}) terminator:)] spids: [641] ) spids: [637 640] ) (FuncDef name: write_http body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(write_http)}) terminator:)] spids: [656] ) spids: [652 655] ) (FuncDef name: nginx body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(nginx)}) terminator:)] spids: [669] ) spids: [665 668] ) (FuncDef name: apache body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(apache)}) terminator:)] spids: [682] ) spids: [678 681] ) (FuncDef name: postgresql body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(postgresql)}) terminator:)] spids: [695] ) spids: [691 694] ) (FuncDef name: mysql body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(mysql)}) terminator:)] spids: [708] ) spids: [704 707] ) (FuncDef name: network body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(network)}) terminator:)] spids: [721] ) spids: [717 720] ) (FuncDef name: rrdtool body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(SQ <"rrd*">)}) terminator:)] spids: [734] ) spids: [730 733] ) (FuncDef name: sensors body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(sensors)}) terminator:)] spids: [749] ) spids: [745 748] ) (FuncDef name: _python body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(python)}) terminator:)] spids: [762] ) spids: [758 761] ) (FuncDef name: _ipt body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(iptables)}) terminator:)] spids: [775] ) spids: [771 774] ) (FuncDef name: bind body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(bind)}) terminator:)] spids: [788] ) spids: [784 787] ) (FuncDef name: ascent body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(ascent)}) terminator:)] spids: [801] ) spids: [797 800] ) (FuncDef name: redis body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(redis)}) terminator:)] spids: [814] ) spids: [810 813] ) (FuncDef name: write_redis body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(write_redis)}) terminator:)] spids: [827] ) spids: [823 826] ) (FuncDef name: log_logstash body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(log_logstash)}) terminator:)] spids: [840] ) spids: [836 839] ) (FuncDef name: ceph body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(ceph)}) terminator:)] spids: [853] ) spids: [849 852] ) (FuncDef name: disk body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(disk)}) terminator:)] spids: [866] ) spids: [862 865] ) (FuncDef name: lvm body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(lvm)}) terminator:)] spids: [879] ) spids: [875 878] ) (FuncDef name: lua body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(lua)}) terminator:)] spids: [892] ) spids: [888 891] ) (FuncDef name: mqtt body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(mqtt)}) terminator:)] spids: [905] ) spids: [901 904] ) (FuncDef name: virt body: (BraceGroup children: [ (Sentence child:(C {(_plugin)} {(virt)}) terminator:) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:provides) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (-libvirt))} spids: [925] ) ] spids: [925] ) terminator: ) ] spids: [918] ) spids: [914 917] ) (FuncDef name: ipmi body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(ipmi)}) terminator:)] spids: [938] ) spids: [934 937] ) (FuncDef name: ping body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(ping)}) terminator:)] spids: [951] ) spids: [947 950] ) (FuncDef name: dns body: (BraceGroup children: [(Sentence child:(C {(_plugin)} {(dns)}) terminator:)] spids: [964] ) spids: [960 963] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "8844b67159f8da2203b5ac57ef19fce0a01050a016174d196b48b5fb24925ad2935af9bdd9af06097ff663499abc496cdcc2d9e9a10f403f8d707c465c1a88f3 collectd-5.7.2.tar.bz2\n" ) ( "a286c2164af196154d017658d6e5aa3cc4f76dadf90b68c3021418979d9f0377776bb990d737ae5c916c04475725365aea8b78e3bc5e2f3679d5a99f8b9af13e collectd.initd\n" ) ( "519fa563d319928e35e0235dd2bc38e7e53dbaae93ede1c93622dab2d00e1ac3baa93200f9e3e62cb81c1c9d808171b4648db864191d57a703ac7874b9c5fb95 gnu_source.patch\n" ) ( "cb0efcd3b9bd5620b7d812d5f038ebd60253f1ce9006da0a1b4b56666202a4254e80ab6a84d675b6cb099ecda1897de17b51a9e3f0d83e8b0455343f5f6d24d7 collectd.pre-install" ) ) } spids: [974] ) ] spids: [974] ) ] )