1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{5,6} )
7 inherit linux-info python-r1 systemd user
9 DESCRIPTION="shared storage lock manager"
10 HOMEPAGE="https://pagure.io/sanlock"
11 SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
13 LICENSE="LGPL-2+ GPL-2 GPL-2+"
15 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
23 python? ( ${PYTHON_DEPS} )
28 local warning="You need to have CONFIG_SOFT_WATCHDOG enabled in your kernel for wdmd"
29 if linux_config_exists; then
30 if ! linux_chkconfig_present SOFT_WATCHDOG; then
37 ewarn "Could not be checked automatically: $warning"
44 enewuser sanlock -1 -1 -1 sanlock,disk
49 for d in wdmd src fence_sanlock reset; do
53 cd python; python_foreach_impl emake; cd ..
58 for d in wdmd src fence_sanlock reset; do
59 cd $d; emake DESTDIR="${D}" LIBDIR="${EROOT}usr/$(get_libdir)" install; cd ..
62 cd python; python_foreach_impl emake DESTDIR="${D}" install; cd ..
69 doins src/sanlock.conf
72 newconfd init.d/sanlock.sysconfig sanlock
73 newconfd init.d/wdmd.sysconfig wdmd
74 newinitd "${FILESDIR}"/sanlock.initd sanlock
75 newinitd "${FILESDIR}"/wdmd.initd wdmd
76 #doinitd ${FILESDIR}/sanlk-resetd.initd
77 #doinitd ${FILESDIR}/fence_sanlockd.initd
80 systemd_newunit init.d/sanlock.service.native sanlock.service
81 sed -i 's,^ExecStartPre=,#ExecStartPre=,' init.d/wdmd.service.native
82 systemd_newunit init.d/wdmd.service.native wdmd.service
83 systemd_dounit init.d/sanlk-resetd.service
84 #systemd_dounit ${FILESDIR}/fence_sanlockd.service