summaryrefslogtreecommitdiff
path: root/pcr/cluster-glue
diff options
context:
space:
mode:
authorMárcio Alexandre Silva Delgado <coadde@lavabit.com>2013-05-27 04:47:14 -0300
committerMárcio Alexandre Silva Delgado <coadde@lavabit.com>2013-05-27 04:47:14 -0300
commit03649cd046aa9f240dbd167956c9238f3c1554a8 (patch)
tree990829dba6f62595c3b998a8eca714ca02e027b5 /pcr/cluster-glue
parenta561ee416b272c16e8e18dc36d7aca7eed680c06 (diff)
cluster-glue(ha-glue): fixing pkg
Diffstat (limited to 'pcr/cluster-glue')
-rw-r--r--pcr/cluster-glue/PKGBUILD160
-rw-r--r--pcr/cluster-glue/cluster-glue.install17
2 files changed, 177 insertions, 0 deletions
diff --git a/pcr/cluster-glue/PKGBUILD b/pcr/cluster-glue/PKGBUILD
new file mode 100644
index 000000000..89b0af8ee
--- /dev/null
+++ b/pcr/cluster-glue/PKGBUILD
@@ -0,0 +1,160 @@
+# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>
+
+pkgname=cluster-glue
+_pkgname1=${pkgname::7}
+_pkgname2=${pkgname:8}
+_pkgname=${_pkgname1^}_${_pkgname2^}
+_grpname=linux-ha
+pkgver=1.0.11
+pkgrel=8
+pkgdesc='Set of libraries, tools and utilities suitable for the Heartbeat/Pacemaker cluster stack'
+arch=(
+ i686
+ x86_64
+ mips64el
+)
+url=http://$_grpname.org/wiki/$_pkgname
+license=(
+ GPL2
+ LGPL2.1
+)
+group=$_grpname
+depends=(
+ curl
+ dbus-glib
+ glib2
+ libaio
+ libesmtp
+ libltdl
+ libnet
+ libxml2
+ net-snmp
+ openhpi
+ #openipmi
+ python
+ util-linux
+ #vacm
+)
+optdepends=(
+ net-tools
+ openssh
+)
+makedepends=(
+ help2man
+ libxslt
+ lynx
+ net-tools
+ openssh
+ valgrind
+ w3m
+)
+provides=ha-$_pkgname2
+conflicts=ha-$_pkgname2
+replaces=ha-$_pkgname2
+install=$pkgname.install
+source=http://hg.$_grpname.org/$_pkgname2/archive/$_pkgname2-$pkgver.tar.bz2
+sha512sums=35ac8ac555c39f24c11e3a768cc50eba051fe617edf4cdc0429dac73f45a472f144cfe6ec5faff575606f2b04ff76a2f732556d848b61410c2683d93ba928413
+
+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-${_pkgname1^}-Components-$_pkgname2--$_pkgname2-$pkgver
+ sed -i 's|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|;
+ s| -O0||;
+ s|AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)|AM_INIT_AUTOMAKE|;
+ s|${localstatedir}/lock ${localstatedir}/spool/lock ${localstatedir}/spool/locks ${localstatedir}/lock|/run/lock|;
+ s|/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin|/usr/bin|;
+ ' configure.ac
+ sed -i 's|INCLUDES|AM_CPPFLAGS|;
+ ' $(grep -rl INCLUDES . | grep Makefile.am)
+ sed -i 's|bin/sh|usr/bin/bash|;
+ ' $(grep -rl bin/sh .)
+ sed -i 's|usr/sbin|usr/bin|;
+ ' $(grep -rl usr/bin .)
+ sed -i 's| /bin| /usr/bin|;
+ ' $(grep -rl ' /bin' .)
+ sed -i 's| /sbin| /usr/bin|;
+ ' $(grep -rl ' /sbin' .)
+ sed -i 's|/var/lock|/run/lock|;
+ ' $(grep -rl /var/lock .)
+ sed -i 's|var/run|run|;
+ ' $(grep -rl var/run)
+ sed -i 's|Open Source|Free Software|;
+ ' $(grep -rl 'Open Source' .)
+ sed -i 's|opensource|freesoftware|;
+ ' $(grep -rl 'opensource' .)
+ sed -i '/Solaris, FreeBSD and Linux/ s|Linux|GNU/Linux|;
+ /sysDescr.0 = STRING: Linux/ s|Linux|GNU/Linux|;
+ /works only on Linux./ s|Linux|GNU/Linux|;
+ /UNIX, Linux/ s|Linux|GNU/Linux|;
+ /Logging Daemon for High-Availability Linux/ s|Linux|GNU/Linux|;
+ /This is what the Linux/ s|Linux|GNU/Linux|;
+ /Compiling for Linux platform/ s|Linux|GNU/Linux|;
+ /Like Linux/ s|Linux|GNU/Linux|;
+ /(e.g. Linux)/ s|Linux|GNU/Linux|;
+ /Linux, Solaris/ s|Linux|GNU/Linux|;
+ /Linux and Compaq Tru64 Unix/ s|Linux|GNU/Linux|;
+ ' $(grep -rl Linux .)
+}
+
+build() {
+ cd $srcdir/Reusable-${_pkgname1^}-Components-$_pkgname2--$_pkgname2-$pkgver
+ setarch $CARCH ./autogen.sh
+ setarch $CARCH ./configure --prefix=/usr\
+ --disable-ansi\
+ --disable-fatal-warnings\
+ --enable-doc\
+ --enable-libnet\
+ --enable-upstart\
+ --libdir=/usr/lib\
+ --localstatedir=/var\
+ --sbindir=/usr/bin\
+ --sysconfdir=/etc\
+ --with-daemon-group=haclient\
+ --with-daemon-user=hacluster\
+ --with-ocf-root=/usr/lib/ocf
+ setarch $CARCH make
+}
+
+package() {
+ cd $srcdir/Reusable-${_pkgname1^}-Components-$_pkgname2--$_pkgname2-$pkgver
+ setarch $CARCH make DESTDIR=$pkgdir install
+
+ rm $pkgdir/etc/rc.d/logd && rmdir $pkgdir/etc{/rc.d,}
+
+ install -d $pkgdir/usr/lib/systemd/system
+ echo '[Unit]' > $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo 'Description=Startup script logd service' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo 'Requires=network.target remote-fs.target' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo '' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo '[Service]' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo 'Type=forking' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo 'ExecStart=/usr/lib/heartbeat/ha_logd' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo '' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo '[Install]' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+ echo 'WantedBy=multi-user.target' >> $pkgdir/usr/lib/systemd/system/ha_log.service
+
+ 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"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/cluster-glue/cluster-glue.install b/pcr/cluster-glue/cluster-glue.install
new file mode 100644
index 000000000..05e2160d3
--- /dev/null
+++ b/pcr/cluster-glue/cluster-glue.install
@@ -0,0 +1,17 @@
+_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 'Now you must install ha-resourceagent, ha-heartbeat and ha-pacemaker'
+}
+post_remove() {
+ echo -e "Deleting user $_CLUSTER_USER and group $_CLUSTER_GROUP"
+ userdel $_CLUSTER_USER && groupdel $_CLUSTER_GROUP
+}