blob: 4891fd187d01f8e204c49371ee1bfccc9a352b9c [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "lio-utils"
2DESCRIPTION = "a simple low-level configuration tool set for the Target+iSCSI (LIO)"
3HOMEPAGE = "http://linux-iscsi.org/index.php/Lio-utils"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://debian/copyright;md5=c3ea231a32635cbb5debedf3e88aa3df"
6
7PV = "4.1+git${SRCPV}"
8
Brad Bishop19323692019-04-05 15:28:33 -04009SRC_URI = "git://github.com/Datera/lio-utils.git \
Brad Bishop7f28bc52017-12-03 23:42:40 -050010 file://0001-Makefiles-Respect-environment-variables-and-add-LDFL.patch \
11 "
Brad Bishop19323692019-04-05 15:28:33 -040012SRCREV = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050013S = "${WORKDIR}/git"
14
Andrew Geissler82c905d2020-04-13 13:39:40 -050015inherit ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "distutils", "", d)}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050016
17EXTRA_OEMAKE += "DESTDIR=${D}"
18
19do_compile() {
20 cd ${S}/tcm-py
21 distutils_do_compile
22
23 cd ${S}/lio-py
24 distutils_do_compile
25
26 if test -d ${S}/tools; then
27 oe_runmake -C ${S}/tools
28 fi
29}
30
31do_install() {
32 cd ${S}/tcm-py
33 distutils_do_install
34
35 cd ${S}/lio-py
36 distutils_do_install
37
38 SITE_PACKAGES=${D}/${PYTHON_SITEPACKAGES_DIR}
39 install -d ${D}/${sbindir}
40 for var in tcm_node tcm_dump tcm_loop tcm_fabric lio_dump lio_node; do
41 if [ ! -h ${D}/${sbindir}/${var} ];then
42 chmod a+x ${SITE_PACKAGES}/${var}.py
43 ln -s ${PYTHON_SITEPACKAGES_DIR}/${var}.py ${D}/${sbindir}/${var}
44 fi
45 done
46
47 if test -d ${S}/tools; then
48 oe_runmake -C ${S}/tools install
49 fi
50
51 install -d ${D}/etc/target/
52 install -d ${D}/etc/init.d/
53 install -m 755 ${S}/scripts/rc.target ${D}/etc/init.d/
54 install -m 755 ${S}/conf/tcm_start.default ${D}/etc/target/tcm_start.sh
55 install -m 755 ${S}/conf/lio_start.default ${D}/etc/target/lio_start.sh
56}
57
Andrew Geissler32b11992021-03-31 13:37:05 -050058PNBLACKLIST[lio-utils] ?= "${@bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', '', 'python2 is out of support for long time, read https://www.python.org/doc/sunset-python-2/ https://python3statement.org/ and if you really have to temporarily use this, then set I_SWEAR_TO_MIGRATE_TO_PYTHON3 to "yes"', d)}"
59
Patrick Williamsb48b7b42016-08-17 15:04:38 -050060RDEPENDS_${PN} += "python-stringold python-subprocess python-shell \
61 python-datetime python-textutils python-crypt python-netclient python-email \
62 bash"
63
64FILES_${PN} += "${sbindir}/* /etc/init.d/* /etc/target/*"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080065
66# http://errors.yoctoproject.org/Errors/Details/184712/
67# python-native/python: can't open file 'setup.py': [Errno 2] No such file or directory
68CLEANBROKEN = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069
70python() {
71 if 'meta-python2' not in d.getVar('BBFILE_COLLECTIONS').split():
72 raise bb.parse.SkipRecipe('Requires meta-python2 to be present.')
73}
74
75