summaryrefslogtreecommitdiff
path: root/pcr/ganglia/PKGBUILD
blob: f5a900b8893e6826d30927ca3b4f2dafd1d4a741 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>

pkgname=ganglia
pkgver=3.6.0
pkgrel=2
pkgdesc="A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids."
arch=('i686' 'x86_64')
url="http://ganglia.sourceforge.net/"
license=('BSD')
depends=('apr' 'confuse' 'expat' 'pcre' '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/ganglia/$pkgname-$pkgver.tar.gz" 
        'gmond.rc'
        'gmetad.rc'
        'gmond.service'
        'gmetad.service'
        'ganglia.install'
        'uid.patch')
md5sums=('05926bb18c22af508a3718a90b2e9a2c'
         '12b2f85361754eaf6fc5129cccec7034'
         '292b74a5a09a0bd9a4a658823adc034b'
         '25ebc6cf829089a9f330ad177befdd45'
         'd795bca44fb73cdf8a2b550e27c50b6f'
         'acad2273520f13f4d0638ca9109ca2d8'
         'a0d469dd2b9ec40dbe20377c51ca904c')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  for patch in $srcdir/*.patch; do
    msg2 "Applying $(basename $patch)"
    patch -Np1 -i $patch
  done

  # FIXME: Hopefully this will soon no longer be required?
  msg2 "Copying systemd units into source as workaround for bug"
  cp "$srcdir/gmond.service" "$srcdir/$pkgname-$pkgver/gmond/gmond.service.in"
  cp "$srcdir/gmetad.service" "$srcdir/$pkgname-$pkgver/gmetad/gmetad.service.in"
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc/ganglia \
              --with-gmetad --enable-gexec --enable-status \
              --with-python=/usr/bin/python2
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install

  # Move sbin to bin
  mv "$pkgdir/usr/sbin"/* "$pkgdir/usr/bin/"
  rmdir "$pkgdir/usr/sbin"

  mkdir -p "$pkgdir/usr/lib/ganglia/python_modules"

  msg2 "Generating default gmond.conf"
  ./gmond/gmond --default_config > "$pkgdir/etc/ganglia/gmond.conf"
  
  # Uncomment these lines to install the rc files
  #install -m 755 -D "$srcdir/gmond.rc" "$pkgdir/etc/rc.d/gmond"
  #install -m 755 -D "$srcdir/gmetad.rc" "$pkgdir/etc/rc.d/gmetad"
}