diff --git a/udev-hid-bpf.spec b/udev-hid-bpf.spec index 212e398..79e826e 100644 --- a/udev-hid-bpf.spec +++ b/udev-hid-bpf.spec @@ -6,8 +6,10 @@ %if 0%{?rhel} %global bundled_rust_deps 1 +%global build_testing 0 %else %global bundled_rust_deps 0 +%global build_testing 1 %endif # Upstream uses 1.0.0-20240417 but rpm won't let us use the dash, so let's use a dot instead. @@ -25,7 +27,7 @@ License: (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND (Apache-2.0 OR BSL- URL: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/ Source0: https://gitlab.freedesktop.org/libevdev/%{name}/-/archive/%{tarball}/%{name}-%{tarball}.tar.bz2 # To recreate tarball: -# $ fedpkg prep +# $ centpkg prep (do not use fedpkg, it removes Cargo.lock) # $ pushd udev-hid-bpf-...; cargo vendor && tar Jcvf ../$(basename $PWD)-vendor.tar.xz vendor/ ; popd Source1: %{name}-%{upstream_version}-%{upstream_version_date}-vendor.tar.xz @@ -68,6 +70,7 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +%if 0%{?build_testing} %package testing Summary: Testing eBPF programs for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} @@ -76,6 +79,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-testing package contains HID eBPF programs for %{name} that have not yet been merged into an upstream kernel. +%endif %package stable Summary: Stable eBPF programs for %{name} @@ -106,7 +110,15 @@ tar xf %{SOURCE1} %build export RUSTFLAGS="%build_rustflags" -%meson -Dudevdir=%{udevdir} -Dbpfs=stable,testing -Dtests=disabled +%if 0%{?build_testing} +%global bpf_set stable,testing +%else +%global bpf_set stable +%endif + +%meson -Dudevdir=%{udevdir} \ + -Dbpfs=%{bpf_set} \ + -Dtests=disabled %meson_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies @@ -152,10 +164,12 @@ export RUSTFLAGS="%build_rustflags" %{_firmware}/hid/bpf/*-XPPen__DecoMini4.bpf.o %{_firmware}/hid/bpf/*-Thrustmaster__TCA-Yoke-Boeing.bpf.o +%if 0%{?build_testing} %files testing %license LICENSE %license LICENSE.dependencies %{_udevhwdbdir}/81-hid-bpf-testing.hwdb +%endif %changelog %autochangelog