File xhci-pci.spec of Package xhci-pci
#
# spec file for package xhci-pci
#
# Copyright (c) 2025 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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 http://bugs.opensuse.org/
#
Name: xhci-pci
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
Version: %{version}
Release: 0
Summary: Kernel module for xHCI PCI Host Controller Driver
License: GPL-2.0
Url: https://kernel.org
Source0: Makefile
Source1: 0001-usb-xhci-pci-add-support-for-hosts-with-zero-usb3-po.patch
Source2: preamble
BuildRequires: kernel-source
BuildRequires: kernel-syms
BuildRequires: module-init-tools
%suse_kernel_module_package -p %_sourcedir/preamble -x default
%description
xHCI PCI Host Controller Driver adding support for hosts with zero usb3 ports.
%package kmp
Summary: Kernel module for xHCI PCI Host Controller Driver
%description kmp
xHCI PCI Host Controller Driver adding support for hosts with zero usb3 ports.
%prep
set -- /usr/src/linux/drivers/usb/host/*
mkdir source
cp -ar "$@" source/
cp %{S:0} source/
cp %{S:1} source/
pushd source
patch xhci-pci.c -p0 < 0001-usb-xhci-pci-add-support-for-hosts-with-zero-usb3-po.patch
popd
mkdir obj
%build
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
for flavor in %flavors_to_build; do
rm -rf obj/$flavor
cp -r source obj/$flavor
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
M=$PWD/obj/$flavor
done
%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
done
%changelog