-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfa_sniffer.spec
51 lines (44 loc) · 1.51 KB
/
fa_sniffer.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Summary: PCI express FA sniffer driver
Name: fa_sniffer
Version: @VERSION@
Release: @RELEASE@
License: GPL
Group: System Environment/Kernel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
Requires: dkms
Requires: udev
Packager: Michael Abbott <[email protected]>
# The two target directories
%define dkmsdir /usr/src/%{name}-%{version}
%define udevdir /etc/udev/rules.d
%description
Installs FA sniffer driver kernel module using dkms. This provides
a continuous streaming interface to Libera Fast Acquisition data and
relies on a dedicated FPGA card.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{dkmsdir} %{buildroot}%{udevdir}
install -m 0644 %{_sourcedir}/fa_sniffer.c %{buildroot}%{dkmsdir}
install -m 0644 %{_sourcedir}/fa_sniffer.h %{buildroot}%{dkmsdir}
install -m 0644 %{_sourcedir}/Makefile %{buildroot}%{dkmsdir}
install -m 0644 %{_sourcedir}/Kbuild %{buildroot}%{dkmsdir}
install -m 0644 %{_sourcedir}/rpmbuild/dkms.conf %{buildroot}%{dkmsdir}
install -m 0644 %{_sourcedir}/11-fa_sniffer.rules %{buildroot}%{udevdir}
%files
%{dkmsdir}/fa_sniffer.c
%{dkmsdir}/fa_sniffer.h
%{dkmsdir}/Makefile
%{dkmsdir}/Kbuild
%{dkmsdir}/dkms.conf
%{udevdir}/11-fa_sniffer.rules
%post
dkms add -m %{name} -v %{version} --rpm_safe_upgrade
dkms build -m %{name} -v %{version}
dkms install -m %{name} -v %{version}
modprobe fa_sniffer
%preun
modprobe -r fa_sniffer
dkms remove --all -m %{name} -v %{version} --rpm_safe_upgrade
%postun
rmdir /usr/src/%{name}-%{version}