1SUMMARY = "A shared storage lock manager"
2DESCRIPTION = "sanlock  is  a lock manager built on shared storage.  Hosts with access \
3to the storage can perform locking.   An  application  running  on  the \
4hosts  is  given  a small amount of space on the shared block device or \
5file, and uses sanlock for its  own  application-specific  synchronization. \
6Internally,  the  sanlock  daemon manages locks using two disk-based \
7lease algorithms: delta leases and paxos leases."
8HOMEPAGE = "https://pagure.io/sanlock"
9SECTION = "utils"
10
11LICENSE = "LGPL-2.0-or-later & GPL-2.0-only & GPL-2.0-or-later"
12LIC_FILES_CHKSUM = "file://README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22"
13
14PV .= "+git"
15
16SRC_URI = "git://pagure.io/sanlock.git;protocol=http;branch=master \
17           file://0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch \
18           file://0001-add-missing-system-header-string.h.patch \
19           file://0001-include-libgen.h-for-basename.patch \
20          "
21SRCREV = "ecf30a1ccf756776dfea440e4cf9b0b54581075f"
22
23S = "${WORKDIR}/git"
24
25CVE_STATUS[CVE-2012-5638] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions."
26
27DEPENDS = "libaio util-linux"
28
29inherit setuptools3 useradd
30
31SETUPTOOLS_SETUP_PATH = "${S}/python"
32
33do_compile:prepend () {
34    oe_runmake -C ${S}/wdmd CMD_LDFLAGS="${LDFLAGS}" LIB_LDFLAGS="${LDFLAGS}"
35    oe_runmake -C ${S}/src CMD_LDFLAGS="${LDFLAGS}" LIB_ENTIRE_LDFLAGS="${LDFLAGS}" LIB_CLIENT_LDFLAGS="${LDFLAGS}"
36}
37
38do_install:prepend () {
39    oe_runmake -C ${S}/wdmd DESTDIR=${D} LIBDIR=${libdir} install
40    oe_runmake -C ${S}/src DESTDIR=${D} LIBDIR=${libdir} install
41}
42
43SANLOCKGROUP ?= "sanlock"
44SANLOCKUSER ?= "sanlock"
45USERADD_PACKAGES = "${PN}"
46GROUPADD_PARAM:${PN} = "--system ${SANLOCKGROUP}"
47USERADD_PARAM:${PN} = "--system -g ${SANLOCKGROUP} -G disk \
48                       --home-dir /run/${SANLOCKUSER} --no-create-home \
49                       --shell /sbin/nologin ${SANLOCKUSER}"
50