summaryrefslogtreecommitdiff
path: root/pcr/ha-glue
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/ha-glue')
-rw-r--r--pcr/ha-glue/PKGBUILD97
-rw-r--r--pcr/ha-glue/ha-glue.install22
-rw-r--r--pcr/ha-glue/ha-logd.service10
3 files changed, 129 insertions, 0 deletions
diff --git a/pcr/ha-glue/PKGBUILD b/pcr/ha-glue/PKGBUILD
new file mode 100644
index 000000000..20ecce83d
--- /dev/null
+++ b/pcr/ha-glue/PKGBUILD
@@ -0,0 +1,97 @@
+# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>
+
+pkgname=ha-glue
+_pkgname=${pkgname:3}
+pkgver=1.0.11
+pkgrel=1
+pkgdesc='A set of libraries, tools and utilities suitable for the Heartbeat/Pacemaker cluster stack.'
+arch=(
+ i686
+ x86_64
+ mips64el
+)
+url=http://linux-ha.org/wiki/Cluster_${_pkgname^}
+license=GPL
+depends=(
+ curl
+ glib2
+ libaio
+ libtool
+ libxml2
+ net-snmp
+ python2
+ util-linux
+)
+source=(
+ http://hg.linux-ha.org/$_pkgname/archive/$_pkgname-$pkgver.tar.bz2
+ ha-logd.service
+)
+sha512sums=(
+ 35ac8ac555c39f24c11e3a768cc50eba051fe617edf4cdc0429dac73f45a472f144cfe6ec5faff575606f2b04ff76a2f732556d848b61410c2683d93ba928413
+ 9252472a6d7a1bbad765c63becdec4064d882b1eb98abdf27833a6e06d8750f06663b2460d32a4c72d04f10a7480ef0a2093b8a18b4d1fc62a989cde54ee056a
+)
+install=$pkgname.install
+options=(
+ '!libtool'
+ docs
+)
+
+prepare() {
+ export _CLUSTER_USER=hacluster
+ export _CLUSTER_GROUP=haclient
+ _DGID=666
+ _DUID=666
+
+ #verify the cluster user and group
+ if ! getent group $_CLUSTER_GROUP >/dev/null;then
+ msg 'BEFORE COMPILE THIS SOFTWARE YOU MUST CREATE A CLUSTER GROUP, EXECUTE AS ROOT:'
+ echo -e "# groupadd -r -g $_DGID $_CLUSTER_GROUP\n"
+ _EXITCODE=1
+ fi
+ if ! getent passwd $_CLUSTER_USER >/dev/null;then
+ msg 'BEFORE COMPILE THIS SOFTWARE YOU MUST CREATE A CLUSTER USER, EXECUTE AS ROOT:'
+ echo -e "# useradd -r -g $_CLUSTER_GROUP -u $_DUID -d /var/lib/heartbeat/cores/$_CLUSTER_USER -s /sbin/nologin -c \"cluster user\" $_CLUSTER_USER\n"
+ _EXITCODE=1
+ fi
+ if [[ $_EXITCODE -eq 1 ]] ;then
+ return 1
+ fi
+
+ cd $srcdir/Reusable-Cluster-Components-$_pkgname--$_pkgname-$pkgver
+ sed -i 's|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|' configure.ac
+}
+
+build() {
+ cd $srcdir/Reusable-Cluster-Components-$_pkgname--$_pkgname-$pkgver
+ sed -i 's/<glib\/gtypes\.h>/<glib\.h>/g' include/clplumbing/cl_uuid.h
+ setarch $CARCH ./autogen.sh
+ setarch $CARCH ./configure --prefix=/usr\
+ --enable-fatal-warnings=no\
+ --libexecdir=/usr/lib/$pkgname\
+ --localstatedir=/var\
+ --sysconfdir=/etc\
+ --with-daemon-group=$_CLUSTER_GROUP\
+ --with-daemon-user=$_CLUSTER_USER
+ setarch $CARCH make
+}
+
+package() {
+ cd $srcdir/Reusable-Cluster-Components-$_pkgname--$_pkgname-$pkgver
+ setarch $CARCH make DESTDIR=$pkgdir install
+
+ #python path correction
+ for py in `grep -r -l "\#\!\/usr\/bin\/python" $pkgdir`;do
+ sed -i 's:/usr/bin/python$:/usr/bin/python2:g' $py
+ done
+ for py in `grep -r -l "\#\!\/usr\/bin\/env python" $pkgdir`;do
+ sed -i 's:/usr/bin/env python$:/usr/bin/env python2:g' $py
+ done
+ #end python path correction
+
+ install -d $pkgdir/usr/lib/systemd/system
+ install -Dm644 $srcdir/ha-logd.service $pkgdir/usr/lib/systemd/system
+
+ msg 'AFTER COMPILE THIS SOFTWARE YOU MUST DELETE A CLUSTER USER AND A CLUSTER GROUP, EXECUTE AS ROOT:'
+ echo -e "# userdel $_CLUSTER_USER"
+ echo -e "# groupdel $_CLUSTER_GROUP"
+}
diff --git a/pcr/ha-glue/ha-glue.install b/pcr/ha-glue/ha-glue.install
new file mode 100644
index 000000000..abfedb7c4
--- /dev/null
+++ b/pcr/ha-glue/ha-glue.install
@@ -0,0 +1,22 @@
+_CLUSTER_USER=hacluster
+_CLUSTER_GROUP=haclient
+_PREFIX=/usr
+_PREFIXETC=/etc
+_PREFIXVAR=/var
+_LCRSODIR=$PREFIX/libexec/lcrso
+_DGID=666
+_DUID=666
+pre_install() {
+ getent group $_CLUSTER_GROUP >/dev/null || groupadd -r -g $_DGID $_CLUSTER_GROUP
+ getent passwd $_CLUSTER_USER >/dev/null || useradd -r -g $_CLUSTER_GROUP -u $_DUID -d /var/lib/heartbeat/cores/hacluster -s /sbin/nologin -c "cluster user" ${_CLUSTER_USER}
+}
+
+post_install() {
+ echo -e "\nNow you must install ha-resourceagent, ha-heartbeat and ha-pacemaker\n"
+
+}
+post_remove() {
+ echo -e "\nDeleting user $_CLUSTER_USER and group $_CLUSTER_GROUP "
+ userdel $_CLUSTER_USER
+ groupdel $_CLUSTER_GROUP
+}
diff --git a/pcr/ha-glue/ha-logd.service b/pcr/ha-glue/ha-logd.service
new file mode 100644
index 000000000..1847d8cdd
--- /dev/null
+++ b/pcr/ha-glue/ha-logd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Startup script logd service.
+Requires=network.target remote-fs.target
+
+[Service]
+Type=forking
+ExecStart=/usr/lib/heartbeat/ha_logd
+
+[Install]
+WantedBy=multi-user.target