Blame SPECS/ahci.spec

6fefcb
%define kmod_name		ahci
6fefcb
%define kmod_driver_version	327_RH1
6fefcb
%define kmod_rpm_release	1
6fefcb
%define kmod_git_hash		56e5a4be8d72a1b9cdfc1bae411c16c2c870fd3e
6fefcb
%define kmod_kernel_version	3.10.0-327.el7
6fefcb
%define kernel_version		3.10.0-327.el7
6fefcb
%define kmod_kbuild_dir		drivers/ata
6fefcb
6fefcb
6fefcb
%{!?dist: %define dist .el7}
6fefcb
6fefcb
Source0:	%{kmod_name}-%{kmod_driver_version}.tar.bz2
6fefcb
Source1:	%{kmod_name}.files
6fefcb
Source2:	depmodconf
6fefcb
Source3:	find-requires.ksyms
6fefcb
Source4:	find-provides.ksyms
6fefcb
Source5:	kmodtool
6fefcb
6fefcb
Patch0:		ahci.patch
6fefcb
6fefcb
%define __find_requires %_sourcedir/find-requires.ksyms
6fefcb
%define __find_provides %_sourcedir/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
6fefcb
6fefcb
Name:		%{kmod_name}
6fefcb
Version:	%{kmod_driver_version}
6fefcb
Release:	%{kmod_rpm_release}%{?dist}
6fefcb
Summary:	%{kmod_name} kernel module
6fefcb
6fefcb
Group:		System/Kernel
6fefcb
License:	GPLv2
6fefcb
URL:		http://www.kernel.org/
6fefcb
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
6fefcb
BuildRequires:	%kernel_module_package_buildreqs
6fefcb
ExclusiveArch:  x86_64
6fefcb
6fefcb
6fefcb
# Build only for standard kernel variant(s); for debug packages, append "debug"
6fefcb
# after "default" (separated by space)
6fefcb
%kernel_module_package -s %{SOURCE5} -f %{SOURCE1}  default
6fefcb
6fefcb
%description
6fefcb
%{kmod_name} - driver update
6fefcb
6fefcb
%prep
6fefcb
%setup
6fefcb
%patch0 -p1
6fefcb
set -- *
6fefcb
mkdir source
6fefcb
mv "$@" source/
6fefcb
mkdir obj
6fefcb
6fefcb
%build
6fefcb
for flavor in %flavors_to_build; do
6fefcb
	rm -rf obj/$flavor
6fefcb
	cp -r source obj/$flavor
6fefcb
6fefcb
	# update symvers file if existing
6fefcb
	symvers=source/Module.symvers-%{_target_cpu}
6fefcb
	if [ -e $symvers ]; then
6fefcb
		cp $symvers obj/$flavor/%{kmod_kbuild_dir}/Module.symvers
6fefcb
	fi
6fefcb
6fefcb
	make -C %{kernel_source $flavor} M=$PWD/obj/$flavor/%{kmod_kbuild_dir} \
6fefcb
		NOSTDINC_FLAGS="-I $PWD/obj/$flavor/include"
6fefcb
6fefcb
	# mark modules executable so that strip-to-file can strip them
6fefcb
	find obj/$flavor/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
6fefcb
done
6fefcb
6fefcb
%{SOURCE2} %{name} %{kmod_kernel_version} obj > source/depmod.conf
6fefcb
6fefcb
greylist=source/symbols.greylist-%{_target_cpu}
6fefcb
if [ -f $greylist ]; then
6fefcb
	cp $greylist source/symbols.greylist
6fefcb
else
6fefcb
	touch source/symbols.greylist
6fefcb
fi
6fefcb
6fefcb
if [ -d source/firmware ]; then
6fefcb
	make -C source/firmware
6fefcb
fi
6fefcb
6fefcb
%install
6fefcb
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
6fefcb
export INSTALL_MOD_DIR=extra/%{name}
6fefcb
for flavor in %flavors_to_build ; do
6fefcb
	make -C %{kernel_source $flavor} modules_install \
6fefcb
		M=$PWD/obj/$flavor/%{kmod_kbuild_dir}
6fefcb
	# Cleanup unnecessary kernel-generated module dependency files.
6fefcb
	find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
6fefcb
done
6fefcb
6fefcb
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
6fefcb
install -m 644 -D source/symbols.greylist $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
6fefcb
6fefcb
if [ -d source/firmware ]; then
6fefcb
	make -C source/firmware INSTALL_PATH=$RPM_BUILD_ROOT INSTALL_DIR=updates install
6fefcb
fi
6fefcb
6fefcb
%clean
6fefcb
rm -rf $RPM_BUILD_ROOT
6fefcb
6fefcb
%changelog
6fefcb
* Fri Nov 06 2015 Petr Oros <poros@redhat.com> 327_RH1 1
6fefcb
- Resolves: #1289098
6fefcb
- ahci DUP module