summaryrefslogtreecommitdiff
path: root/pcr/ganglia
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/ganglia')
-rw-r--r--pcr/ganglia/PKGBUILD128
-rw-r--r--pcr/ganglia/ganglia.install35
-rw-r--r--pcr/ganglia/ganglia.sysusers1
-rw-r--r--pcr/ganglia/riemann.proto45
-rw-r--r--pcr/ganglia/runstatedir.patch7
-rw-r--r--pcr/ganglia/uid.patch33
6 files changed, 169 insertions, 80 deletions
diff --git a/pcr/ganglia/PKGBUILD b/pcr/ganglia/PKGBUILD
index 94e32a211..d55265068 100644
--- a/pcr/ganglia/PKGBUILD
+++ b/pcr/ganglia/PKGBUILD
@@ -1,78 +1,78 @@
-# Maintainer: Márcio Silva <coadde@parabola.nu>
+# Maintainer: David P. <megver83@parabola.nu>
+# Contributor: Tyler Langlois <ty |at| tjll |dot| net>
pkgname=ganglia
-pkgver=3.6.0
-pkgrel=4
-pkgdesc='Scalable distributed monitoring system for high-performance computing systems such as clusters and Grids.'
-arch=(
- i686
- x86_64
- mips64el
-)
-url=http://$pkgname.sourceforge.net/
-license=BSD
-depends=(
- apr
- confuse
- #php-embed
- python2
- rrdtool
-)
-install=$pkgname.install
-options=(!libtool)
-optdepends="$pkgname-web: Web frontend"
-backup=(
- etc/ganglia/gmond.conf
- etc/ganglia/gmetad.conf
-)
-source=(
- http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
- gmetad.service.in
- gmond.service.in
-)
-sha512sums=(
- 2a05d37787f1440c0c4aa91cdf0f4f4cb39c840b3b0fdcd6fe58cfb5892a75f81d36f6191c83c17558c37154298268df74fa255d2c940a8b84a7bf3ddb102394
- a42b7dcb7dd81961cc9fef114f8c4c352375ed931dc2ae77b1139c6fde7cbd6544fcb5fe286ff6066ef37696821dc9f6fcab7c6b14d3ebaa59e895219cd89836
- c362a383cbbaf5540b5d698f664534bd0da73bcc5ee4336c468844ed17706e05450f35e4f6cf969f1d2495c462883873b30e4575b9ee8ded74ab475afda608bb
-)
+pkgver=3.7.2
+pkgrel=3
+pkgdesc="A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids."
+arch=('i686' 'x86_64' 'armv7h')
+url="http://${pkgname}.sourceforge.net/"
+license=('BSD')
+depends=('apr' 'confuse' 'protobuf-c' 'python2' 'rrdtool')
+options=('!libtool')
+optdepends=('ganglia-web: Web frontend')
+install='ganglia.install'
+backup=('etc/ganglia/gmond.conf'
+ 'etc/ganglia/gmetad.conf')
+source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
+ 'riemann.proto::https://raw.githubusercontent.com/aphyr/riemann-java-client/2.5.0/src/main/proto/riemann/proto.proto'
+ 'ganglia.install'
+ 'ganglia.sysusers'
+ 'uid.patch'
+ 'runstatedir.patch')
+sha256sums=('042dbcaf580a661b55ae4d9f9b3566230b2232169a0898e91a797a4c61888409'
+ '880a28fa0ed5b485bce58109fa694eca458693d69b7c297cdd77a1340f476c00'
+ '79df856f3b0623e736ea9c1f5c36c321769d6f161c85faf31fab3d7b872d6725'
+ '34506cdaab1a6250c9a0d6d9fb9c6a0a0dfe1187bcb0a5d6ca71491007116d05'
+ 'dc2cdffaf0cbedbbac2e654843803423f93da494aaeecda8a185ad3badea8e21'
+ 'e3abe8017bf3d974e2b4ba5e285e7a91e94dbb69ec6fdf128675a8868e28c8a4')
prepare() {
- cd $srcdir/$pkgname-$pkgver
+ cd "$srcdir"
+ protoc-c --c_out="$pkgname-$pkgver/gmetad" riemann.proto
- #sed -i 's|sapi/embed/php_embed.h|php/sapi/embed/php_embed.h|' configure
-
- sed -i 's|nobody|ganglia|' gmetad/gmetad.conf.in
-
- # FIXME: Hopefully this will soon no longer be required?
- msg2 'Copying systemd units into source as workaround for bug'
- cp $srcdir/gmetad.service.in gmetad/gmetad.service.in
- cp $srcdir/gmond.service.in gmond/gmond.service.in
+ cd "$pkgname-$pkgver"
+ for patch in $srcdir/*.patch; do
+ msg2 "Applying $(basename $patch)"
+ patch -Np1 -i $patch
+ done
}
build() {
- cd $srcdir/$pkgname-$pkgver
- setarch $CARCH ./configure --prefix=/usr\
- --enable-gexec\
- --enable-perl\
- --enable-setuid=ganglia\
- --enable-status\
- --disable-static\
- --libdir=/usr/lib\
- --with-gmetad\
- --with-python=/usr/bin/python2\
- --sbindir=/usr/bin\
- --sysconfdir=/etc/ganglia
-# --enable-php\
-# --enable-setgid=ganglia\
- setarch $CARCH make
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr \
+ --sbindir=/usr/bin \
+ --libdir=/usr/lib \
+ --sysconfdir=/etc/ganglia \
+ --enable-gexec \
+ --enable-status \
+ --with-gmetad \
+ --with-riemann \
+ --with-python=/usr/bin/python2 \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system
+
+ make
}
package() {
- cd $srcdir/$pkgname-$pkgver
- setarch $CARCH make DESTDIR=$pkgdir install
+ cd "$srcdir/$pkgname-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+
+ # Install Python modules
+ mkdir -p "$pkgdir/usr/lib/$pkgname/python_modules"
+ find "gmond/python_modules" -name *.py \
+ -exec cp \{\} "$pkgdir/usr/lib/$pkgname/python_modules/" \;
+ cp -R "gmond/python_modules/conf.d" "$pkgdir/etc/$pkgname/"
+
+ msg2 "Generating default gmond.conf"
+ ./gmond/gmond --default_config > "$pkgdir/etc/$pkgname/gmond.conf"
- mkdir $pkgdir/usr/lib/$pkgname/python_modules
+ install -Dm755 -d "$pkgdir/var/lib/ganglia/rrds"
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/${pkgname}/COPYING"
- msg2 'Generating default gmond.conf'
- ./gmond/gmond --default_config > $pkgdir/etc/ganglia/gmond.conf
+ # See man page for sysusers.d(5)
+ install -Dm644 "$srcdir"/ganglia.sysusers \
+ "$pkgdir"/usr/lib/sysusers.d/ganglia.conf
}
diff --git a/pcr/ganglia/ganglia.install b/pcr/ganglia/ganglia.install
index 6a196af1f..20620db24 100644
--- a/pcr/ganglia/ganglia.install
+++ b/pcr/ganglia/ganglia.install
@@ -1,24 +1,27 @@
+# Arg 1: the new package version
post_install() {
- if [ "`vercmp $2 3.4.0`" -lt 0 ]; then
- echo 'WARNING: The ganglia package has been split. If you use the' \
- "web frontend, you'll need to install the ganglia-web package as well."
- fi
- id ganglia >& /dev/null
- if [ $? -ne 0 ]; then
- echo 'Adding ganglia system group and user...'
- groupadd -r ganglia && useradd -r -d /var/lib/ganglia -g ganglia -s /bin/false ganglia
- # Lock the account to prevent logging in
- passwd -l ganglia &> /dev/null
- fi
- install -d -o ganglia -g ganglia /var/lib/ganglia && install -d -o ganglia -g ganglia /var/lib/ganglia/rrds
+
+ # Create user and group
+ systemd-sysusers ganglia.conf
+
+ # Required at this stage to ensure ganglia user & group are available
+ install -d -o ganglia -g ganglia /var/lib/ganglia{,/rrds}
}
+# Arg 1: the new package version
+# Arg 2: the old package version
post_upgrade() {
- post_install
+ if [ "`vercmp $2 3.4.0`" -lt 0 ]; then
+ echo "WARNING: The ganglia package has been split. If you use the" \
+ "web frontend, you'll need to install the ganglia-web package as well."
+ fi
}
+# Arg 1: the old package version
post_remove() {
- echo 'Removing ganglia system group and user...'
- userdel ganglia
- echo 'NOTE: Please remove /var/lib/ganglia manually if it is no longer required.'
+ echo "This package does not automatically remove the ganglia data "
+ echo "directory (default /var/lib/ganglia) or ganglia user. Please do so "
+ echo "manually if they are no longer required."
}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/ganglia/ganglia.sysusers b/pcr/ganglia/ganglia.sysusers
new file mode 100644
index 000000000..1041974e6
--- /dev/null
+++ b/pcr/ganglia/ganglia.sysusers
@@ -0,0 +1 @@
+u ganglia - - /var/lib/ganglia
diff --git a/pcr/ganglia/riemann.proto b/pcr/ganglia/riemann.proto
new file mode 100644
index 000000000..3e946a3a0
--- /dev/null
+++ b/pcr/ganglia/riemann.proto
@@ -0,0 +1,45 @@
+option java_package = "com.aphyr.riemann";
+option java_outer_classname = "Proto";
+
+message State {
+ optional int64 time = 1;
+ optional string state = 2;
+ optional string service = 3;
+ optional string host = 4;
+ optional string description = 5;
+ optional bool once = 6;
+ repeated string tags = 7;
+ optional float ttl = 8;
+}
+
+message Event {
+ optional int64 time = 1;
+ optional string state = 2;
+ optional string service = 3;
+ optional string host = 4;
+ optional string description = 5;
+ repeated string tags = 7;
+ optional float ttl = 8;
+ repeated Attribute attributes = 9;
+
+ optional sint64 metric_sint64 = 13;
+ optional double metric_d = 14;
+ optional float metric_f = 15;
+}
+
+message Query {
+ optional string string = 1;
+}
+
+message Msg {
+ optional bool ok = 2;
+ optional string error = 3;
+ repeated State states = 4;
+ optional Query query = 5;
+ repeated Event events = 6;
+}
+
+message Attribute {
+ required string key = 1;
+ optional string value = 2;
+}
diff --git a/pcr/ganglia/runstatedir.patch b/pcr/ganglia/runstatedir.patch
new file mode 100644
index 000000000..f823e3788
--- /dev/null
+++ b/pcr/ganglia/runstatedir.patch
@@ -0,0 +1,7 @@
+--- a/scripts/fixconfig.in
++++ b/scripts/fixconfig.in
+@@ -27,3 +27,3 @@ sysconfdir="@sysconfdir@"
+ includedir="@includedir@"
+-runstatedir="@localstatedir@/run" # @runstatedir@ if autoconf >= 2.70
++runstatedir="/run" # @runstatedir@ if autoconf >= 2.70
+ if [ -d "@sysconfdir@/sysconfig" ]
diff --git a/pcr/ganglia/uid.patch b/pcr/ganglia/uid.patch
new file mode 100644
index 000000000..165549033
--- /dev/null
+++ b/pcr/ganglia/uid.patch
@@ -0,0 +1,33 @@
+--- a/configure
++++ b/configure
+@@ -1588,7 +1588,7 @@ Optional Features:
+
+ --enable-debug turn on debugging output and compile options
+ --enable-gexec turn on gexec support (platform-specific)
+- --enable-setuid=USER turn on setuid support (default setuid=nobody)
++ --enable-setuid=USER turn on setuid support (default setuid=ganglia)
+ --enable-setgid=GROUP turn on setgid support (default setgid=no)
+ --enable-pedantic turn on pedantic mode during compile
+ --enable-memcheck turn on memory checking during compile
+@@ -11152,7 +11152,7 @@ $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h
+ fi
+
+
+-setuid_user=nobody
++setuid_user=ganglia
+ # Check whether --enable-setuid was given.
+ if test "${enable_setuid+set}" = set; then :
+ enableval=$enable_setuid; if test x"$enableval" != xno; then no_setuid=0; setuid_user=$enableval ; fi
+--- a/gmetad/gmetad.conf.in
++++ b/gmetad/gmetad.conf.in
+@@ -99,8 +99,8 @@ data_source "my cluster" localhost
+ #-------------------------------------------------------------------------------
+ # User gmetad will setuid to (defaults to "nobody")
+ # default: "nobody"
+-# setuid_username "nobody"
+-#
++setuid_username "ganglia"
++
+ #-------------------------------------------------------------------------------
+ # Umask to apply to created rrd files and grid directory structure
+ # default: 0 (files are public)