From 54c9e81337a454689d400a290d416f4590d32c97 Mon Sep 17 00:00:00 2001 From: Marc Schiffbauer Date: Mon, 2 Jan 2017 01:16:38 +0100 Subject: sys-cluster/sanlock: added new package Package-Manager: Portage-2.3.3, Repoman-2.3.1 --- sys-cluster/sanlock/Manifest | 1 + sys-cluster/sanlock/files/sanlock.initd | 9 ++++ sys-cluster/sanlock/files/wdmd.initd | 12 +++++ sys-cluster/sanlock/metadata.xml | 12 +++++ sys-cluster/sanlock/sanlock-3.4.0.ebuild | 83 ++++++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 sys-cluster/sanlock/Manifest create mode 100644 sys-cluster/sanlock/files/sanlock.initd create mode 100644 sys-cluster/sanlock/files/wdmd.initd create mode 100644 sys-cluster/sanlock/metadata.xml create mode 100644 sys-cluster/sanlock/sanlock-3.4.0.ebuild (limited to 'sys-cluster/sanlock') diff --git a/sys-cluster/sanlock/Manifest b/sys-cluster/sanlock/Manifest new file mode 100644 index 00000000000..7a3cd9cb52e --- /dev/null +++ b/sys-cluster/sanlock/Manifest @@ -0,0 +1 @@ +DIST sanlock-3.4.0.tar.xz 157016 SHA256 b4b18eb0af1bfc730a037f9da7dd84777c9a4ceb1a1ac2e577705124c4c9e891 SHA512 8a10faaa5b9ce9f0506ca16620ad482804c9ca860b84a60a6f0b525a256059229a202163d366a57fb59169c0f4f822ced570b42562e412747f6f716509341f19 WHIRLPOOL 500ccc9ab323bed28fc6b65dbdc04588deae03d3bb500ab623b9b922c436db896b793965bf4e780800138cd780d4fb659a952dc064bb01065e629c69062c330e diff --git a/sys-cluster/sanlock/files/sanlock.initd b/sys-cluster/sanlock/files/sanlock.initd new file mode 100644 index 00000000000..30a5c1e56fd --- /dev/null +++ b/sys-cluster/sanlock/files/sanlock.initd @@ -0,0 +1,9 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +pidfile="/var/run/snlock.pid" +command="/usr/sbin/snlock" +command_args="daemon ${SANLOCKOPTS:-"-U sanlock -G sanlock"}" + diff --git a/sys-cluster/sanlock/files/wdmd.initd b/sys-cluster/sanlock/files/wdmd.initd new file mode 100644 index 00000000000..70140f00fde --- /dev/null +++ b/sys-cluster/sanlock/files/wdmd.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +pidfile="/var/run/wdmd.pid" +command="/usr/sbin/wdmd" +command_args="${WDMDOPTS:-"-G sanlock"}" + +start_pre() { + $command -p || exit 1 +} diff --git a/sys-cluster/sanlock/metadata.xml b/sys-cluster/sanlock/metadata.xml new file mode 100644 index 00000000000..f854e201fab --- /dev/null +++ b/sys-cluster/sanlock/metadata.xml @@ -0,0 +1,12 @@ + + + + + mschiff@gentoo.org + Marc Schiffbauer + + + cluster@gentoo.org + Gentoo Cluster Project + + diff --git a/sys-cluster/sanlock/sanlock-3.4.0.ebuild b/sys-cluster/sanlock/sanlock-3.4.0.ebuild new file mode 100644 index 00000000000..9e0358e91bd --- /dev/null +++ b/sys-cluster/sanlock/sanlock-3.4.0.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5} ) +inherit linux-info python-r1 systemd user + +DESCRIPTION="shared storage lock manager" +HOMEPAGE="https://fedorahosted.org/sanlock/" +SRC_URI="https://git.fedorahosted.org/cgit/${PN}.git/snapshot/${P}.tar.xz" + +LICENSE="LGPL-2+ GPL-2 GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="python" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + sys-apps/util-linux + python? ( ${PYTHON_DEPS} ) +" +RDEPEND="${DEPEND}" + +pkg_setup() { + local warning="You need to have CONFIG_SOFT_WATCHDOG enabled in your kernel for wdmd" + if linux_config_exists; then + if ! linux_chkconfig_present SOFT_WATCHDOG; then + ewarn "" + ewarn "$warning" + ewarn "" + fi + else + ewarn "" + ewarn "Could not be checked automatically: $warning" + ewarn "" + fi +} + +pkg_preinst() { + enewuser sanlock + enewgroup sanlock +} + +src_compile() { + for d in wdmd src fence_sanlock reset; do + cd $d; emake; cd .. + done + if use python; then + cd python; python_foreach_impl emake; cd .. + fi +} + +src_install() { + for d in wdmd src fence_sanlock reset; do + cd $d; emake DESTDIR="${D}" LIBDIR="${EROOT}usr/$(get_libdir)" install; cd .. + done + if use python; then + cd python; python_foreach_impl emake DESTDIR="${D}" install; cd .. + fi + + # config + dodir /etc/wdmd.d + dodir /etc/sanlock + insinto /etc/sanlock + doins src/sanlock.conf + + # init + newconfd init.d/sanlock.sysconfig sanlock + newconfd init.d/wdmd.sysconfig wdmd + newinitd "${FILESDIR}"/sanlock.initd sanlock + newinitd "${FILESDIR}"/wdmd.initd wdmd + #doinitd ${FILESDIR}/sanlk-resetd.initd + #doinitd ${FILESDIR}/fence_sanlockd.initd + + # systemd + systemd_newunit init.d/sanlock.service.native sanlock.service + systemd_newunit init.d/wdmd.service.native wdmd.service + systemd_dounit init.d/sanlk-resetd.service + #systemd_dounit ${FILESDIR}/fence_sanlockd.service +} -- cgit v1.2.1