File cephfs.spec of Package cephfs

#
# spec file for package cephfs
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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:           cephfs
Version:        1.0
Release:        0
Summary:	Ceph Filesystem Kernel Module
License:        GPL-2.0
URL:            https://ceph.io/
Group:		System/Filesystems
Source:		Kbuild
Source1:        Module.supported
BuildRequires:  %kernel_module_package_buildreqs
BuildRequires:  kernel-source
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%kernel_module_package -p %_sourcedir/preamble

%description
This package contains the ceph client filesystem Kernel Packange Module
(ceph.ko). Ceph is an open-source software-defined storage platform
that provides object-based storage. The ceph.ko kernel module provides
an in-kernel filesystem module to access the ceph storage giving
the storage a filesystem interface.

%prep
%setup -cTn %{name}-%{version}
set -- *
mkdir source
#mv "$@" source/
mkdir obj

kern_src=/usr/src/linux
src_root=source/

mkdir -p $src_root
cp -a $kern_src/fs/ceph/* $src_root
cp $RPM_SOURCE_DIR/Kbuild $src_root/Makefile

%build
for flavor in %flavors_to_build; do
       rm -rf obj/$flavor
       cp -r source obj/$flavor
       cp %SOURCE1 obj/$flavor
       make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

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

%changelog

openSUSE Build Service is sponsored by