# /usr/bin/ovs-tcpdump
# /usr/bin/ovs-testcontroller
# /usr/bin/vtep-ctl
-# /usr/include/openflow/intel-ext.h
-# /usr/include/openflow/netronome-ext.h
-# /usr/include/openflow/nicira-ext.h
-# /usr/include/openflow/openflow-1.0.h
-# /usr/include/openflow/openflow-1.1.h
-# /usr/include/openflow/openflow-1.2.h
-# /usr/include/openflow/openflow-1.3.h
-# /usr/include/openflow/openflow-1.4.h
-# /usr/include/openflow/openflow-1.5.h
-# /usr/include/openflow/openflow-1.6.h
-# /usr/include/openflow/openflow-common.h
-# /usr/include/openflow/openflow.h
-# /usr/include/openvswitch/compiler.h
-# /usr/include/openvswitch/dynamic-string.h
-# /usr/include/openvswitch/flow.h
-# /usr/include/openvswitch/geneve.h
-# /usr/include/openvswitch/hmap.h
-# /usr/include/openvswitch/json.h
-# /usr/include/openvswitch/list.h
-# /usr/include/openvswitch/match.h
-# /usr/include/openvswitch/meta-flow.h
-# /usr/include/openvswitch/netdev.h
-# /usr/include/openvswitch/nsh.h
-# /usr/include/openvswitch/ofp-actions.h
-# /usr/include/openvswitch/ofp-ed-props.h
-# /usr/include/openvswitch/ofp-errors.h
-# /usr/include/openvswitch/ofp-msgs.h
-# /usr/include/openvswitch/ofp-parse.h
-# /usr/include/openvswitch/ofp-print.h
-# /usr/include/openvswitch/ofp-prop.h
-# /usr/include/openvswitch/ofp-util.h
-# /usr/include/openvswitch/ofpbuf.h
-# /usr/include/openvswitch/packets.h
-# /usr/include/openvswitch/shash.h
-# /usr/include/openvswitch/thread.h
-# /usr/include/openvswitch/token-bucket.h
-# /usr/include/openvswitch/tun-metadata.h
-# /usr/include/openvswitch/type-props.h
-# /usr/include/openvswitch/types.h
-# /usr/include/openvswitch/util.h
-# /usr/include/openvswitch/uuid.h
-# /usr/include/openvswitch/vconn.h
-# /usr/include/openvswitch/version.h
-# /usr/include/openvswitch/vlog.h
-# /usr/include/ovn/actions.h
-# /usr/include/ovn/expr.h
-# /usr/include/ovn/lex.h
-# /usr/lib64/libofproto.a
-# /usr/lib64/libofproto.la
-# /usr/lib64/libopenvswitch.a
-# /usr/lib64/libopenvswitch.la
-# /usr/lib64/libovn.a
-# /usr/lib64/libovn.la
-# /usr/lib64/libovsdb.a
-# /usr/lib64/libovsdb.la
-# /usr/lib64/libsflow.a
-# /usr/lib64/libsflow.la
-# /usr/lib64/libvtep.a
-# /usr/lib64/libvtep.la
-# /usr/lib64/pkgconfig/libofproto.pc
-# /usr/lib64/pkgconfig/libopenvswitch.pc
-# /usr/lib64/pkgconfig/libovsdb.pc
-# /usr/lib64/pkgconfig/libsflow.pc
# /usr/share/man/man1/ovn-detrace.1.gz
# /usr/share/man/man5/ovn-nb.5.gz
# /usr/share/man/man5/ovn-sb.5.gz
#
# Conditional build:
-%bcond_without dist_kernel # allow non-distribution kernel
-%bcond_without kernel # don't build kernel modules
+%bcond_with kernel # build kernel module for flow-based switching for kernels < 4.11
%bcond_without userspace # don't build userspace programs
%bcond_with verbose # verbose build (V=1)
-# set kernel_builtin to true for kernels with openvswitch module (>= 3.3)
-%define kernel_builtin %(echo %{_kernel_ver} | awk '{ split($0, v, "."); vv=v[1]*1000+v[2]; if (vv >= 3003) print 1; else print 0 }')
-#'
-%if %{kernel_builtin} == 1
-%undefine with_kernel
+%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
+%{error:kernel and userspace cannot be built at the same time on PLD builders}
+exit 1
%endif
-%if %{without kernel}
-%undefine with_dist_kernel
-%endif
-%if "%{_alt_kernel}" != "%{nil}"
-%undefine with_userspace
-%endif
%if %{without userspace}
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
%define pname openvswitch
Summary: Production Quality, Multilayer Open Virtual Switch
#Summary(pl.UTF-8): -
-Name: %{pname}%{_alt_kernel}
+Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
Version: 2.8.1
-Release: %{rel}
+Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
License: Apache v2.0
Group: Networking/Daemons
Source0: http://openvswitch.org/releases/%{pname}-%{version}.tar.gz
Source10: %{pname}.service
URL: http://openvswitch.org/
BuildRequires: Zope-Interface
-BuildRequires: automake
BuildRequires: autoconf
+BuildRequires: automake
BuildRequires: graphviz
BuildRequires: groff
BuildRequires: openssl-devel
BuildRequires: openssl-tools
BuildRequires: pkgconfig
-BuildRequires: sip-PyQt4
BuildRequires: python-PyQt4-devel-tools
BuildRequires: python-TwistedConch
BuildRequires: python-TwistedCore
BuildRequires: python-distribute
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: rpmbuild(macros) >= 1.701
+BuildRequires: sip-PyQt4
%if %{with kernel}
-%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.32}
+%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:3.11}
%else
-Requires: uname(release) >= 3.3
+Requires: uname(release) >= 3.11
%endif
Requires(post,preun): /sbin/chkconfig
Requires(post,preun,postun): systemd-units >= 38
servers similar to VMware's vNetwork distributed vswitch or Cisco's
Nexus 1000V.
+%package devel
+Summary: Header files and development libraries for openvswitch
+Group: Development/Libraries
+
+%description devel
+Header files and development libraries for openvswitch.
+
%package -n python-openvswitch
Summary: Open vSwitch python bindings
Group: Development/Languages/Python
This package contains utilities that are useful to diagnose
performance and connectivity issues in Open vSwitch setup.
-%package -n kernel%{_alt_kernel}-net-openvswitch
-Summary: Linux driver for openvswitch
-Summary(pl.UTF-8): Sterownik dla Linuksa do openvswitch
-Release: %{rel}@%{_kernel_ver_str}
-Group: Base/Kernel
-Requires(post,postun): /sbin/depmod
-%if %{with dist_kernel}
-%requires_releq_kernel
-Requires(postun): %releq_kernel
-%endif
-
-%description -n kernel%{_alt_kernel}-net-openvswitch
-This is driver for openvswitch for Linux.
-
-This package contains Linux module.
-
-%description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8
-Sterownik dla Linuksa do openvswitch.
-
-Ten pakiet zawiera moduł jądra Linuksa.
+%define kernel_pkg()\
+%package -n kernel%{_alt_kernel}-net-openvswitch\
+Summary: Linux driver for openvswitch\
+Summary(pl.UTF-8): Sterownik dla Linuksa do openvswitch\
+Release: %{rel}@%{_kernel_ver_str}\
+Group: Base/Kernel\
+Requires(post,postun): /sbin/depmod\
+%requires_releq_kernel\
+Requires(postun): %releq_kernel\
+\
+%description -n kernel%{_alt_kernel}-net-openvswitch\
+This is driver for openvswitch for Linux.\
+\
+This package contains Linux module.\
+\
+%description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8\
+Sterownik dla Linuksa do openvswitch.\
+\
+Ten pakiet zawiera moduł jądra Linuksa.\
+\
+%if %{with kernel}\
+%files -n kernel%{_alt_kernel}-net-openvswitch\
+%defattr(644,root,root,755)\
+/etc/modprobe.d/%{_kernel_ver}/openvswitch.conf\
+%dir /lib/modules/%{_kernel_ver}/kernel/net/openvswitch\
+/lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*\
+%endif\
+\
+%post -n kernel%{_alt_kernel}-net-openvswitch\
+%depmod %{_kernel_ver}\
+\
+%postun -n kernel%{_alt_kernel}-net-openvswitch\
+%depmod %{_kernel_ver}\
+%{nil}
+
+%define build_kernel_pkg()\
+%configure \\\
+ --with-linux=%{_kernelsrcdir} \\\
+ --with-linux-source=%{_kernelsrcdir}\
+\
+%{__make} clean\
+%{__make} -C datapath/linux %{?with_verbose:V=1}\
+%install_kernel_modules -D installed -s %{version} -n openvswitch -m datapath/linux/openvswitch,datapath/linux/vport-geneve,datapath/linux/vport-gre,datapath/linux/vport-lisp,datapath/linux/vport-stt,datapath/linux/vport-vxlan -d kernel/net/openvswitch\
+%{nil}
+
+%{?with_kernel:%{expand:%create_kernel_packages}}
%prep
%setup -q -n %{pname}-%{version}
cp %{SOURCE3} .
%build
-%configure \
-%if %{with kernel}
- --with-linux=%{_kernelsrcdir} \
- --with-linux-source=%{_kernelsrcdir}
-%endif
+%{?with_kernel:%{expand:%build_kernel_packages}}
+%if %{with userspace}
+%configure
+%{__make} clean
%{__make}
+%endif
%install
rm -rf $RPM_BUILD_ROOT
%if %{with userspace}
install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
$RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts} \
- $RPM_BUILD_ROOT{%{_desktopdir},%{_datadir}/%{pname}/pki}
+ $RPM_BUILD_ROOT%{_datadir}/%{pname}/pki
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
-install -p %{SOURCE11} $RPM_BUILD_ROOT%{_desktopdir}
%{__mv} $RPM_BUILD_ROOT%{_datadir}/%{pname}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{pname}/python
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
+
%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
%endif
%if %{with kernel}
-cd datapath/linux
-%install_kernel_modules -m openvswitch -d kernel/net/openvswitch
+cp -a installed/* $RPM_BUILD_ROOT
%endif
%clean
%postun
%systemd_reload
-%post -n kernel%{_alt_kernel}-net-openvswitch
-%depmod %{_kernel_ver}
-
-%postun -n kernel%{_alt_kernel}-net-openvswitch
-%depmod %{_kernel_ver}
-
%if %{with userspace}
%files
%defattr(644,root,root,755)
%{_mandir}/man8/ovs-vsctl.8*
%{_mandir}/man8/ovs-vswitchd.8*
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/openflow
+%{_includedir}/openvswitch
+%{_includedir}/ovn
+%{_libdir}/libofproto.a
+%{_libdir}/libopenvswitch.a
+%{_libdir}/libovn.a
+%{_libdir}/libovsdb.a
+%{_libdir}/libsflow.a
+%{_libdir}/libvtep.a
+%{_pkgconfigdir}/libofproto.pc
+%{_pkgconfigdir}/libopenvswitch.pc
+%{_pkgconfigdir}/libovsdb.pc
+%{_pkgconfigdir}/libsflow.pc
+
%files -n python-openvswitch
%defattr(644,root,root,755)
%dir %{py_sitescriptdir}/ovs
%{py_sitescriptdir}/ovstest
%{_mandir}/man8/ovs-test.8*
%endif
-
-%if %{with kernel}
-%files -n kernel%{_alt_kernel}-net-openvswitch
-%defattr(644,root,root,755)
-%dir /lib/modules/%{_kernel_ver}/kernel/net/openvswitch
-/lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*
-%endif