File akida.spec of Package akida

#
# spec file for package akida
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           akida
Version:        git20240617~4050b5a
Release:        0
Summary:        Akida kernel drivers
License:        GPL-2.0-only
Group:          System/Kernel
URL:            https://github.com/BrainChip-Inc/akida_dw_edma
Source0:        akida_dw_edma-%{version}.tar.gz
Source1:        preamble
BuildRequires:  %{kernel_module_package_buildreqs}
%kernel_module_package -p %_sourcedir/preamble

%description
This package contains BrainChip Akida kernel drivers.

%prep
%setup -q -n akida_dw_edma-%{version}
# We don't want to be told it's not supported but to see whether actual build errors occur
sed -i 's/6\.9/7.0/g' Makefile
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 %{?_smp_mflags} -C %{kernel_source $flavor} %{?linux_make_arch} modules M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=%{buildroot}
for flavor in %{flavors_to_build}; do
        make -C %{kernel_source $flavor} %{?linux_make_arch} modules_install M=$PWD/obj/$flavor
done

%changelog
openSUSE Build Service is sponsored by