From: Jan Stancek <jstan...@redhat.com>

redhat: kernel.spec: introduce ynl subpackage

build and package tools/net/ynl.

Signed-off-by: Jan Stancek <jstan...@redhat.com>

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -230,6 +230,8 @@ Summary: The Linux kernel
 %define with_libperf   %{?_without_libperf:   0} %{?!_without_libperf:   1}
 # tools
 %define with_tools     %{?_without_tools:     0} %{?!_without_tools:     1}
+# ynl
+%define with_ynl      %{?_without_ynl:      0} %{?!_without_ynl:      1}
 # kernel-debuginfo
 %define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
 # kernel-abi-stablelists
@@ -390,6 +392,7 @@ Summary: The Linux kernel
 %define with_vdso_install 0
 %define with_perf 0
 %define with_libperf 0
+%define with_ynl 0
 %define with_tools 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
@@ -402,6 +405,7 @@ Summary: The Linux kernel
 %define with_vdso_install 0
 %define with_perf 0
 %define with_libperf 0
+%define with_ynl 0
 %define with_tools 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
@@ -418,6 +422,7 @@ Summary: The Linux kernel
 %define with_vdso_install 0
 %define with_perf 0
 %define with_libperf 0
+%define with_ynl 0
 %define with_tools 0
 %define with_kernel_abi_stablelists 0
 %define with_selftests 0
@@ -516,6 +521,7 @@ Summary: The Linux kernel
 %define with_tools 0
 %define with_perf 0
 %define with_libperf 0
+%define with_ynl 0
 %define with_selftests 0
 %define with_debug 0
 %endif
@@ -616,6 +622,7 @@ Summary: The Linux kernel
 %define with_debuginfo 0
 %define with_perf 0
 %define with_libperf 0
+%define with_ynl 0
 %define with_tools 0
 %define with_selftests 0
 %define _enable_debug_packages 0
@@ -745,6 +752,9 @@ BuildRequires: numactl-devel
 BuildRequires: opencsd-devel >= 1.0.0
 %endif
 %endif
+%if %{with_ynl}
+BuildRequires: python3-pyyaml python3-jsonschema python3-pip python3-setuptools
+%endif
 %if %{with_tools}
 BuildRequires: python3-docutils
 BuildRequires: gettext ncurses-devel
@@ -1243,6 +1253,15 @@ This package provides debug information for the libperf 
package.
 # with_libperf
 %endif
 
+%if %{with_ynl}
+%package -n ynl
+Summary: ynl - client and tools for Netlink protocol specifications in YAML
+Requires: python3
+%description -n ynl
+This package contains the ynl cli tool, libraries and docs
+for Netlink protocol specifications in YAML.
+%endif
+
 %if %{with_tools}
 %package -n %{package_name}-tools
 Summary: Assortment of tools for the Linux kernel
@@ -3066,6 +3085,20 @@ chmod +x tools/perf/check-headers.sh
 %endif
 
 %if %{with_tools}
+
+# ynl
+%if %{with_ynl}
+pushd tools/net/ynl
+export PIP_CONFIG_FILE=/tmp/pip.config
+cat <<EOF > $PIP_CONFIG_FILE
+[install]
+no-index = true
+no-build-isolation = false
+EOF
+%{tools_make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
+popd
+%endif
+
 %ifarch %{cpupowerarchs}
 # cpupower
 # make sure version-gen.sh is executable.
@@ -3916,6 +3949,16 @@ fi\
 # with_libperf
 %endif
 
+# with_ynl
+%if %{with_ynl}
+%files -n ynl
+%{_bindir}/ynl*
+%{_libdir}/libynl*
+%{_docdir}/ynl
+%{_datadir}/ynl
+%{_includedir}/ynl
+%{python3_sitelib}/pyynl*
+%endif
 
 %if %{with_tools}
 %ifnarch %{cpupowerarchs}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3638

-- 
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to