blob: 35995f7876deccd942c9252f1438e5788d3a54d0 [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001DESCRIPTION = "Linux SCSI target framework (tgt)"
2HOMEPAGE = "http://stgt.sourceforge.net"
3LICENSE = "GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://scripts/tgtd.spec;beginline=7;endline=7;md5=21c19ea7dad04648b9c2f791b6e29b4c"
5DEPENDS = "sg3-utils libaio"
6
Patrick Williams705982a2024-01-12 09:51:57 -06007SRCREV = "df991fa788e22cd8b8e3013cfae306988c19c3d0"
Patrick Williams03907ee2022-05-01 06:28:52 -05008
9SRC_URI = "git://github.com/fujita/tgt.git;branch=master;protocol=https \
Patrick Williams705982a2024-01-12 09:51:57 -060010 file://0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch \
Patrick Williams03907ee2022-05-01 06:28:52 -050011 file://0001-usr-Makefile-WARNING-fix.patch \
12 file://usr-Makefile-apply-LDFLAGS-to-all-executables.patch \
Patrick Williams705982a2024-01-12 09:51:57 -060013 file://musl-__wordsize.patch \
Patrick Williams03907ee2022-05-01 06:28:52 -050014"
15SRC_URI += "file://tgtd.init \
16 file://tgtd.service \
17 file://tgtd \
18"
19
20S = "${WORKDIR}/git"
21
Patrick Williams03907ee2022-05-01 06:28:52 -050022CONFFILES:${PN} += "${sysconfdir}/tgt/targets.conf"
23
24inherit update-rc.d systemd
25
26SYSTEMD_SERVICE:${PN} = "tgtd.service"
27SYSTEMD_AUTO_ENABLE:${PN} = "disable"
28
29CFLAGS += ' -I. -DUSE_SIGNALFD -DUSE_TIMERFD -D_GNU_SOURCE -DTGT_VERSION=\\"1.0.63\\" -DBSDIR=\\"${libdir}/backing-store\\"'
30
Patrick Williams705982a2024-01-12 09:51:57 -060031CFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE"
Patrick Williams03907ee2022-05-01 06:28:52 -050032#do_compile() {
33# oe_runmake SYSROOT="${STAGING_DIR_TARGET}" -e programs conf scripts
34#}
35EXTRA_OEMAKE = "-e programs conf scripts"
36
37do_install() {
38 oe_runmake -e DESTDIR="${D}" install-programs install-conf install-scripts
39
40 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
41 install -d ${D}${sysconfdir}/init.d
42 install -m 0755 ${WORKDIR}/tgtd.init ${D}${sysconfdir}/init.d/tgtd
43 elif ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
44 install -d ${D}${systemd_unitdir}/system
45 install -m 0644 ${WORKDIR}/tgtd.service ${D}${systemd_unitdir}/system/tgtd.service
46 install -d ${D}${sysconfdir}/sysconfig
47 install -m 0644 ${WORKDIR}/tgtd ${D}${sysconfdir}/sysconfig/tgtd
48 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tgtd.service
49 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/tgtd.service
50 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/tgtd.service
51 fi
52}
53
54FILES:${PN} += "${systemd_unitdir}/system/tgtd.service \
55 ${sysconfdir}/sysconfig/tgtd \
56"
57
58RDEPENDS:${PN} = " \
59 bash \
60 libaio \
61 libconfig-general-perl \
62 perl \
63 perl-module-english \
64 perl-module-tie-hash-namedcapture \
65 perl-module-xsloader \
66 perl-module-carp \
67 perl-module-exporter \
68 perl-module-errno \
69 perl-module-exporter-heavy \
70 perl-module-symbol \
71 perl-module-selectsaver \
72 perl-module-dynaloader \
73 perl-module-carp-heavy \
74 perl-module-filehandle \
75 perl-module-feature \
76 perl-module-overload \
77 perl-module-fcntl \
78 perl-module-io \
79 perl-module-io-file \
80 perl-module-io-handle \
81 perl-module-io-seekable \
82 perl-module-file-glob \
83 perl-module-base \
84 perl-module-encoding-warnings \
85 perl-module-file-spec-unix \
86 perl-module-file-spec \
87 perl-module-file-spec-functions \
88 perl-module-getopt-long \
89 perl-module-constant \
90 "
91INITSCRIPT_PACKAGES = "${PN}"
92INITSCRIPT_NAME:${PN} = "tgtd"
93