summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9a72494e87472210a2589f54eec60ed8164a1474 (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
# Maintainer: Tim Meusel <tim@bastelfreak.de>
# Contributor: Eric Renfro <erenfro@gmail.com>

pkgname=ha-heartbeat
pkgver=3.0.6
pkgrel=1
pkgdesc="Daemon that provides cluster infrastructure services to its clients"
arch=('x86_64')
url="http://linux-ha.org/wiki/Heartbeat"
license=('GPL')
makedepends=('docbook-xsl')
depends=('ha-glue' 'gnutls' 'python2')
source=("heartbeat-${pkgver}::hg+http://hg.linux-ha.org/heartbeat-STABLE_3_0#tag=STABLE-3.0.6")
md5sums=('SKIP')
options=('!emptydirs')
build() {
  cd "${srcdir}/heartbeat-${pkgver}"

  ./bootstrap
  # PYTHON is an available env var, listed by ./configure --help
  # but it doesn't seem to change anything
  PYTHON=python2 ./configure \
    --prefix=/usr \
    --localstatedir=/var \
    --sysconfdir=/etc \
    --without-initdir \
    --enable-valgrind \
    --enable-pretty \
    --enable-traditional-warnings \
    --enable-fatal-warnings
  make
}
package() {
  cd "${srcdir}/heartbeat-${pkgver}"
  # PYTHON env var is used py py-compile, but "make install" doesn't forward the var to it
  # so we can't modify it and have to patch it
  sed -i 's#$PYTHON#/usr/bin/python2#g' py-compile

  make DESTDIR="${pkgdir}" install

  grep -rZl '/usr/bin/python' "${pkgdir}" | xargs -0 -i sed -i 's:/usr/bin/python$:/usr/bin/python2:g' {}
  grep -rZl '/usr/bin/env python' "${pkgdir}" | xargs -0 -i sed -i 's:/usr/bin/env python$:/usr/bin/env python2:g' {}
  # this option isn't supported anymore in systemd
  sed -i '/SysVStartPriority=99/d' "${pkgdir}/usr/lib/systemd/system/heartbeat.service"
}