%define hmdfs_dest_path /usr/lib/modules/%(rpm -aq kernel-devel | cut -d "-" -f 3,4)/hmdfs Name: hmdfs Version: 1.0.0 Release: 1%{?dist} Summary: HMDFS is an overlay file system. License: Apache License 2.0 URL: https://gitee.com/openharmony/kernel_linux_5.10/tree/OpenHarmony-3.2-Release/fs/hmdfs Source0: https://gitee.com/src-openeuler/hmdfs/%{name}-%{version}.tar.gz Patch0: 0001-add-makefile-used-on-openeuler.patch Patch1: 0002-bugfix-null-pointer-in-memcpy.patch BuildRequires: gcc, make, kernel-devel %description HMDFS is an overlay file system. Relying on the underlying file system, under the premise of networking, file exchanges across devices can be realized. # Decompress source code package, make patches to the source code. %prep %setup -c %patch0 -p1 %patch1 -p1 # make. %build make %{?_smp_mflags} # install hmdfs's ko file to a certain path. %install install -d $RPM_BUILD_ROOT/%{hmdfs_dest_path}/ install -v %{name}.ko $RPM_BUILD_ROOT/%{hmdfs_dest_path}/ # copy ko file to the certain path on deployment environment. %files /%{hmdfs_dest_path}/*.ko %changelog * Thu Apr 27 2023 hepeng - 1.0.0-1 - Package init