File dkms-rtl8812au.spec of Package dkms-rtl8812au
#
# spec file for package dkms-rtl8812au
#
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 bumblebee.obs@gmail.com
#
%define modname rtl8812au
%define kmodname 88XXau
Name: dkms-%{modname}
Summary: Kernel module for Realtek RTL8812AU
Version: 5.3.4
Release: 0
URL: https://github.com/Ximi1970/rtl8812au
Group: System/Kernel
License: GPL-2.0
Vendor: Ximi1970
Source0: %{modname}-%{version}.tgz
Source1000: %{name}-rpmlintrc
Patch0: %{modname}-%{version}.diff
%ifarch armv7hl
Patch1: %{modname}-%{version}-rpi.diff
%endif
%ifarch aarch64
Patch1: %{modname}-%{version}-rpi3.diff
%endif
#
BuildRequires: unzip
#
Requires: binutils
%ifarch aarch64
#Requires: gcc5
Requires: gcc
%else
Requires: gcc
%endif
Requires: make
Requires: patch
%if 0%{?mdkversion}
Requires: dkms-minimal
%else
Requires: dkms
%endif
#BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package contains linux kernel module for Realtek RTL8812AU
%prep
%setup -q -n %{modname}-%{version}
#
%patch0 -p1
%ifarch armv7hl aarch64
%patch1 -p1
%endif
%build
%install
rm -rf %{buildroot}
#
rm dkms.conf
#
find . -name "*.c" -exec chmod ugo-x {} \;
find . -name "*.h" -exec chmod ugo-x {} \;
#
install -d -m 755 %{buildroot}/usr/src/%{modname}-%{version}-%{release}
#
cp -rf %{_builddir}/%{modname}-%{version}/* %{buildroot}/usr/src/%{modname}-%{version}-%{release}
#
cat > %{buildroot}/usr/src/%{modname}-%{version}-%{release}/dkms.conf << EOF
PACKAGE_NAME=%{modname}
PACKAGE_VERSION=%{version}-%{release}
MAKE[0]="'make' -j2 modules"
CLEAN[0]="'make' clean"
DEST_MODULE_LOCATION[0]="/updates/"
BUILT_MODULE_NAME[0]="%{kmodname}"
AUTOINSTALL="yes"
NO_WEAK_MODULES="yes"
EOF
%clean
rm -rf %{buildroot}
%post
if [ -x /usr/sbin/dkms ] && [ -z "`/usr/sbin/dkms status -m %{modname} -v %{version}-%{release}`" ] ; then
/usr/sbin/dkms add -m %{modname} -v %{version}-%{release} --rpm_safe_upgrade || :
/usr/sbin/dkms build -m %{modname} -v %{version}-%{release} || :
/usr/sbin/dkms install -m %{modname} -v %{version}-%{release} || :
fi
%preun
# rmmod can fail
if [ -x /sbin/rmmod ] ; then
/sbin/rmmod %{modname} >/dev/null 2>&1 || :
fi
#
if [ -x /usr/sbin/dkms ] && [ -n "`/usr/sbin/dkms status -m %{modname} -v %{version}-%{release}`" ] ; then
/usr/sbin/dkms remove -m %{modname} -v %{version}-%{release} --all --rpm_safe_upgrade || :
fi
%files
%defattr(-,root,root)
%dir /usr/src/%{modname}-%{version}-%{release}
/usr/src/%{modname}-%{version}-%{release}
%changelog