Skip to content

Commit 255237f

Browse files
binujpBinu Jose Philip
andauthored
Change kernel-mft rpm name to mft_kernel (#12025)
Co-authored-by: Binu Jose Philip <[email protected]>
1 parent 53fa283 commit 255237f

File tree

3 files changed

+117
-99
lines changed

3 files changed

+117
-99
lines changed

SPECS-SIGNED/mft_kernel-signed/mft_kernel-signed.spec

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55

66
%global KVERSION %{target_kernel_version_full}
77

8-
%global _name kernel-mft
9-
10-
Name: %{_name}
11-
Summary: %{name} Kernel Module for the %{KVERSION} kernel
12-
Version: 4.30.0
13-
Release: 1%{?dist}
14-
License: Dual BSD/GPLv2
15-
Group: System Environment/Kernel
8+
Name: mft_kernel
9+
Summary: %{name} Kernel Module for the %{KVERSION} kernel
10+
Version: 4.30.0
11+
Release: 1%{?dist}
12+
License: Dual BSD/GPLv2
13+
Group: System Environment/Kernel
1614

1715
#
1816
# To populate these sources:
@@ -21,7 +19,7 @@ Group: System Environment/Kernel
2119
# 3. Place the unsigned package and signed binary in this spec's folder
2220
# 4. Build this spec
2321

24-
Source0: %{name}-%{version}-%{release}.%{_arch}.rpm
22+
Source0: kernel-mft-%{version}-%{release}.%{_arch}.rpm
2523
Source1: mst_pci.ko
2624
Source2: mst_pciconf.ko
2725
Vendor: Microsoft Corporation
@@ -34,6 +32,17 @@ Requires: kmod
3432
%description
3533
mft kernel module(s)
3634

35+
# Azure Linux attempts to match the spec file name and the "Name" tag.
36+
# Upstream's mft_kernel spec set rpm name as kernel-mft. To comply, we
37+
# set "Name" as mft_kernel but force a build of kernel-mft rpm and
38+
# prevent mft_kernel rpm. A %files section is declared for kernel-mft
39+
# but not for mft_kernel which is the default rpm.
40+
%package -n kernel-mft
41+
Summary: kernel-mft Kernel Module for the %{KVERSION} kernel
42+
43+
%description -n kernel-mft
44+
This package provides a kernel-mft kernel module.
45+
3746
%global debug_package %{nil}
3847

3948
%prep
@@ -56,9 +65,9 @@ rm -rf %{buildroot}
5665
%postun
5766
/sbin/depmod %{KVERSION}
5867

59-
%files
68+
%files -n kernel-mft
6069
%defattr(-,root,root,-)
61-
%license %{_datadir}/licenses/%{name}/COPYING
70+
%license %{_defaultlicensedir}/kernel-mft/COPYING
6271
/lib/modules/%{KVERSION}/updates/
6372

6473
%changelog

SPECS/mft_kernel/mft_kernel.spec

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@
2626
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
2727
%{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}
2828

29-
%if "%{KMP}" == "1"
30-
%global _name kernel-mft-mlnx
31-
%else
32-
%global _name kernel-mft
33-
%endif
34-
3529
%{!?version: %global version 4.30.0}
3630
%{!?_release: %global _release 1}
3731
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}
3832

39-
Name: kernel-mft
33+
Name: mft_kernel
4034
Summary: %{name} Kernel Module for the %{KVERSION} kernel
4135
Version: 4.30.0
4236
Release: 1%{?dist}
@@ -59,10 +53,21 @@ BuildRequires: kmod
5953
Requires: kernel = %{target_kernel_version_full}
6054
Requires: kmod
6155

62-
6356
%description
6457
mft kernel module(s)
6558

59+
# Azure Linux attempts to match the spec file name and the "Name" tag.
60+
# Upstream's mft_kernel spec set rpm name as kernel-mft. To comply, we
61+
# set "Name" as mft_kernel but force a build of kernel-mft rpm and
62+
# prevent mft_kernel rpm. A %files section is declared for kernel-mft
63+
# but not for mft_kernel which is the default rpm.
64+
%package -n kernel-mft
65+
Summary: kernel-mft Kernel Module for the %{KVERSION} kernel
66+
67+
%description -n kernel-mft
68+
This package provides a kernel-mft kernel module.
69+
70+
6671
%global debug_package %{nil}
6772

6873
%global IS_RHEL_VENDOR "%{_vendor}" == "redhat" || "%{_vendor}" == "bclinux" || "%{_vendor}" == "openEuler"
@@ -209,8 +214,12 @@ find %{buildroot} -type f -name \*.ko -exec %{__strip} -p --strip-debug --discar
209214
%postun
210215
/sbin/depmod %{KVERSION}
211216

217+
# Install license file to %{_defaultlicensedir}/kernel-mft for %files to pick-up
218+
# and set license metadata correct
219+
%define licensedir %{_defaultlicensedir}/kernel-mft/
220+
212221
%if "%{KMP}" != "1"
213-
%files
222+
%files -n kernel-mft
214223
%defattr(-,root,root,-)
215224
%license source/COPYING
216225
/lib/modules/%{KVERSION}/%{install_mod_dir}/

0 commit comments

Comments
 (0)