sanlock: port to setuptools

Port setup.py to setuptools as distutils is now deprecated.

Also, set S to the top of the git repo and use SETUPTOOLS_SETUP_PATH
to run the correct script, which means paths outside of the Python
module are neater.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Ross Burton
2022-01-14 16:55:39 +00:00
committed by Khem Raj
parent b298118df9
commit 08b6679ad0
2 changed files with 28 additions and 9 deletions
@@ -0,0 +1,18 @@
Switch to setuptools as distutils is deprecated.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/python/setup.py b/python/setup.py
index b3bfaf1..dfbaf21 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -4,7 +4,7 @@
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
sanlocklib = ['sanlock']
sanlock = Extension(name='sanlock',
@@ -9,31 +9,32 @@ HOMEPAGE = "https://pagure.io/sanlock"
SECTION = "utils"
LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
LIC_FILES_CHKSUM = "file://../README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22"
LIC_FILES_CHKSUM = "file://README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22"
PV .= "+git${SRCPV}"
SRC_URI = "git://pagure.io/sanlock.git;protocol=http;branch=master \
file://0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch;patchdir=../ \
file://0001-sanlock-Replace-cp-a-with-cp-R-no-dereference-preser.patch \
file://setuptools.patch \
"
SRCREV = "a181e951376d49a82eef17920c8ebedec80b4823"
S = "${WORKDIR}/git/python"
S = "${WORKDIR}/git"
DEPENDS = "libaio util-linux"
inherit distutils3 useradd
inherit setuptools3 useradd
do_configure[noexec] = "1"
SETUPTOOLS_SETUP_PATH = "${S}/python"
do_compile:prepend () {
oe_runmake -C ${S}/../wdmd CMD_LDFLAGS="${LDFLAGS}" LIB_LDFLAGS="${LDFLAGS}"
oe_runmake -C ${S}/../src CMD_LDFLAGS="${LDFLAGS}" LIB_ENTIRE_LDFLAGS="${LDFLAGS}" LIB_CLIENT_LDFLAGS="${LDFLAGS}"
oe_runmake -C ${S}/wdmd CMD_LDFLAGS="${LDFLAGS}" LIB_LDFLAGS="${LDFLAGS}"
oe_runmake -C ${S}/src CMD_LDFLAGS="${LDFLAGS}" LIB_ENTIRE_LDFLAGS="${LDFLAGS}" LIB_CLIENT_LDFLAGS="${LDFLAGS}"
}
do_install:prepend () {
oe_runmake -C ${S}/../wdmd DESTDIR=${D} LIBDIR=${libdir} install
oe_runmake -C ${S}/../src DESTDIR=${D} LIBDIR=${libdir} install
oe_runmake -C ${S}/wdmd DESTDIR=${D} LIBDIR=${libdir} install
oe_runmake -C ${S}/src DESTDIR=${D} LIBDIR=${libdir} install
}
SANLOCKGROUP ?= "sanlock"