blob: 0314b5363762c90fff87d66a965e9a75c5964b98 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit Control"
3DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
4to extract program execution details from the Linux operating system \
5and interpret them."
6
7LICENSE = "GPLv2 & LGPLv2.1"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
9 file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
11
12DEPENDS = "liburcu popt libxml2 util-linux"
13RDEPENDS_${PN} = "libgcc"
14RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
15# babelstats.pl wants getopt-long
16RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
17
18PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
19 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
20 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
21"
22PACKAGECONFIG ??= "lttng-ust"
23PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
24PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
25PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
26PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
27PACKAGECONFIG_remove_libc-musl = "lttng-ust"
Brad Bishop316dfdd2018-06-25 12:45:53 -040028PACKAGECONFIG_remove_riscv64 = "lttng-ust"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050029
30SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
31 file://x32.patch \
32 file://run-ptest \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033 file://0001-Allow-multiple-attempts-to-connect-to-relayd.patch \
34 file://lttng-sessiond.service \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050035 "
36
37SRC_URI[md5sum] = "051224eb991aee07f8721ff1877d0b96"
38SRC_URI[sha256sum] = "77839eb6fc6c652125f08acfd9369701c2516eb05cc2084160e7efc7a3fb731c"
39
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040inherit autotools ptest pkgconfig useradd python3-dir manpages systemd
41
42SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service"
43SYSTEMD_AUTO_ENABLE = "disable"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050044
45USERADD_PACKAGES = "${PN}"
46GROUPADD_PARAM_${PN} = "tracing"
47
48FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
49 ${PYTHON_SITEPACKAGES_DIR}/*"
50FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
51FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
52
53# Since files are installed into ${libdir}/lttng/libexec we match
54# the libexec insane test so skip it.
55# Python module needs to keep _lttng.so
56INSANE_SKIP_${PN} = "libexec dev-so"
57INSANE_SKIP_${PN}-dbg = "libexec"
58
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059do_install_append () {
60 # install systemd unit file
61 install -d ${D}${systemd_unitdir}/system
62 install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system
63}
64
Brad Bishopd7bf8c12018-02-25 22:55:05 -050065do_install_ptest () {
66 for f in Makefile tests/Makefile tests/utils/utils.sh ; do
67 install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
68 done
69
70 for f in config/tap-driver.sh config/test-driver ; do
71 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
72 done
73
74 # Prevent 'make check' from recursing into non-test subdirectories.
75 sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
76
77 # We don't need these
78 sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
79
80 # We shouldn't need to build anything in tests/utils
81 sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
82 "${D}${PTEST_PATH}/tests/Makefile"
83
84 # Copy the tests directory tree and the executables and
85 # Makefiles found within.
86 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
87 install -d "${D}${PTEST_PATH}/tests/$d"
88 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
89 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
90 test -r "${B}/tests/$d/Makefile" && \
91 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
92 done
93
94 # We shouldn't need to build anything in tests/regression/tools
95 sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
96 "${D}${PTEST_PATH}/tests/regression/Makefile"
97
98 # Prevent attempts to update Makefiles during test runs, and
99 # silence "Making check in $SUBDIR" messages.
100 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
101 sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
102 -e '/echo "Making $$target in $$subdir"; \\/d' \
103 -e 's/^srcdir = \(.*\)/srcdir = ./' \
104 -e 's/^builddir = \(.*\)/builddir = ./' \
105 -e 's/^all-am:.*/all-am:/' \
106 {} +
107
108 # These objects trigger [rpaths] QA checks; the test harness
109 # skips the associated tests if they're missing, so delete
110 # them.
111 objs=""
112 objs="$objs regression/ust/ust-dl/libbar.so"
113 objs="$objs regression/ust/ust-dl/libfoo.so"
114 for obj in $objs ; do
115 rm -f "${D}${PTEST_PATH}/tests/${obj}"
116 done
117
118 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
119 touch -r "${B}/Makefile" {} +
120
121 # Substitute links to installed binaries.
122 for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
123 exedir="${D}${PTEST_PATH}/src/bin/${prog}"
124 install -d "$exedir"
125 case "$prog" in
126 lttng-consumerd)
127 ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
128 ;;
129 *)
130 ln -s "${bindir}/$prog" "$exedir"
131 ;;
132 esac
133 done
134}