Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/sanlock/, sys-cluster/sanlock/files/
Date: Mon, 02 Jan 2017 00:17:47
Message-Id: 1483316234.54c9e81337a454689d400a290d416f4590d32c97.mschiff@gentoo
1 commit: 54c9e81337a454689d400a290d416f4590d32c97
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 00:16:38 2017 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 00:17:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54c9e813
7
8 sys-cluster/sanlock: added new package
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 sys-cluster/sanlock/Manifest | 1 +
13 sys-cluster/sanlock/files/sanlock.initd | 9 ++++
14 sys-cluster/sanlock/files/wdmd.initd | 12 +++++
15 sys-cluster/sanlock/metadata.xml | 12 +++++
16 sys-cluster/sanlock/sanlock-3.4.0.ebuild | 83 ++++++++++++++++++++++++++++++++
17 5 files changed, 117 insertions(+)
18
19 diff --git a/sys-cluster/sanlock/Manifest b/sys-cluster/sanlock/Manifest
20 new file mode 100644
21 index 00000000..7a3cd9c
22 --- /dev/null
23 +++ b/sys-cluster/sanlock/Manifest
24 @@ -0,0 +1 @@
25 +DIST sanlock-3.4.0.tar.xz 157016 SHA256 b4b18eb0af1bfc730a037f9da7dd84777c9a4ceb1a1ac2e577705124c4c9e891 SHA512 8a10faaa5b9ce9f0506ca16620ad482804c9ca860b84a60a6f0b525a256059229a202163d366a57fb59169c0f4f822ced570b42562e412747f6f716509341f19 WHIRLPOOL 500ccc9ab323bed28fc6b65dbdc04588deae03d3bb500ab623b9b922c436db896b793965bf4e780800138cd780d4fb659a952dc064bb01065e629c69062c330e
26
27 diff --git a/sys-cluster/sanlock/files/sanlock.initd b/sys-cluster/sanlock/files/sanlock.initd
28 new file mode 100644
29 index 00000000..30a5c1e
30 --- /dev/null
31 +++ b/sys-cluster/sanlock/files/sanlock.initd
32 @@ -0,0 +1,9 @@
33 +#!/sbin/openrc-run
34 +# Copyright 1999-2017 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +pidfile="/var/run/snlock.pid"
39 +command="/usr/sbin/snlock"
40 +command_args="daemon ${SANLOCKOPTS:-"-U sanlock -G sanlock"}"
41 +
42
43 diff --git a/sys-cluster/sanlock/files/wdmd.initd b/sys-cluster/sanlock/files/wdmd.initd
44 new file mode 100644
45 index 00000000..70140f0
46 --- /dev/null
47 +++ b/sys-cluster/sanlock/files/wdmd.initd
48 @@ -0,0 +1,12 @@
49 +#!/sbin/openrc-run
50 +# Copyright 1999-2017 Gentoo Foundation
51 +# Distributed under the terms of the GNU General Public License v2
52 +# $Id$
53 +
54 +pidfile="/var/run/wdmd.pid"
55 +command="/usr/sbin/wdmd"
56 +command_args="${WDMDOPTS:-"-G sanlock"}"
57 +
58 +start_pre() {
59 + $command -p || exit 1
60 +}
61
62 diff --git a/sys-cluster/sanlock/metadata.xml b/sys-cluster/sanlock/metadata.xml
63 new file mode 100644
64 index 00000000..f854e20
65 --- /dev/null
66 +++ b/sys-cluster/sanlock/metadata.xml
67 @@ -0,0 +1,12 @@
68 +<?xml version="1.0" encoding="UTF-8"?>
69 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
70 +<pkgmetadata>
71 + <maintainer type="person">
72 + <email>mschiff@g.o</email>
73 + <name>Marc Schiffbauer</name>
74 + </maintainer>
75 + <maintainer type="project">
76 + <email>cluster@g.o</email>
77 + <name>Gentoo Cluster Project</name>
78 + </maintainer>
79 +</pkgmetadata>
80
81 diff --git a/sys-cluster/sanlock/sanlock-3.4.0.ebuild b/sys-cluster/sanlock/sanlock-3.4.0.ebuild
82 new file mode 100644
83 index 00000000..9e0358e
84 --- /dev/null
85 +++ b/sys-cluster/sanlock/sanlock-3.4.0.ebuild
86 @@ -0,0 +1,83 @@
87 +# Copyright 1999-2017 Gentoo Foundation
88 +# Distributed under the terms of the GNU General Public License v2
89 +# $Id$
90 +
91 +EAPI=6
92 +
93 +PYTHON_COMPAT=( python2_7 python3_{4,5} )
94 +inherit linux-info python-r1 systemd user
95 +
96 +DESCRIPTION="shared storage lock manager"
97 +HOMEPAGE="https://fedorahosted.org/sanlock/"
98 +SRC_URI="https://git.fedorahosted.org/cgit/${PN}.git/snapshot/${P}.tar.xz"
99 +
100 +LICENSE="LGPL-2+ GPL-2 GPL-2+"
101 +SLOT="0"
102 +KEYWORDS="~amd64 ~x86"
103 +IUSE="python"
104 +
105 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
106 +
107 +DEPEND="
108 + sys-apps/util-linux
109 + python? ( ${PYTHON_DEPS} )
110 +"
111 +RDEPEND="${DEPEND}"
112 +
113 +pkg_setup() {
114 + local warning="You need to have CONFIG_SOFT_WATCHDOG enabled in your kernel for wdmd"
115 + if linux_config_exists; then
116 + if ! linux_chkconfig_present SOFT_WATCHDOG; then
117 + ewarn ""
118 + ewarn "$warning"
119 + ewarn ""
120 + fi
121 + else
122 + ewarn ""
123 + ewarn "Could not be checked automatically: $warning"
124 + ewarn ""
125 + fi
126 +}
127 +
128 +pkg_preinst() {
129 + enewuser sanlock
130 + enewgroup sanlock
131 +}
132 +
133 +src_compile() {
134 + for d in wdmd src fence_sanlock reset; do
135 + cd $d; emake; cd ..
136 + done
137 + if use python; then
138 + cd python; python_foreach_impl emake; cd ..
139 + fi
140 +}
141 +
142 +src_install() {
143 + for d in wdmd src fence_sanlock reset; do
144 + cd $d; emake DESTDIR="${D}" LIBDIR="${EROOT}usr/$(get_libdir)" install; cd ..
145 + done
146 + if use python; then
147 + cd python; python_foreach_impl emake DESTDIR="${D}" install; cd ..
148 + fi
149 +
150 + # config
151 + dodir /etc/wdmd.d
152 + dodir /etc/sanlock
153 + insinto /etc/sanlock
154 + doins src/sanlock.conf
155 +
156 + # init
157 + newconfd init.d/sanlock.sysconfig sanlock
158 + newconfd init.d/wdmd.sysconfig wdmd
159 + newinitd "${FILESDIR}"/sanlock.initd sanlock
160 + newinitd "${FILESDIR}"/wdmd.initd wdmd
161 + #doinitd ${FILESDIR}/sanlk-resetd.initd
162 + #doinitd ${FILESDIR}/fence_sanlockd.initd
163 +
164 + # systemd
165 + systemd_newunit init.d/sanlock.service.native sanlock.service
166 + systemd_newunit init.d/wdmd.service.native wdmd.service
167 + systemd_dounit init.d/sanlk-resetd.service
168 + #systemd_dounit ${FILESDIR}/fence_sanlockd.service
169 +}