1 %{!?_with_debug:%{!?_without_debug:%define _without_debug 0}}
3 %define kernel kernel-x86-ivi
4 %define kernel_relstr "%(/bin/rpm -q --queryformat '%{VERSION}-%{RELEASE}' %{kernel})"
5 %define kernel_release %(echo %{kernel_relstr})
6 %define kernel_modstr "%(/bin/rpm -ql %{kernel} | sort | grep /lib/modules/%{kernel_release} | head -1 | sed 's#/*$##g')"
7 %define kernel_modpath %(echo %{kernel_modstr})
8 %define kernel_moddir %(echo %{kernel_modstr} | sed 's#.*/##g')
14 License: Intel and GPL-2.0
15 Group: Automotive/Ethernet AVB
16 URL: https://github.com/intel-ethernet/Open-AVB
17 Source0: %{name}-%{version}.tar.gz
18 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
19 Requires: openavb-kmod-igb
20 ExclusiveArch: %ix86 x86_64
22 BuildRequires: libstdc++-devel
23 BuildRequires: kernel-devel
24 BuildRequires: pkgconfig(libpci)
25 BuildRequires: pkgconfig(zlib)
28 Summary: kernel module for Intel ethernet cards
30 Requires: %{kernel} = %{kernel_release}
33 Summary: IGB runtime library
34 Group: System/Libraries
37 Summary: Example clients
38 Group: Applications/System
39 Requires: openavb-libigb = %{version}
42 Summary: Headers and libraries
43 Group: Development/Libraries
44 Requires: %{name} = %{version}
47 Summary: Documentation
48 Group: Development/Tools
51 This package contains the basic OpenAVB userspace daemons.
54 This package contains the kernel module required by OpenAVB for Intel
58 This package contains the libigb runtime library from the OpenAVB
62 This package contains various test and example utilities for OpenAVB.
65 This package contains header files and libraries for OpenAVB.
68 This package contains some documentation from the OpenAVB distribution.
74 # For now, always compile for debugging...
75 #%if %{?_with_debug:1}%{!?_with_debug:0}
76 export CFLAGS="-O0 -g3"
77 export CXXFLAGS="-O0 -g3"
80 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
81 grep '^processor *:' | wc -l`"
82 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
84 CONFIG_OPTIONS="--enable-kmod-flags=EXTRA_CFLAGS=-DIGB_PTP"
87 %configure $CONFIG_OPTIONS && \
88 make BUILD_KERNEL=%{kernel_moddir} clean && \
89 make BUILD_KERNEL=%{kernel_moddir} -j$(($NUM_CPUS + 1))
92 rm -rf $RPM_BUILD_ROOT
94 make DESTDIR=$RPM_BUILD_ROOT \
95 INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
96 BUILD_KERNEL=%{kernel_moddir} install
98 rm -f $RPM_BUILD_ROOT%{_libdir}/libigb.la
100 # Install systemd and sample 'configuration' files.
101 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig \
102 $RPM_BUILD_ROOT/lib/systemd/system \
103 %{buildroot}/%{_sysconfdir}/modprobe.d
104 /usr/bin/install -m 644 packaging/openavb.env \
105 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/openavb
106 /usr/bin/install -m 644 -t $RPM_BUILD_ROOT/lib/systemd/system \
107 packaging/mrpd.service packaging/gptp.service
108 /usr/bin/install -m 644 packaging/igb_avb.conf \
109 %{buildroot}/%{_sysconfdir}/modprobe.d
112 rm -rf $RPM_BUILD_ROOT
121 depmod -a %{kernel_moddir}
124 %defattr(-,root,root,-)
125 %{_sbindir}/daemon_cl
128 %{_sysconfdir}/sysconfig/openavb
129 /lib/systemd/system/mrpd.service
130 /lib/systemd/system/gptp.service
133 %defattr(-,root,root,-)
134 %{kernel_modpath}/kernel/drivers/net/igb_avb
135 %config(noreplace)%{_sysconfdir}/modprobe.d/igb_avb.conf
138 %defattr(-,root,root,-)
139 %{_libdir}/libigb.so.*
142 %defattr(-,root,root,-)
145 %{_bindir}/simple_talker
148 %defattr(-,root,root,-)
151 %{_libdir}/pkgconfig/igb.pc
154 %defattr(-,root,root,-)
155 %doc README.rst documents
156 %license examples/LICENSE
157 %doc examples/mrp_client examples/simple_listener examples/simple_talker