diff options
author | Tyler Langlois | 2015-08-24 22:32:49 -0400 |
---|---|---|
committer | Tyler Langlois | 2015-08-24 22:32:49 -0400 |
commit | 88ebc67513f55bc489c1b729f3c3cb4b04ad77b6 (patch) | |
tree | d3b44c1d72d30284f2c5f7be996dfc639fba80e6 | |
download | aur-88ebc67513f55bc489c1b729f3c3cb4b04ad77b6.tar.gz |
Bring ganglia to AUR4
Derived from https://github.com/aur-archive/ganglia with the following changes:
- Use upstream systemd service units
- Drop .rc init scripts
- Use sysusers paradigm in lieu of manual steps in .install file
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 72 | ||||
-rw-r--r-- | ganglia.install | 27 | ||||
-rw-r--r-- | ganglia.sysusers | 1 | ||||
-rw-r--r-- | runstatedir.patch | 7 | ||||
-rw-r--r-- | uid.patch | 33 |
6 files changed, 171 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3c28e1886555 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = ganglia + pkgdesc = A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. + pkgver = 3.7.1 + pkgrel = 3 + url = http://ganglia.sourceforge.net/ + install = ganglia.install + arch = i686 + arch = x86_64 + arch = armv6h + license = BSD + depends = apr + depends = confuse + depends = python2 + depends = rrdtool + optdepends = ganglia-web: Web frontend + options = !libtool + backup = etc/ganglia/gmond.conf + backup = etc/ganglia/gmetad.conf + source = http://downloads.sourceforge.net/ganglia/ganglia-3.7.1.tar.gz + source = ganglia.install + source = ganglia.sysusers + source = uid.patch + source = runstatedir.patch + sha256sums = e735a6218986a0ff77c737e5888426b103196c12dc2d679494ca9a4269ca69a3 + sha256sums = 79df856f3b0623e736ea9c1f5c36c321769d6f161c85faf31fab3d7b872d6725 + sha256sums = 34506cdaab1a6250c9a0d6d9fb9c6a0a0dfe1187bcb0a5d6ca71491007116d05 + sha256sums = dc2cdffaf0cbedbbac2e654843803423f93da494aaeecda8a185ad3badea8e21 + sha256sums = e3abe8017bf3d974e2b4ba5e285e7a91e94dbb69ec6fdf128675a8868e28c8a4 + +pkgname = ganglia + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..01453b00568d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Tyler Langlois <ty |at| tjll |dot| net> + +pkgname=ganglia +pkgver=3.7.1 +pkgrel=3 +pkgdesc="A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids." +arch=('i686' 'x86_64' 'armv6h') +url="http://${pkgname}.sourceforge.net/" +license=('BSD') +depends=('apr' 'confuse' '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" + 'ganglia.install' + 'ganglia.sysusers' + 'uid.patch' + 'runstatedir.patch') +sha256sums=('e735a6218986a0ff77c737e5888426b103196c12dc2d679494ca9a4269ca69a3' + '79df856f3b0623e736ea9c1f5c36c321769d6f161c85faf31fab3d7b872d6725' + '34506cdaab1a6250c9a0d6d9fb9c6a0a0dfe1187bcb0a5d6ca71491007116d05' + 'dc2cdffaf0cbedbbac2e654843803423f93da494aaeecda8a185ad3badea8e21' + 'e3abe8017bf3d974e2b4ba5e285e7a91e94dbb69ec6fdf128675a8868e28c8a4') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + for patch in $srcdir/*.patch; do + msg2 "Applying $(basename $patch)" + patch -Np1 -i $patch + done +} + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --libdir=/usr/lib \ + --sysconfdir=/etc/ganglia \ + --enable-gexec \ + --enable-status \ + --with-gmetad \ + --with-python=/usr/bin/python2 \ + --with-systemdsystemunitdir=/usr/lib/systemd/system + + make +} + +package() { + 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" + + install -Dm755 -d /var/lib/ganglia{,/rrds} + install -Dm644 COPYING "$pkgdir/usr/share/licenses/${pkgname}/COPYING" + + # See man page for sysusers.d(5) + install -Dm644 "$srcdir"/ganglia.sysusers \ + "$pkgdir"/usr/lib/sysusers.d/ganglia.conf +} diff --git a/ganglia.install b/ganglia.install new file mode 100644 index 000000000000..20620db24d61 --- /dev/null +++ b/ganglia.install @@ -0,0 +1,27 @@ +# Arg 1: the new package version +post_install() { + + # 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() { + 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 "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/ganglia.sysusers b/ganglia.sysusers new file mode 100644 index 000000000000..1041974e606f --- /dev/null +++ b/ganglia.sysusers @@ -0,0 +1 @@ +u ganglia - - /var/lib/ganglia diff --git a/runstatedir.patch b/runstatedir.patch new file mode 100644 index 000000000000..f823e378889e --- /dev/null +++ b/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/uid.patch b/uid.patch new file mode 100644 index 000000000000..1655490336af --- /dev/null +++ b/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) |