Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libtracecmd for openSUSE:Factory checked in at 2023-02-08 17:20:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libtracecmd (Old) and /work/SRC/openSUSE:Factory/.libtracecmd.new.4462 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libtracecmd" Wed Feb 8 17:20:35 2023 rev:5 rq:1063769 version:1.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libtracecmd/libtracecmd.changes 2023-01-30 17:25:27.485209290 +0100 +++ /work/SRC/openSUSE:Factory/.libtracecmd.new.4462/libtracecmd.changes 2023-02-08 17:21:02.230162293 +0100 @@ -1,0 +2,6 @@ +Tue Feb 7 13:40:37 UTC 2023 - Daniel Wagner <daniel.wag...@suse.com> + +- Sync meson build patch with latest upstream version + * Documentation is built via extra build target + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libtracecmd.spec ++++++ --- /var/tmp/diff_new_pack.nXnAMC/_old 2023-02-08 17:21:02.822165199 +0100 +++ /var/tmp/diff_new_pack.nXnAMC/_new 2023-02-08 17:21:02.830165238 +0100 @@ -60,9 +60,10 @@ %build cd lib %meson \ - -Ddocs-build=true \ + --default-library=shared \ -Dhtmldir="%_docdir/%name" %meson_build +%meson_build docs %install cd lib ++++++ 0001-libtracecmd-Add-initial-support-for-meson.patch ++++++ --- /var/tmp/diff_new_pack.nXnAMC/_old 2023-02-08 17:21:02.882165493 +0100 +++ /var/tmp/diff_new_pack.nXnAMC/_new 2023-02-08 17:21:02.894165552 +0100 @@ -1,7 +1,7 @@ -From 746d27ea533182501b139720f5b18a065b538a48 Mon Sep 17 00:00:00 2001 +From 65c293138541c3c59e4d9be4912303f2584db8ba Mon Sep 17 00:00:00 2001 From: Daniel Wagner <dwag...@suse.de> Date: Wed, 21 Dec 2022 11:54:17 +0100 -Subject: [PATCH 1/2] libtracecmd: Add initial support for meson +Subject: [PATCH v7 1/2] libtracecmd: Add initial support for meson Add support for building the project with meson. @@ -16,56 +16,64 @@ Signed-off-by: Daniel Wagner <dwag...@suse.de> --- - Documentation/libtracecmd/install-man.sh.in | 15 ++ - Documentation/libtracecmd/meson.build | 148 ++++++++++++++++++++ - lib/Documentation | 1 + - lib/meson.build | 112 +++++++++++++++ - lib/meson_options.txt | 21 +++ - lib/trace-cmd/include/meson.build | 5 + - lib/trace-cmd/include/private/meson.build | 14 ++ - lib/trace-cmd/meson.build | 83 +++++++++++ - 8 files changed, 399 insertions(+) - create mode 100755 Documentation/libtracecmd/install-man.sh.in + Documentation/libtracecmd/install-docs.sh.in | 20 +++ + Documentation/libtracecmd/meson.build | 168 +++++++++++++++++++ + lib/Documentation | 1 + + lib/check-manpages.sh | 1 + + lib/meson.build | 114 +++++++++++++ + lib/meson_options.txt | 19 +++ + lib/trace-cmd/include/meson.build | 5 + + lib/trace-cmd/include/private/meson.build | 14 ++ + lib/trace-cmd/meson.build | 88 ++++++++++ + 9 files changed, 430 insertions(+) + create mode 100755 Documentation/libtracecmd/install-docs.sh.in create mode 100644 Documentation/libtracecmd/meson.build create mode 120000 lib/Documentation + create mode 120000 lib/check-manpages.sh create mode 100644 lib/meson.build create mode 100644 lib/meson_options.txt create mode 100644 lib/trace-cmd/include/meson.build create mode 100644 lib/trace-cmd/include/private/meson.build create mode 100644 lib/trace-cmd/meson.build -diff --git a/Documentation/libtracecmd/install-man.sh.in b/Documentation/libtracecmd/install-man.sh.in +diff --git a/Documentation/libtracecmd/install-docs.sh.in b/Documentation/libtracecmd/install-docs.sh.in new file mode 100755 -index 000000000000..8ab2cb982e1d +index 000000000000..eca9b1f42dcc --- /dev/null -+++ b/Documentation/libtracecmd/install-man.sh.in -@@ -0,0 +1,15 @@ ++++ b/Documentation/libtracecmd/install-docs.sh.in +@@ -0,0 +1,20 @@ +#!/bin/bash ++# SPDX-License-Identifier: LGPL-2.1 ++# ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + -+for man in $(find @SRCDIR@ -name '*\.1' -type f); do -+ [ ! -d ${DESTDIR}/@MANDIR@/man1/ ] && install -d ${DESTDIR}/@MANDIR@/man1/ -+ -+ echo Installing $man to ${DESTDIR}/@MANDIR@/man1/ -+ install -m 0644 $man ${DESTDIR}/@MANDIR@/man1/ ++for section in 1 3 5; do ++ while IFS= read -r -d '' man; do ++ [ ! -d "${DESTDIR}@MANDIR@/man${section}" ] && install -d "${DESTDIR}@MANDIR@/man${section}" ++ ++ echo Installing "${man}" to "${DESTDIR}@MANDIR@/man${section}" ++ install -m 0644 "${man}" "${DESTDIR}@MANDIR@/man${section}/" ++ done< <(find "@SRCDIR@" -name "*\.${section}" -type f -print0) +done + -+for man in $(find @SRCDIR@ -name '*\.3' -type f); do -+ [ ! -d ${DESTDIR}/@MANDIR@/man3/ ] && install -d ${DESTDIR}/@MANDIR@/man3/ ++while IFS= read -r -d '' html; do ++ [ ! -d "${DESTDIR}@HTMLDIR@" ] && install -d "${DESTDIR}@HTMLDIR@" + -+ echo Installing $man to ${DESTDIR}/@MANDIR@/man3/ -+ install -m 0644 $man ${DESTDIR}/@MANDIR@/man3/ -+done ++ echo Installing "${html}" to "${DESTDIR}@HTMLDIR@" ++ install -m 0644 "${html}" "${DESTDIR}@HTMLDIR@" ++done< <(find "@SRCDIR@" -name "*\.html" -type f -print0) diff --git a/Documentation/libtracecmd/meson.build b/Documentation/libtracecmd/meson.build new file mode 100644 -index 000000000000..d1f40832d66c +index 000000000000..c9fb16676812 --- /dev/null +++ b/Documentation/libtracecmd/meson.build -@@ -0,0 +1,148 @@ +@@ -0,0 +1,168 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +# input text file: man page section ++ +sources = { + 'libtracecmd-files.txt': '3', + 'libtracecmd-instances.txt': '3', @@ -78,20 +86,23 @@ + 'libtracecmd.txt': '3', +} + ++confdir = meson.current_source_dir() + '/../' ++top_source_dir = meson.current_source_dir() + '/../../' ++ +# +# For asciidoc ... -+# -7.1.2, no extra settings are needed. -+# 8.0-, set ASCIIDOC8. ++# -7.1.2, no extra settings are needed. ++# 8.0-, set ASCIIDOC8. +# + +# +# For docbook-xsl ... -+# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) -+# 1.69.0, no extra settings are needed? -+# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? -+# 1.71.1, no extra settings are needed? -+# 1.72.0, set DOCBOOK_XSL_172. -+# 1.73.0-, set ASCIIDOC_NO_ROFF ++# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) ++# 1.69.0, no extra settings are needed? ++# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? ++# 1.71.1, no extra settings are needed? ++# 1.72.0, set DOCBOOK_XSL_172. ++# 1.73.0-, set ASCIIDOC_NO_ROFF +# + +# @@ -112,7 +123,7 @@ +else + asciidoc = find_program('asciidoc') + asciidoc_extra = ['--unsafe'] -+ asciidoc_extra += ['-f', meson.current_source_dir() + '/../asciidoc.conf'] ++ asciidoc_extra += ['-f', confdir + 'asciidoc.conf'] + asciidoc_html = 'xhtml11' + + r = run_command(asciidoc, '--version', check: true) @@ -122,11 +133,11 @@ + endif +endif + -+manpage_xsl = meson.current_source_dir() + '/../manpage-normal.xsl' ++manpage_xsl = confdir + 'manpage-normal.xsl' + +if get_option('docbook-xls-172') + asciidoc_extra += ['-a', 'libtraceevent-asciidoc-no-roff'] -+ manpage_xsl = meson.current_source_dir() + '/../manpage-1.72.xsl' ++ manpage_xsl = confdir + 'manpage-1.72.xsl' +elif get_option('asciidoc-no-roff') + # docbook-xsl after 1.72 needs the regular XSL, but will not + # pass-thru raw roff codes from asciidoc.conf, so turn them off. @@ -137,51 +148,63 @@ +xmlto_extra = [] + +if get_option('man-bold-literal') -+ xmlto_extra += ['-m ', meson.current_source_dir() + '/../manpage-bold-literal.xsl'] ++ xmlto_extra += ['-m ', confdir + 'manpage-bold-literal.xsl'] +endif + +if get_option('docbook-suppress-sp') -+ xmlto_extra += ['-m ', meson.current_source_dir() + '/../manpage-suppress-sp.xsl'] ++ xmlto_extra += ['-m ', confdir + 'manpage-suppress-sp.xsl'] +endif + -+gen = generator(asciidoc, -+ output: '@BASENAME@.xml', -+ arguments: [ -+ '-b', 'docbook', -+ '-d', 'manpage', -+ '-a', 'libtraceevent_version=' + meson.project_version(), -+ '-o', '@OUTPUT@'] -+ + asciidoc_extra -+ + ['@INPUT@']) ++check_doc = custom_target( ++ 'check-doc', ++ output: 'dummy', ++ command : [ ++ top_source_dir + 'check-manpages.sh', ++ meson.current_source_dir()]) ++ ++gen = generator( ++ asciidoc, ++ output: '@BASENAME@.xml', ++ arguments: [ ++ '-b', 'docbook', ++ '-d', 'manpage', ++ '-a', 'libtraceevent_version=' + meson.project_version(), ++ '-o', '@OUTPUT@'] ++ + asciidoc_extra ++ + ['@INPUT@']) + ++man = [] ++html = [] +foreach txt, section : sources + # build man page(s) + xml = gen.process(txt) -+ man = custom_target(txt.underscorify() + '_man', -+ input: xml, -+ output: '@BASENAME@.' + section, -+ command: [xmlto, -+ '-m', manpage_xsl, -+ 'man', -+ '-o', '@OUTPUT@'] -+ + xmlto_extra -+ + ['@INPUT@'], -+ build_by_default : true) ++ man += custom_target( ++ txt.underscorify() + '_man', ++ input: xml, ++ output: '@BASENAME@.' + section, ++ depends: check_doc, ++ command: [ ++ xmlto, ++ '-m', manpage_xsl, ++ 'man', ++ '-o', '@OUTPUT@'] ++ + xmlto_extra ++ + ['@INPUT@']) + + # build html pages -+ custom_target( -+ txt.underscorify() + '_html', -+ input: txt, -+ output: '@BASENAME@.html', -+ command: [asciidoc, -+ '-b', asciidoc_html, -+ '-d', 'manpage', -+ '-a', 'libtraceevent_version=' + meson.project_version(), -+ '-o', '@OUTPUT@'] -+ + asciidoc_extra -+ + ['@INPUT@'], -+ install: true, -+ install_dir: htmldir) ++ html += custom_target( ++ txt.underscorify() + '_html', ++ input: txt, ++ output: '@BASENAME@.html', ++ depends: check_doc, ++ command: [ ++ asciidoc, ++ '-b', asciidoc_html, ++ '-d', 'manpage', ++ '-a', 'libtraceevent_version=' + meson.project_version(), ++ '-o', '@OUTPUT@'] ++ + asciidoc_extra ++ + ['@INPUT@']) +endforeach + +# Install path workaround because: @@ -195,20 +218,24 @@ +# causing the install step to fail (confusion where the generated files +# are stored) +# ++# - The documentation build is not part of the 'build' target. The user ++# has explicitly to trigger the doc build. Hence the documentation is ++# not added to the 'install' target. ++# +# Thus just use a plain old shell script to move the generated files to the +# right location. + +conf = configuration_data() +conf.set('SRCDIR', meson.current_build_dir()) +conf.set('MANDIR', mandir) ++conf.set('HTMLDIR', htmldir) +configure_file( -+ input: 'install-man.sh.in', -+ output: 'install-man.sh', -+ configuration: conf, -+) ++ input: 'install-docs.sh.in', ++ output: 'install-docs.sh', ++ configuration: conf) + +meson.add_install_script( -+ join_paths(meson.current_build_dir(), 'install-man.sh')) ++ join_paths(meson.current_build_dir(), 'install-docs.sh')) diff --git a/lib/Documentation b/lib/Documentation new file mode 120000 index 000000000000..fb996f28ab31 @@ -217,28 +244,35 @@ @@ -0,0 +1 @@ +../Documentation \ No newline at end of file +diff --git a/lib/check-manpages.sh b/lib/check-manpages.sh +new file mode 120000 +index 000000000000..d9416662eaed +--- /dev/null ++++ b/lib/check-manpages.sh +@@ -0,0 +1 @@ ++../check-manpages.sh +\ No newline at end of file diff --git a/lib/meson.build b/lib/meson.build new file mode 100644 -index 000000000000..3a06ace8b08f +index 000000000000..3906b3d27f24 --- /dev/null +++ b/lib/meson.build -@@ -0,0 +1,112 @@ +@@ -0,0 +1,114 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +project( -+ 'libtrace-cmd', ['c'], ++ 'libtracecmd', ['c'], + meson_version: '>= 0.50.0', + license: 'GPL-2.0', + version: '1.3.0', + default_options: [ -+ 'c_std=gnu99', -+ 'buildtype=release', -+ 'prefix=/usr/local', -+ 'warning_level=1', -+ ] -+) ++ 'c_std=gnu99', ++ 'buildtype=debug', ++ 'default_library=both', ++ 'prefix=/usr/local', ++ 'warning_level=1']) + +cc = meson.get_compiler('c') + @@ -310,37 +344,40 @@ + +add_project_arguments( + [ -+ '-D_GNU_SOURCE', -+ '-include', 'trace-cmd/include/private/config.h', ++ '-D_GNU_SOURCE', ++ '-include', 'trace-cmd/include/private/config.h', + ], -+ language : 'c', -+) ++ language : 'c') + -+libtracecmd_ext_incdir = include_directories(['../include', -+ '../include/trace-cmd', -+ '../tracecmd/include']) ++libtracecmd_ext_incdir = include_directories( ++ [ ++ '../include', ++ '../include/trace-cmd', ++ '../tracecmd/include' ++ ]) + +subdir('trace-cmd/include') +subdir('trace-cmd/include/private') +subdir('trace-cmd') -+if get_option('docs-build') and libtracecmd_standalone_build -+ custom_target('check-doc', -+ output: 'dummy', -+ command : [meson.source_root() + '/../check-manpages.sh', -+ meson.source_root() + '/../Documentation/libtracecmd'], -+ build_by_default : true) -+ # subdir() doesn't allow '..' in the path ++if libtracecmd_standalone_build + subdir('Documentation/libtracecmd') ++ ++ custom_target( ++ 'docs', ++ output: 'docs', ++ depends: [html, man], ++ command: ['echo']) +endif + -+install_headers('../include/trace-cmd/trace-cmd.h', -+ subdir: 'trace-cmd') ++install_headers( ++ '../include/trace-cmd/trace-cmd.h', ++ subdir: 'trace-cmd') diff --git a/lib/meson_options.txt b/lib/meson_options.txt new file mode 100644 -index 000000000000..341f5d71a54f +index 000000000000..9f5ed6d486d8 --- /dev/null +++ b/lib/meson_options.txt -@@ -0,0 +1,21 @@ +@@ -0,0 +1,19 @@ +# -*- mode: meson -*- +# SPDX-License-Identifier: LGPL-2.1 + @@ -348,9 +385,7 @@ + description : 'build with vsock support') +option('ptrace', type : 'boolean', value : true, + description : 'build with ptrace support') -+option('docs-build', type : 'boolean', value : false, -+ description : 'build documentation') -+option('htmldir', type : 'string', value : '', ++option('htmldir', type : 'string', value : 'share/doc/libtracecmd-doc', + description : 'directory for HTML documentation') +option('asciidoctor', type : 'boolean', value: false, + description : 'use asciidoctor instead of asciidoc') @@ -364,24 +399,24 @@ + description : 'docbook suppress sp') diff --git a/lib/trace-cmd/include/meson.build b/lib/trace-cmd/include/meson.build new file mode 100644 -index 000000000000..49978395eb9a +index 000000000000..c1c83884948f --- /dev/null +++ b/lib/trace-cmd/include/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +libtracecmd_incdir = include_directories(['.']) diff --git a/lib/trace-cmd/include/private/meson.build b/lib/trace-cmd/include/private/meson.build new file mode 100644 -index 000000000000..df6a1796443b +index 000000000000..0f36339a9cc3 --- /dev/null +++ b/lib/trace-cmd/include/private/meson.build @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +config_h = configure_file( + output: 'config.h', @@ -391,17 +426,18 @@ +libtracecmd_private_incdir = include_directories(['.']) + +config_dep = declare_dependency( -+ include_directories : libtracecmd_private_incdir, -+ sources: config_h) ++ include_directories : libtracecmd_private_incdir, ++ sources: config_h) diff --git a/lib/trace-cmd/meson.build b/lib/trace-cmd/meson.build new file mode 100644 -index 000000000000..9b2e7a96c744 +index 000000000000..8c00ca8f8ff7 --- /dev/null +++ b/lib/trace-cmd/meson.build -@@ -0,0 +1,83 @@ +@@ -0,0 +1,88 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC ++ +sources = [ + 'trace-hash.c', + 'trace-hooks.c', @@ -442,47 +478,51 @@ + 'tracecmd', + sources, + version: library_version, -+ dependencies: [libtraceevent_dep, -+ libtracefs_dep, -+ zlib_dep, -+ libzstd_dep, -+ audit_dep], -+ include_directories: [libtracecmd_incdir, -+ libtracecmd_private_incdir, -+ libtracecmd_ext_incdir], -+ install: true, -+ ) ++ dependencies: [ ++ libtraceevent_dep, ++ libtracefs_dep, ++ zlib_dep, ++ libzstd_dep, ++ audit_dep], ++ include_directories: [ ++ libtracecmd_incdir, ++ libtracecmd_private_incdir, ++ libtracecmd_ext_incdir], ++ install: true) + + pkg = import('pkgconfig') + pkg.generate( + libtracecmd, ++ subdirs: 'trace-cmd', ++ libraries: [ ++ libtracefs_dep, ++ libtraceevent_dep], + filebase: meson.project_name(), + name: meson.project_name(), + version: meson.project_version(), + description: 'Library for creating and reading trace-cmd data files', -+ url: 'https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/' -+ ) ++ url: 'https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/') + + libtracecmd_dep = declare_dependency( + include_directories: ['.'], -+ link_with: libtracecmd, -+ ) ++ link_with: libtracecmd) +else + static_libtracecmd = static_library( + 'tracecmd', + sources, -+ dependencies: [libtraceevent_dep, -+ libtracefs_dep, -+ zlib_dep, -+ libzstd_dep, -+ audit_dep], -+ include_directories: [libtracecmd_incdir, -+ libtracecmd_private_incdir, -+ libtracecmd_ext_incdir], -+ install: false, -+ ) ++ dependencies: [ ++ libtraceevent_dep, ++ libtracefs_dep, ++ zlib_dep, ++ libzstd_dep, ++ audit_dep], ++ include_directories: [ ++ libtracecmd_incdir, ++ libtracecmd_private_incdir, ++ libtracecmd_ext_incdir], ++ install: false) +endif -- -2.39.0 +2.39.1 ++++++ 0002-trace-cmd-Add-initial-support-for-meson.patch ++++++ --- /var/tmp/diff_new_pack.nXnAMC/_old 2023-02-08 17:21:02.938165768 +0100 +++ /var/tmp/diff_new_pack.nXnAMC/_new 2023-02-08 17:21:02.946165808 +0100 @@ -1,7 +1,7 @@ -From 95cf78e3930986f92f824a053ed071ad1bfdd748 Mon Sep 17 00:00:00 2001 +From b3c6d850169425c2cc58c8455f6c560de4be3a47 Mon Sep 17 00:00:00 2001 From: Daniel Wagner <dwag...@suse.de> Date: Wed, 21 Dec 2022 14:15:02 +0100 -Subject: [PATCH 2/2] trace-cmd: Add initial support for meson +Subject: [PATCH v7 2/2] trace-cmd: Add initial support for meson Add support for building the project with meson. @@ -17,16 +17,16 @@ Signed-off-by: Daniel Wagner <dwag...@suse.de> --- - Documentation/trace-cmd/install-man.sh.in | 10 ++ - Documentation/trace-cmd/meson.build | 167 ++++++++++++++++++++++ - meson-vcs-tag.sh | 17 +++ - meson.build | 144 +++++++++++++++++++ - meson_options.txt | 25 ++++ - python/meson.build | 40 ++++++ - tracecmd/meson.build | 57 ++++++++ - utest/meson.build | 25 ++++ - 8 files changed, 485 insertions(+) - create mode 100755 Documentation/trace-cmd/install-man.sh.in + Documentation/trace-cmd/install-docs.sh.in | 20 +++ + Documentation/trace-cmd/meson.build | 187 +++++++++++++++++++++ + meson-vcs-tag.sh | 17 ++ + meson.build | 149 ++++++++++++++++ + meson_options.txt | 23 +++ + python/meson.build | 40 +++++ + tracecmd/meson.build | 59 +++++++ + utest/meson.build | 26 +++ + 8 files changed, 521 insertions(+) + create mode 100755 Documentation/trace-cmd/install-docs.sh.in create mode 100644 Documentation/trace-cmd/meson.build create mode 100755 meson-vcs-tag.sh create mode 100644 meson.build @@ -35,33 +35,44 @@ create mode 100644 tracecmd/meson.build create mode 100644 utest/meson.build -diff --git a/Documentation/trace-cmd/install-man.sh.in b/Documentation/trace-cmd/install-man.sh.in +diff --git a/Documentation/trace-cmd/install-docs.sh.in b/Documentation/trace-cmd/install-docs.sh.in new file mode 100755 -index 000000000000..a69543bd359f +index 000000000000..eca9b1f42dcc --- /dev/null -+++ b/Documentation/trace-cmd/install-man.sh.in -@@ -0,0 +1,10 @@ ++++ b/Documentation/trace-cmd/install-docs.sh.in +@@ -0,0 +1,20 @@ +#!/bin/bash ++# SPDX-License-Identifier: LGPL-2.1 ++# ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + -+for section in 1 2 3 4 5 6 7 8; do -+ for man in $(find @SRCDIR@ -name "*\.${section}" -type f); do -+ [ ! -d ${DESTDIR}/@MANDIR@/man${section}/ ] && install -d ${DESTDIR}/@MANDIR@/man${section}/ -+ -+ echo Installing $man to ${DESTDIR}/@MANDIR@/man${section}/ -+ install -m 0644 $man ${DESTDIR}/@MANDIR@/man${section}/ -+ done ++for section in 1 3 5; do ++ while IFS= read -r -d '' man; do ++ [ ! -d "${DESTDIR}@MANDIR@/man${section}" ] && install -d "${DESTDIR}@MANDIR@/man${section}" ++ ++ echo Installing "${man}" to "${DESTDIR}@MANDIR@/man${section}" ++ install -m 0644 "${man}" "${DESTDIR}@MANDIR@/man${section}/" ++ done< <(find "@SRCDIR@" -name "*\.${section}" -type f -print0) +done ++ ++while IFS= read -r -d '' html; do ++ [ ! -d "${DESTDIR}@HTMLDIR@" ] && install -d "${DESTDIR}@HTMLDIR@" ++ ++ echo Installing "${html}" to "${DESTDIR}@HTMLDIR@" ++ install -m 0644 "${html}" "${DESTDIR}@HTMLDIR@" ++done< <(find "@SRCDIR@" -name "*\.html" -type f -print0) diff --git a/Documentation/trace-cmd/meson.build b/Documentation/trace-cmd/meson.build new file mode 100644 -index 000000000000..30ae270e7f1c +index 000000000000..d0cc3076d985 --- /dev/null +++ b/Documentation/trace-cmd/meson.build -@@ -0,0 +1,167 @@ +@@ -0,0 +1,187 @@ +# SPDX-License-Identifier: LGPL-2.1 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +# input text file: man page section ++ +sources = { + 'trace-cmd.1.txt': '1', + 'trace-cmd-agent.1.txt': '1', @@ -93,20 +104,23 @@ + 'trace-cmd-stream.1.txt': '1', +} + ++confdir = meson.current_source_dir() + '/../' ++top_source_dir = meson.current_source_dir() + '/../../' ++ +# +# For asciidoc ... -+# -7.1.2, no extra settings are needed. -+# 8.0-, set ASCIIDOC8. ++# -7.1.2, no extra settings are needed. ++# 8.0-, set ASCIIDOC8. +# + +# +# For docbook-xsl ... -+# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) -+# 1.69.0, no extra settings are needed? -+# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? -+# 1.71.1, no extra settings are needed? -+# 1.72.0, set DOCBOOK_XSL_172. -+# 1.73.0-, set ASCIIDOC_NO_ROFF ++# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) ++# 1.69.0, no extra settings are needed? ++# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? ++# 1.71.1, no extra settings are needed? ++# 1.72.0, set DOCBOOK_XSL_172. ++# 1.73.0-, set ASCIIDOC_NO_ROFF +# + +# @@ -127,7 +141,7 @@ +else + asciidoc = find_program('asciidoc') + asciidoc_extra = ['--unsafe'] -+ asciidoc_extra += ['-f', meson.current_source_dir() + '/../asciidoc.conf'] ++ asciidoc_extra += ['-f', confdir + 'asciidoc.conf'] + asciidoc_html = 'xhtml11' + + r = run_command(asciidoc, '--version', check: true) @@ -137,11 +151,11 @@ + endif +endif + -+manpage_xsl = meson.current_source_dir() + '/../manpage-normal.xsl' ++manpage_xsl = confdir + 'manpage-normal.xsl' + +if get_option('docbook-xls-172') + asciidoc_extra += ['-a', 'libtraceevent-asciidoc-no-roff'] -+ manpage_xsl = meson.current_source_dir() + '/../manpage-1.72.xsl' ++ manpage_xsl = confdir + 'manpage-1.72.xsl' +elif get_option('asciidoc-no-roff') + # docbook-xsl after 1.72 needs the regular XSL, but will not + # pass-thru raw roff codes from asciidoc.conf, so turn them off. @@ -152,51 +166,63 @@ +xmlto_extra = [] + +if get_option('man-bold-literal') -+ xmlto_extra += ['-m ', meson.current_source_dir() + '/../manpage-bold-literal.xsl'] ++ xmlto_extra += ['-m ', confdir + 'manpage-bold-literal.xsl'] +endif + +if get_option('docbook-suppress-sp') -+ xmlto_extra += ['-m ', meson.current_source_dir() + '/../manpage-suppress-sp.xsl'] ++ xmlto_extra += ['-m ', confdir + 'manpage-suppress-sp.xsl'] +endif + -+gen = generator(asciidoc, -+ output: '@BASENAME@.xml', -+ arguments: [ -+ '-b', 'docbook', -+ '-d', 'manpage', -+ '-a', 'libtraceevent_version=' + meson.project_version(), -+ '-o', '@OUTPUT@'] -+ + asciidoc_extra -+ + ['@INPUT@']) ++check_doc = custom_target( ++ 'check-doc', ++ output: 'dummy', ++ command : [ ++ top_source_dir + 'check-manpages.sh', ++ meson.current_source_dir()]) ++ ++gen = generator( ++ asciidoc, ++ output: '@BASENAME@.xml', ++ arguments: [ ++ '-b', 'docbook', ++ '-d', 'manpage', ++ '-a', 'libtraceevent_version=' + meson.project_version(), ++ '-o', '@OUTPUT@'] ++ + asciidoc_extra ++ + ['@INPUT@']) + ++man = [] ++html = [] +foreach txt, section : sources + # build man page(s) + xml = gen.process(txt) -+ man = custom_target(txt.underscorify() + '_man', -+ input: xml, -+ output: '@BASENAME@.' + section, -+ command: [xmlto, -+ '-m', manpage_xsl, -+ 'man', -+ '-o', '@OUTPUT@'] -+ + xmlto_extra -+ + ['@INPUT@'], -+ build_by_default : true) ++ man += custom_target( ++ txt.underscorify() + '_man', ++ input: xml, ++ output: '@BASENAME@.' + section, ++ depends: check_doc, ++ command: [ ++ xmlto, ++ '-m', manpage_xsl, ++ 'man', ++ '-o', '@OUTPUT@'] ++ + xmlto_extra ++ + ['@INPUT@']) + + # build html pages -+ custom_target( -+ txt.underscorify() + '_html', -+ input: txt, -+ output: '@BASENAME@.html', -+ command: [asciidoc, -+ '-b', asciidoc_html, -+ '-d', 'manpage', -+ '-a', 'libtraceevent_version=' + meson.project_version(), -+ '-o', '@OUTPUT@'] -+ + asciidoc_extra -+ + ['@INPUT@'], -+ install: true, -+ install_dir: htmldir) ++ html += custom_target( ++ txt.underscorify() + '_html', ++ input: txt, ++ output: '@BASENAME@.html', ++ depends: check_doc, ++ command: [ ++ asciidoc, ++ '-b', asciidoc_html, ++ '-d', 'manpage', ++ '-a', 'libtraceevent_version=' + meson.project_version(), ++ '-o', '@OUTPUT@'] ++ + asciidoc_extra ++ + ['@INPUT@']) +endforeach + +# Install path workaround because: @@ -210,20 +236,24 @@ +# causing the install step to fail (confusion where the generated files +# are stored) +# ++# - The documentation build is not part of the 'build' target. The user ++# has explicitly to trigger the doc build. Hence the documentation is ++# not added to the 'install' target. ++# +# Thus just use a plain old shell script to move the generated files to the +# right location. + +conf = configuration_data() +conf.set('SRCDIR', meson.current_build_dir()) +conf.set('MANDIR', mandir) ++conf.set('HTMLDIR', htmldir) +configure_file( -+ input: 'install-man.sh.in', -+ output: 'install-man.sh', -+ configuration: conf, -+) ++ input: 'install-docs.sh.in', ++ output: 'install-docs.sh', ++ configuration: conf) + +meson.add_install_script( -+ join_paths(meson.current_build_dir(), 'install-man.sh')) ++ join_paths(meson.current_build_dir(), 'install-docs.sh')) diff --git a/meson-vcs-tag.sh b/meson-vcs-tag.sh new file mode 100755 index 000000000000..8ce692498ada @@ -249,13 +279,13 @@ +[ -e .git ] && git describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback" diff --git a/meson.build b/meson.build new file mode 100644 -index 000000000000..8a3579c72458 +index 000000000000..e537d6f25ea9 --- /dev/null +++ b/meson.build -@@ -0,0 +1,144 @@ +@@ -0,0 +1,149 @@ +# SPDX-License-Identifier: GPL-2.0 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +project( + 'trace-cmd', ['c'], @@ -263,20 +293,19 @@ + license: 'GPL-2.0', + version: '3.1.5', + default_options: [ -+ 'c_std=gnu99', -+ 'buildtype=release', -+ 'prefix=/usr/local', -+ 'warning_level=1', -+ ] -+) ++ 'c_std=gnu99', ++ 'buildtype=debug', ++ 'default_library=both', ++ 'prefix=/usr/local', ++ 'warning_level=1']) + +cc = meson.get_compiler('c') + +prefixdir = get_option('prefix') -+datadir = join_paths(prefixdir, get_option('datadir')) -+bindir = join_paths(prefixdir, get_option('bindir')) -+mandir = join_paths(prefixdir, get_option('mandir')) -+htmldir = join_paths(prefixdir, get_option('htmldir')) ++datadir = join_paths(prefixdir, get_option('datadir')) ++bindir = join_paths(prefixdir, get_option('bindir')) ++mandir = join_paths(prefixdir, get_option('mandir')) ++htmldir = join_paths(prefixdir, get_option('htmldir')) + +conf = configuration_data() + @@ -353,24 +382,23 @@ +if version_tag != '' + vconf.set('VERSION_GIT', '"@0@"'.format(version_tag)) +else -+ r = run_command('meson-vcs-tag.sh', -+ meson.current_source_dir(), -+ meson.project_version(), -+ check: true) ++ r = run_command( ++ 'meson-vcs-tag.sh', ++ meson.current_source_dir(), ++ meson.project_version(), ++ check: true) + vconf.set('VERSION_GIT', '"@0@"'.format(r.stdout().strip())) +endif +version_h = configure_file( + output: 'tc_version.h', -+ configuration: vconf -+) ++ configuration: vconf) + +add_project_arguments( + [ + '-D_GNU_SOURCE', + '-include', 'config.h', + ], -+ language : 'c', -+) ++ language : 'c') + +incdir = include_directories(['.', 'include']) + @@ -381,9 +409,12 @@ +# make it simpler to use. +library_version = '1.3.0' +libtracecmd_standalone_build = false -+libtracecmd_ext_incdir = include_directories(['include', -+ 'include/trace-cmd', -+ 'tracecmd/include']) ++libtracecmd_ext_incdir = include_directories( ++ [ ++ 'include', ++ 'include/trace-cmd', ++ 'tracecmd/include' ++ ]) +subdir('lib/trace-cmd/include') +subdir('lib/trace-cmd/include/private') +subdir('lib/trace-cmd') @@ -394,15 +425,19 @@ +if cunit_dep.found() + subdir('utest') +endif -+if get_option('docs-build') -+ subdir('Documentation/trace-cmd') -+endif ++subdir('Documentation/trace-cmd') ++ ++custom_target( ++ 'docs', ++ output: 'docs', ++ depends: [html, man], ++ command: ['echo']) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 -index 000000000000..494684de7fb0 +index 000000000000..2d5d7457bed5 --- /dev/null +++ b/meson_options.txt -@@ -0,0 +1,25 @@ +@@ -0,0 +1,23 @@ +# -*- mode: meson -*- +# SPDX-License-Identifier: GPL-2.0 + @@ -412,9 +447,7 @@ + description : 'build with vsock support') +option('ptrace', type : 'boolean', value : true, + description : 'build with ptrace support') -+option('docs-build', type : 'boolean', value : false, -+ description : 'build documentation') -+option('htmldir', type : 'string', value : '', ++option('htmldir', type : 'string', value : 'share/doc/trace-cmd-doc', + description : 'directory for HTML documentation') +option('asciidoctor', type : 'boolean', value: false, + description : 'use asciidoctor instead of asciidoc') @@ -430,13 +463,13 @@ + description : 'Generate trac-cmd Python bindings') diff --git a/python/meson.build b/python/meson.build new file mode 100644 -index 000000000000..dab3fab72994 +index 000000000000..5a91ff63a326 --- /dev/null +++ b/python/meson.build @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +want_python = get_option('python') +if want_python != 'false' @@ -454,14 +487,15 @@ + 'ctracecmd.py', + input: ['ctracecmd.i'], + output: ['ctracecmd.py', 'ctracecmd_wrap.c'], -+ command: [swig, '-python', -+ '-I' + meson.current_source_dir() + '/../include/trace-cmd', -+ '-I' + libtraceevent_dep.get_pkgconfig_variable('prefix') + -+ '/include/traceevent', -+ '-o', '@OUTPUT1@', '@INPUT0@'], ++ command: [ ++ swig, ++ '-python', ++ '-I' + meson.current_source_dir() + '/../include/trace-cmd', ++ '-I' + libtraceevent_dep.get_pkgconfig_variable('prefix') + '/include/traceevent', ++ '-o', '@OUTPUT1@', ++ '@INPUT0@'], + install: true, -+ install_dir: [python3.get_install_dir(pure: false, subdir: 'trace-cmd'), false], -+ ) ++ install_dir: [ python3.get_install_dir(pure: false, subdir: 'trace-cmd'), false]) + + incdir_py = include_directories(['.', '../include/trace-cmd']) + @@ -471,18 +505,17 @@ + dependencies : [libtraceevent_dep, libtracefs_dep, py3_dep], + include_directories: [incdir, incdir_py], + install: true, -+ subdir: 'trace-cmd', -+ ) ++ subdir: 'trace-cmd') +endif diff --git a/tracecmd/meson.build b/tracecmd/meson.build new file mode 100644 -index 000000000000..8f2316d5bf3f +index 000000000000..bb0b5ca547fb --- /dev/null +++ b/tracecmd/meson.build -@@ -0,0 +1,57 @@ +@@ -0,0 +1,59 @@ +# SPDX-License-Identifier: GPL-2.0 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +sources = [ + 'trace-agent.c', @@ -520,32 +553,34 @@ +executable( + 'trace-cmd', + sources, -+ dependencies: [libtraceevent_dep, -+ libtracefs_dep, -+ zlib_dep, -+ libzstd_dep, -+ audit_dep], -+ include_directories: [incdir, -+ trace_cmd_incdir, -+ libtracecmd_incdir, -+ libtracecmd_private_incdir, -+ libtracecmd_ext_incdir], ++ dependencies: [ ++ libtraceevent_dep, ++ libtracefs_dep, ++ zlib_dep, ++ libzstd_dep, ++ audit_dep], ++ include_directories: [ ++ incdir, ++ trace_cmd_incdir, ++ libtracecmd_incdir, ++ libtracecmd_private_incdir, ++ libtracecmd_ext_incdir], + link_with: [static_libtracecmd], + install: true, -+ install_dir: bindir, -+) ++ install_dir: bindir) + -+install_data('trace-cmd.bash', -+ install_dir: datadir + '/bash-completion/completions') ++install_data( ++ 'trace-cmd.bash', ++ install_dir: datadir + '/bash-completion/completions') diff --git a/utest/meson.build b/utest/meson.build new file mode 100644 -index 000000000000..4f87515f3d1c +index 000000000000..c1cc837c7639 --- /dev/null +++ b/utest/meson.build -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: GPL-2.0 +# -+# Copyright (c) 2022 Daniel Wagner, SUSE LLC ++# Copyright (c) 2023 Daniel Wagner, SUSE LLC + +sources = [ + 'tracecmd-utest.c', @@ -555,20 +590,21 @@ +e = executable( + 'trace-utest', + sources, -+ include_directories: [incdir, -+ libtracecmd_incdir, -+ libtracecmd_private_incdir, -+ libtracecmd_ext_incdir], -+ dependencies: [libtraceevent_dep, -+ libtracefs_dep, -+ zlib_dep, -+ libzstd_dep, -+ cunit_dep], -+ link_with: [static_libtracecmd], -+) ++ include_directories: [ ++ incdir, ++ libtracecmd_incdir, ++ libtracecmd_private_incdir, ++ libtracecmd_ext_incdir], ++ dependencies: [ ++ libtraceevent_dep, ++ libtracefs_dep, ++ zlib_dep, ++ libzstd_dep, ++ cunit_dep], ++ link_with: [static_libtracecmd]) + +test('trace-utest', e) -- -2.39.0 +2.39.1