File anbox-modules.spec of Package anbox-modules

# This file is automatically generated by the OBS service.
# The Version and Source0 will be created from the Git repository.

Name:           anbox-modules
Version:        20250305.18f37ba
Release:        0
Summary:        Anbox binder kernel module
License:        GPL-2.0-only
URL:            https://github.com/llyyr/anbox-modules
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}-preamble
Patch0:         fix-leap-15_5.patch
BuildRequires:  %{kernel_module_package_buildreqs}
Requires:       anbox-kmp = %{version}
%kernel_module_package -n anbox -p %{SOURCE1}

%description
Anbox binder out-of-tree kernel module.

%prep
%autosetup -p1

set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
for flavor in %{flavors_to_build} ; do
    rm -rf obj/$flavor
    cp -r source obj/$flavor
    %make_build V=1 -C %{kernel_source $flavor} %{?linux_make_arch} modules M=$PWD/obj/$flavor/binder
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR='%{kernel_module_package_moddir}'

for flavor in %{flavors_to_build} ; do
    make V=1 -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor/binder
done

export BRP_PESIGN_FILES='*.ko'

install -D -m 0644 -t %{buildroot}%{_modulesloaddir} source/anbox.conf
install -D -m 0644 -t %{buildroot}%{_udevrulesdir} source/99-anbox.rules

%files
%license source/debian/copyright
%doc source/README.md
%dir %{_modulesloaddir}
%{_modulesloaddir}/anbox.conf
%{_udevrulesdir}/99-anbox.rules

%changelog
* Mon Jun 23 2025 itachi_re <xanbenson99@gmail.com> - 20250305.18f37ba-0
- Initial packaging for openSUSE
openSUSE Build Service is sponsored by