xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-networking/recipes-extended/tgt/tgt_git.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1DESCRIPTION = "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
7SRCREV = "b43dbc6711e43c0a32cc4d9df22884841d911d51"
8PV = "1.0.79+git${SRCPV}"
9
10SRC_URI = "git://github.com/fujita/tgt.git;branch=master;protocol=https \
11	file://0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch \
12        file://0001-usr-Makefile-WARNING-fix.patch \
13        file://usr-Makefile-apply-LDFLAGS-to-all-executables.patch \
14"
15SRC_URI += "file://tgtd.init \
16            file://tgtd.service \
17            file://tgtd \
18"
19
20S = "${WORKDIR}/git"
21
22COMPATIBLE_HOST:libc-musl = "null"
23
24CONFFILES:${PN} += "${sysconfdir}/tgt/targets.conf"
25
26inherit update-rc.d systemd
27
28SYSTEMD_SERVICE:${PN} = "tgtd.service"
29SYSTEMD_AUTO_ENABLE:${PN} = "disable"
30
31CFLAGS += ' -I. -DUSE_SIGNALFD -DUSE_TIMERFD -D_GNU_SOURCE -DTGT_VERSION=\\"1.0.63\\" -DBSDIR=\\"${libdir}/backing-store\\"'
32
33#do_compile() {
34#    oe_runmake SYSROOT="${STAGING_DIR_TARGET}" -e programs conf scripts
35#}
36EXTRA_OEMAKE = "-e programs conf scripts"
37
38do_install() {
39    oe_runmake -e DESTDIR="${D}" install-programs install-conf install-scripts
40
41    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
42        install -d ${D}${sysconfdir}/init.d
43        install -m 0755 ${WORKDIR}/tgtd.init ${D}${sysconfdir}/init.d/tgtd
44    elif ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
45        install -d ${D}${systemd_unitdir}/system
46        install -m 0644 ${WORKDIR}/tgtd.service ${D}${systemd_unitdir}/system/tgtd.service
47        install -d ${D}${sysconfdir}/sysconfig
48        install -m 0644 ${WORKDIR}/tgtd ${D}${sysconfdir}/sysconfig/tgtd
49        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tgtd.service
50        sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/tgtd.service
51        sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/tgtd.service
52    fi
53}
54
55FILES:${PN} += "${systemd_unitdir}/system/tgtd.service \
56                ${sysconfdir}/sysconfig/tgtd \
57"
58
59RDEPENDS:${PN} = " \
60    bash \
61    libaio \
62    libconfig-general-perl \
63    perl \
64    perl-module-english \
65    perl-module-tie-hash-namedcapture \
66    perl-module-xsloader \
67    perl-module-carp \
68    perl-module-exporter \
69    perl-module-errno \
70    perl-module-exporter-heavy \
71    perl-module-symbol \
72    perl-module-selectsaver \
73    perl-module-dynaloader \
74    perl-module-carp-heavy \
75    perl-module-filehandle \
76    perl-module-feature \
77    perl-module-overload \
78    perl-module-fcntl \
79    perl-module-io \
80    perl-module-io-file \
81    perl-module-io-handle \
82    perl-module-io-seekable \
83    perl-module-file-glob \
84    perl-module-base \
85    perl-module-encoding-warnings \
86    perl-module-file-spec-unix \
87    perl-module-file-spec \
88    perl-module-file-spec-functions \
89    perl-module-getopt-long \
90    perl-module-constant \
91    "
92INITSCRIPT_PACKAGES = "${PN}"
93INITSCRIPT_NAME:${PN} = "tgtd"
94
95