%global commit0 cd885ebca16cb192fce5a4a24a17318707c342ae %global date 20231118 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global tag %{version} %global debug_package %{nil} %global dkms_name tcp-brutal Name: kmod-%{dkms_name}-dkms Version: 1.0.1 Release: 1%{?dist} Summary: Hysteria's congestion control algorithm ported to kernel mode TCP - module sources License: GPLv3 URL: https://github.com/apernet/tcp-brutal BuildArch: noarch %if 0%{?tag:1} Source0: %{url}/archive/v%{version}.tar.gz#/%{dkms_name}-%{version}.tar.gz %else Source0: %{url}/archive/%{commit0}.tar.gz#/%{dkms_name}-%{shortcommit0}.tar.gz %endif Source1: %{name}.conf Requires: dkms %description TCP Brutal is Hysteria's congestion control algorithm ported to TCP, as a Linux kernel module. Information about Brutal itself can be found in the Hysteria documentation. As an official subproject of Hysteria, TCP Brutal is actively maintained to be in sync with the Brutal implementation in Hysteria. %prep %if 0%{?tag:1} %autosetup -p1 -n %{dkms_name}-%{version} %else %autosetup -p1 -n %{dkms_name}-%{commit0} %endif cp -f %{SOURCE1} dkms.conf sed -i -e 's/__VERSION_STRING/%{version}/g' dkms.conf %build %install # Create empty tree: mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ cp -fr * %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ %post dkms add -m %{dkms_name} -v %{version} || : # Rebuild and make available for the currently running kernel: dkms build -m %{dkms_name} -v %{version} || : dkms install -m %{dkms_name} -v %{version} --force || : %preun # Remove all versions from DKMS registry: dkms remove -m %{dkms_name} -v %{version} --all || : %files %{_usrsrc}/%{dkms_name}-%{version} %if 0%{?fedora} %{_sysconfdir}/dkms/%{dkms_name}.conf %endif %changelog * Sat Nov 18 2023 Vincent Wang - 1.0.1 - First build.