# Spec file for Open vSwitch.
-# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# -D "kernel_version 2.6.32.12-0.7.1.xs5.6.100.323.170596"
# -D "kernel_flavor xen"
# -bb /usr/src/redhat/SPECS/openvswitch-xen.spec
+#
+# If tests have to be skipped while building, specify the '--without check'
+# option. For example:
+# rpmbuild -bb --without check xenserver/openvswitch-xen.spec
%if %{?openvswitch_version:0}%{!?openvswitch_version:1}
%define openvswitch_version @VERSION@
# build-supplemental-pack.sh requires this naming for kernel module packages
%define module_package modules-%{kernel_flavor}-%{kernel_version}
+%bcond_without check
+
Name: openvswitch
Summary: Open vSwitch daemon/database/utilities
Group: System Environment/Daemons
%setup -q -n openvswitch-%{openvswitch_version}
%build
-./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --with-linux=/lib/modules/%{xen_version}/build --enable-ssl
+./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --with-linux=/lib/modules/%{xen_version}/build --enable-ssl CFLAGS='-g -O2 -msse -msse2'
make %{_smp_mflags}
%install
# Get rid of stuff we don't want to make RPM happy.
rm \
$RPM_BUILD_ROOT/usr/bin/ovs-benchmark \
+ $RPM_BUILD_ROOT/usr/bin/ovs-testcontroller \
$RPM_BUILD_ROOT/usr/bin/ovs-l3ping \
$RPM_BUILD_ROOT/usr/bin/ovs-pki \
$RPM_BUILD_ROOT/usr/bin/ovs-test \
$RPM_BUILD_ROOT/usr/share/man/man1/ovs-benchmark.1 \
+ $RPM_BUILD_ROOT/usr/share/man/man8/ovs-testcontroller.8 \
$RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \
$RPM_BUILD_ROOT/usr/share/man/man8/ovs-pki.8 \
$RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8
(cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*)
+(cd "$RPM_BUILD_ROOT" && rm -rf usr/include)
+(cd "$RPM_BUILD_ROOT" && rm -rf usr/lib/pkgconfig)
install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
+%check
+%if %{with check}
+ if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
+ make check TESTSUITEFLAGS='--recheck'; then :;
+ else
+ cat tests/testsuite.log
+ exit 1
+ fi
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
/usr/bin/ovs-appctl
/usr/bin/ovs-dpctl
/usr/bin/ovs-dpctl-top
+/usr/bin/ovs-docker
/usr/bin/ovs-ofctl
/usr/bin/ovs-parse-backtrace
/usr/bin/ovs-pcap