Blame SPECS/kmod-wireguard.spec

fafb58
%global _use_internal_dependency_generator 0
fafb58
%global debug_package %{nil}
fafb58
fafb58
%define __spec_install_post \
fafb58
  %{?__debug_package:%{__debug_install_post}} \
fafb58
  %{__arch_install_post} \
fafb58
  %{__os_install_post} \
fafb58
  %{__mod_compress_install_post}
fafb58
fafb58
%define __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
fafb58
fafb58
%define pkg wireguard
fafb58
fafb58
%define kernel_version 4.18.0-305.el8
fafb58
fafb58
Name:             kmod-%{pkg}
fafb58
Version:          1.0.20210424
fafb58
Release:          1%{?dist}
fafb58
Summary:          Fast, modern, secure VPN tunnel
fafb58
fafb58
License:          GPLv2
fafb58
URL:              https://www.wireguard.com/
fafb58
fafb58
Source0:          https://git.zx2c4.com/%{pkg}-linux-compat/snapshot/%{pkg}-linux-compat-%{version}.tar.xz
fafb58
fafb58
ExclusiveArch:    x86_64 aarch64
fafb58
fafb58
BuildRequires:    elfutils-libelf-devel
fafb58
BuildRequires:    kernel-devel = %{kernel_version}
fafb58
BuildRequires:    kernel-rpm-macros
fafb58
BuildRequires:    kmod
fafb58
BuildRequires:    redhat-rpm-config
fafb58
BuildRequires:    xz
fafb58
fafb58
Supplements:      kernel = %{kernel_version}
fafb58
fafb58
Requires:         (kernel = %{kernel_version} if kernel)
fafb58
Requires(post):   /usr/sbin/depmod
fafb58
Requires(postun): /usr/sbin/depmod
fafb58
fafb58
Provides:         kernel-modules = %{kernel_version}.%{_arch}
fafb58
Provides:         %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
fafb58
fafb58
fafb58
BuildRequires:    gcc
fafb58
BuildRequires:    make
fafb58
fafb58
Supplements:      wireguard-tools
fafb58
fafb58
fafb58
%description
fafb58
WireGuard is an extremely simple yet fast and modern VPN that utilizes
fafb58
state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more
fafb58
useful than IPsec, while avoiding the massive headache. It intends to be
fafb58
considerably more performant than OpenVPN. WireGuard is designed as a general
fafb58
purpose VPN for running on embedded interfaces and super computers alike, fit
fafb58
for many different circumstances.
fafb58
fafb58
fafb58
%prep
fafb58
%autosetup -p1 -n %{pkg}-linux-compat-%{version}
fafb58
fafb58
fafb58
%build
fafb58
pushd src
fafb58
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
fafb58
popd
fafb58
fafb58
fafb58
%install
fafb58
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/%{pkg} src/%{pkg}.ko
fafb58
fafb58
# Temporarily executable for stripping
fafb58
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
fafb58
fafb58
fafb58
%clean
fafb58
%{__rm} -rf %{buildroot}
fafb58
fafb58
fafb58
%post
fafb58
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
fafb58
fafb58
fafb58
%postun
fafb58
/usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
fafb58
fafb58
fafb58
%files
fafb58
%defattr(644,root,root,755)
fafb58
/lib/modules/%{kernel_version}.%{_arch}
fafb58
%license COPYING
fafb58
%doc README.md
fafb58
fafb58
fafb58
%changelog