diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-05-28 20:25:49 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2013-05-28 20:25:49 -0300 |
commit | beb8b1041efbb1bce8e7c2e0aa734d3170eee21e (patch) | |
tree | 23323258a59896b3f78f3ed040414e722b07b599 /pcr/cluster-glue/PKGBUILD | |
parent | 4ba9ed4027db9fcbf6dd137f8b97c97cdeacf227 (diff) | |
parent | 53057357cf767bb5e7999628620a916769671d27 (diff) | |
download | abslibre-beb8b1041efbb1bce8e7c2e0aa734d3170eee21e.tar.gz abslibre-beb8b1041efbb1bce8e7c2e0aa734d3170eee21e.tar.bz2 abslibre-beb8b1041efbb1bce8e7c2e0aa734d3170eee21e.zip |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'pcr/cluster-glue/PKGBUILD')
-rw-r--r-- | pcr/cluster-glue/PKGBUILD | 160 |
1 files changed, 160 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: |