1 %{!?_with_debug:%{!?_without_debug:%define _without_debug 0}}
3 %define kernel "%(/bin/rpm -q --whatprovides kernel-profile-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
23 # Temporary to address "have choice for kernel-devel"
24 BuildRequires: kernel-ivi-i386-default-devel
26 BuildRequires: kernel-devel
28 BuildRequires: libstdc++-devel
29 BuildRequires: pkgconfig(libpci)
30 BuildRequires: pkgconfig(zlib)
33 Summary: kernel module for Intel ethernet cards
35 Requires: kernel-profile-ivi = %{kernel_release}
38 Summary: IGB runtime library
39 Group: System/Libraries
42 Summary: Example clients
43 Group: Applications/System
44 Requires: openavb-libigb = %{version}
47 Summary: Headers and libraries
48 Group: Development/Libraries
49 Requires: %{name} = %{version}
52 Summary: Documentation
53 Group: Development/Tools
56 This package contains the basic OpenAVB userspace daemons.
59 This package contains the kernel module required by OpenAVB for Intel
63 This package contains the libigb runtime library from the OpenAVB
67 This package contains various test and example utilities for OpenAVB.
70 This package contains header files and libraries for OpenAVB.
73 This package contains some documentation from the OpenAVB distribution.
79 # For now, always compile for debugging...
80 #%if %{?_with_debug:1}%{!?_with_debug:0}
81 export CFLAGS="-O0 -g3"
82 export CXXFLAGS="-O0 -g3"
85 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
86 grep '^processor *:' | wc -l`"
87 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
89 CONFIG_OPTIONS="--enable-kmod-flags=EXTRA_CFLAGS=-DIGB_PTP"
92 %configure $CONFIG_OPTIONS && \
93 make BUILD_KERNEL=%{kernel_moddir} clean && \
94 make BUILD_KERNEL=%{kernel_moddir} -j$(($NUM_CPUS + 1))
97 rm -rf $RPM_BUILD_ROOT
99 make DESTDIR=$RPM_BUILD_ROOT \
100 INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
101 BUILD_KERNEL=%{kernel_moddir} install
103 rm -f $RPM_BUILD_ROOT%{_libdir}/libigb.la
105 # Install systemd and sample 'configuration' files.
106 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig \
107 $RPM_BUILD_ROOT/lib/systemd/system \
108 %{buildroot}/%{_sysconfdir}/modprobe.d
109 /usr/bin/install -m 644 packaging/openavb.env \
110 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/openavb
111 /usr/bin/install -m 644 -t $RPM_BUILD_ROOT/lib/systemd/system \
112 packaging/mrpd.service packaging/gptp.service
113 /usr/bin/install -m 644 packaging/igb_avb.conf \
114 %{buildroot}/%{_sysconfdir}/modprobe.d
117 rm -rf $RPM_BUILD_ROOT
126 depmod -a %{kernel_moddir}
129 %defattr(-,root,root,-)
130 %{_sbindir}/daemon_cl
133 %{_sysconfdir}/sysconfig/openavb
134 /lib/systemd/system/mrpd.service
135 /lib/systemd/system/gptp.service
138 %defattr(-,root,root,-)
139 %{kernel_modpath}/kernel/drivers/net/igb_avb
140 %config(noreplace)%{_sysconfdir}/modprobe.d/igb_avb.conf
143 %defattr(-,root,root,-)
144 %{_libdir}/libigb.so.*
147 %defattr(-,root,root,-)
150 %{_bindir}/simple_talker
153 %defattr(-,root,root,-)
156 %{_libdir}/pkgconfig/igb.pc
159 %defattr(-,root,root,-)
160 %doc README.rst documents
161 %license examples/LICENSE
162 %doc examples/mrp_client examples/simple_listener examples/simple_talker