From d6d794b1b6e283b97b98886eb5fd21936f17f171 Mon Sep 17 00:00:00 2001 From: Fabio Rodrigues Ribeiro Date: Mar 28 2021 22:19:32 +0000 Subject: Add SPEC file --- diff --git a/rtl88x2bu-kmod.spec b/rtl88x2bu-kmod.spec new file mode 100644 index 0000000..59306ad --- /dev/null +++ b/rtl88x2bu-kmod.spec @@ -0,0 +1,81 @@ +%global commit 48e7c19c92a77554403e1347447f8e2cfd780228 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +#global gitdate 20210321 + +%define buildforkernels akmod + +Name: rtl88x2bu-kmod +Version: 1.1 +Release: 1%{?dist} +Summary: Reaktek %{kmod_name} linux wireless driver +License: GPLv2 +URL: https://github.com/cilynx/rtl88x2bu +Source0: %{URL}/archive/%{commit}/rtl88x2bu-%{shortcommit}.tar.gz + +ExclusiveArch: x86_64 + +%global AkmodsBuildRequires %{_bindir}/kmodtool, xz, time, elfutils-libelf-devel, gcc, bc +BuildRequires: %{AkmodsBuildRequires} + +%global debug_package %{nil} + +# kmodtool does its magic here +%{expand:%(kmodtool --target %{_target_cpu} --repo fedora --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } + +%description +%{summary}. + +%package -n rtl88x2b +Summary: Common package of kernel modules for Realtek RTL8821CE Driver +Requires: %{name} = %{version}-%{release} +Provides: %{name}-common = %{version}-%{release} + +%description -n rtl88x2b +%{summary}. + +%prep +%{?kmodtool_check} +kmodtool --target %{_target_cpu} --repo fedora --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null + +%setup -q -c +pushd rtl88x2bu-%{commit} +#patch0 -p1 +popd + +for kernel_version in %{?kernel_versions} ; do +cp -a rtl88x2bu-%{commit} _kmod_build_${kernel_version%%___*} +done + +#prep +#setup -q -c -T -a 0 +# echo "/usr/lib/rpm/redhat/find-requires | %{__sed} -e '/^ksym.*/d'" > filter-requires.sh +echo "override rtl88x2bu * weak-updates/rtl88x2bu" > kmod-rtl88x2bu.conf + +%build +for kernel_version in %{?kernel_versions} ; do + pushd _kmod_build_${kernel_version%%___*} + make %{?_smp_mflags} \ + KSRC=${kernel_version##*___} \ + KVERS=${kernel_version%%___*} modules + popd +done + +%install +#export INSTALL_MOD_PATH=%{buildroot} +#export INSTALL_MOD_DIR=extra/%{kmod_name} +%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/ +%{__install} kmod-rtl88x2bu.conf %{buildroot}%{_sysconfdir}/depmod.d/ +# Set the module(s) to be executable, so that they will be stripped when packaged. +find %{buildroot} -type f -name \*.ko -exec %{__chmod} u+x \{\} \; + +for kernel_version in %{?kernel_versions}; do + install -d %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} + install _kmod_build_${kernel_version%%___*}/*.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} +done + +%{?akmod_install} + +%files -n rtl88x2b +%license rtl88x2bu-%{commit}/LICENSE +%doc rtl88x2bu-%{commit}/README.md +%{_sysconfdir}/depmod.d/kmod-rtl88x2bu.conf