summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilosD2015-07-05 11:53:30 +0200
committerMilosD2015-07-05 11:53:30 +0200
commit2563961d2ae76a996d0187b0716b526bc30957a7 (patch)
tree65332a66494b99c5d491ce949cebceb83fa67314
downloadaur-2563961d2ae76a996d0187b0716b526bc30957a7.tar.gz
ha-glue first push
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD70
-rw-r--r--ha-glue.install25
3 files changed, 121 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8aeed9c48424
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = ha-glue
+ pkgdesc = A set of libraries, tools and utilities suitable for the Heartbeat/Pacemaker cluster stack.
+ pkgver = 1.0.12
+ pkgrel = 1
+ url = http://linux-ha.org/wiki/Cluster_Glue
+ install = ha-glue.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = net-snmp
+ depends = python2
+ depends = libxml2
+ depends = libtool
+ depends = util-linux-ng
+ depends = curl
+ depends = glib2
+ depends = asciidoc
+ options = !libtool
+ options = docs
+ source = http://hg.linux-ha.org/glue/archive/glue-1.0.12.tar.bz2
+ source = ha-glue.install
+ md5sums = ec620466d6f23affa3b074b72bca7870
+ md5sums = b3e3b0e1f6d0e1e6748c1d463d9f3bf4
+
+pkgname = ha-glue
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..03cf7ff4a9b7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,70 @@
+# Maintainer: gls < ghostlovescorebg at gmail dot com >
+
+pkgname=ha-glue
+pkgver=1.0.12
+pkgrel=1
+pkgdesc="A set of libraries, tools and utilities suitable for the Heartbeat/Pacemaker cluster stack."
+arch=('i686' 'x86_64')
+url="http://linux-ha.org/wiki/Cluster_Glue"
+license=('GPL')
+depends=('net-snmp'
+ 'python2'
+ 'libxml2'
+ 'libtool'
+ 'util-linux-ng'
+ 'curl'
+ 'glib2'
+ 'asciidoc')
+source=("http://hg.linux-ha.org/glue/archive/glue-${pkgver}.tar.bz2"
+ "ha-glue.install")
+md5sums=('ec620466d6f23affa3b074b72bca7870'
+ 'b3e3b0e1f6d0e1e6748c1d463d9f3bf4')
+install='ha-glue.install'
+options=('!libtool' 'docs')
+
+build() {
+ _CLUSTER_USER=hacluster
+ _CLUSTER_GROUP=haclient
+ _PREFIXETC=/etc
+ _PREFIXINIT=${_PREFIXETC}/rc.d
+ _PREFIXVAR=/var
+ _DGID=666
+ _DUID=666
+
+ #verify the cluster user and group
+ if ! getent group ${_CLUSTER_GROUP} >/dev/null;then
+ echo -e "\nBEFORE 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
+ echo -e "\nBEFORE 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/hacluster -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-glue--glue-${pkgver}"
+ sed -i 's/<glib\/gtypes\.h>/<glib\.h>/g' include/clplumbing/cl_uuid.h
+ ./autogen.sh
+ ./configure --sbindir=/usr/bin --libdir=/usr/lib --with-daemon-user=${_CLUSTER_USER} --with-daemon-group=${_CLUSTER_GROUP} --enable-fatal-warnings=no
+ #sed -i 's/lib64\ //g' configure.ac
+ make
+}
+
+package() {
+ cd "${srcdir}/Reusable-Cluster-Components-glue--glue-${pkgver}"
+ 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
+}
+
diff --git a/ha-glue.install b/ha-glue.install
new file mode 100644
index 000000000000..dbc46f1e5f64
--- /dev/null
+++ b/ha-glue.install
@@ -0,0 +1,25 @@
+_CLUSTER_USER=hacluster
+_CLUSTER_GROUP=haclient
+_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}
+
+}