forked from pool/openvswitch
8b944bd91c
new upstream version 1.2.0 : added support to linux 3.0 OBS-URL: https://build.opensuse.org/request/show/78337 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=4
211 lines
6.8 KiB
RPMSpec
211 lines
6.8 KiB
RPMSpec
#
|
||
# spec file for package
|
||
#
|
||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||
#
|
||
# All modifications and additions to the file contributed by third parties
|
||
# remain the property of their copyright owners, unless otherwise agreed
|
||
# upon. The license for this file, and modifications and additions to the
|
||
# file, is the same license as for the pristine package itself (unless the
|
||
# license for the pristine package is not an Open Source License, in which
|
||
# case the license is the MIT License). An "Open Source License" is a
|
||
# license that conforms to the Open Source Definition (Version 1.9)
|
||
# published by the Open Source Initiative.
|
||
|
||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||
#
|
||
|
||
# norootforbuild
|
||
|
||
%define build_kmp 1
|
||
|
||
%bcond_with pyside
|
||
|
||
Name: openvswitch
|
||
Version: 1.2.0
|
||
Release: 1
|
||
License: Apache
|
||
Summary: An open source, production quality, multilayer virtual switch
|
||
Url: http://openswitch.org
|
||
Group: Productivity/Networking/System
|
||
Source0: %name-%version.tar.bz2
|
||
Patch0: %name-1.2.0-suse.patch
|
||
Patch1: %name-1.1.0-stp-fwd-delay.patch
|
||
BuildRequires: gcc
|
||
BuildRequires: make
|
||
BuildRequires: pkg-config
|
||
BuildRequires: perl
|
||
BuildRequires: glibc-devel
|
||
BuildRequires: openssl libopenssl-devel
|
||
BuildRequires: valgrind-devel
|
||
BuildRequires: graphviz
|
||
BuildRequires: python-devel
|
||
BuildRequires: python-qt4-devel
|
||
BuildRequires: python-twisted
|
||
BuildRequires: python-simplejson
|
||
BuildRequires: python-zopeinterface
|
||
%if %{with pyside}
|
||
BuildRequires: python-pyside
|
||
Requires: python-pyside
|
||
%endif
|
||
Requires: python-qt4
|
||
Requires: python-twisted
|
||
Requires: python-simplejson
|
||
Requires: python-zopeinterface
|
||
Requires: openssl
|
||
Requires: graphviz
|
||
Requires: logrotate
|
||
%py_requires
|
||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
||
%description
|
||
Open vSwitch is a production quality, multilayer virtual switch licensed under
|
||
the open source Apache 2.0 license. It is designed to enable massive network automation
|
||
through programmatic extension, while still supporting standard management interfaces
|
||
and protocols (e.g. NetFlow, sFlow, RSPAN, ERSPAN, CLI, LACP, 802.1ag). In addition,
|
||
it is designed to support distribution across multiple physical servers similar to
|
||
VMware’s vNetwork distributed vswitch or Cisco’s Nexus 1000V.
|
||
|
||
%if 0%{?build_kmp}
|
||
%package -n %{name}-KMP
|
||
Group: Productivity/Networking/System
|
||
License: GPL v2 or later
|
||
Summary: Kernel module
|
||
Requires: kernel-default kernel-desktop
|
||
BuildRequires: perl-base autoconf automake libtool kernel-source kernel-syms module-init-tools
|
||
%suse_kernel_module_package ec2 xen xenpae vmi um
|
||
|
||
%description -n %{name}-KMP
|
||
Kernel modules supporting the openvswitch datapath
|
||
%endif
|
||
|
||
%prep
|
||
%setup -q
|
||
%patch0 -p1
|
||
%patch1 -p1
|
||
|
||
set -- *
|
||
mkdir source
|
||
mv "$@" source/
|
||
mkdir obj
|
||
|
||
%build
|
||
pushd source
|
||
bash -x boot.sh
|
||
popd
|
||
%if 0%{?build_kmp}
|
||
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
|
||
for flavor in %flavors_to_build; do
|
||
rm -rf obj/$flavor
|
||
cp -r source obj/$flavor
|
||
pushd obj/$flavor
|
||
%configure \
|
||
--with-logdir=/var/log \
|
||
--with-linux=/usr/src/linux-obj/%_target_cpu/$flavor \
|
||
--with-linux-source=/usr/src/linux
|
||
cd datapath/linux
|
||
make
|
||
popd
|
||
done
|
||
%endif
|
||
ls source
|
||
pushd source
|
||
%configure \
|
||
--with-logdir=/var/log
|
||
make %{?_smp_mflags}
|
||
popd
|
||
|
||
%install
|
||
%if 0%{?build_kmp}
|
||
export INSTALL_MOD_PATH=%{buildroot}
|
||
export INSTALL_MOD_DIR=updates
|
||
for flavor in %flavors_to_build; do
|
||
pushd obj/$flavor/datapath/linux
|
||
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD
|
||
popd
|
||
done
|
||
%endif
|
||
pushd source
|
||
|
||
%makeinstall
|
||
install -d -m 755 %{buildroot}/%_sysconfdir/init.d
|
||
install -d -m 755 %{buildroot}/var/adm/fillup-templates
|
||
install -m 644 xenserver/etc_sysconfig_%{name} \
|
||
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
|
||
install -m 755 xenserver/etc_init.d_%{name} \
|
||
%{buildroot}/%_sysconfdir/init.d/%{name}
|
||
install -m 755 xenserver/etc_init.d_%{name}-xapi-update \
|
||
%{buildroot}/%_sysconfdir/init.d/%{name}-xapi-update
|
||
install -d -m 755 %{buildroot}/%_sysconfdir/sysconfig
|
||
install -d -m 755 %{buildroot}/%_sysconfdir/logrotate.d
|
||
install -m 644 xenserver/etc_logrotate.d_%{name} \
|
||
%{buildroot}/%_sysconfdir/logrotate.d/%{name}
|
||
install -d -m 755 %{buildroot}/%_sysconfdir/profile.d
|
||
install -m 644 xenserver/etc_profile.d_%{name}.sh \
|
||
%{buildroot}/%_sysconfdir/profile.d/%{name}.sh
|
||
install -d -m 755 %{buildroot}/%_sysconfdir/xapi.d/plugins
|
||
install -m 755 xenserver/etc_xapi.d_plugins_%{name}-cfg-update \
|
||
%{buildroot}/%_sysconfdir/xapi.d/plugins/%{name}-cfg-update
|
||
install -d -m 755 %{buildroot}/%{_datadir}/%{name}/scripts
|
||
install -m 644 vswitchd/vswitch.ovsschema \
|
||
%{buildroot}/%{_datadir}/%{name}/vswitch.ovsschema
|
||
install -m 755 xenserver/opt_xensource_libexec_interface-reconfigure \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/interface-reconfigure
|
||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigure.py \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigure.py
|
||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureBridge.py
|
||
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureVswitch.py
|
||
install -m 755 xenserver/etc_xensource_scripts_vif \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/vif
|
||
install -m 644 xenserver/usr_share_%{name}_scripts_sysconfig.template \
|
||
%{buildroot}/%{_datadir}/%{name}/scripts/sysconfig.template
|
||
install -d -m 755 %{buildroot}/%{_libdir}/xsconsole/plugins-base
|
||
install -m 644 \
|
||
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
|
||
%{buildroot}/%{_libdir}/xsconsole/plugins-base/XSFeatureVSwitch.py
|
||
install -m 644 xenserver/uuid.py %{buildroot}/%{_datadir}/%{name}/python
|
||
popd
|
||
|
||
%clean
|
||
%{?buildroot:%__rm -rf "%{buildroot}"}
|
||
|
||
%post
|
||
%{fillup_and_insserv openvswitch}
|
||
|
||
%preun
|
||
%stop_on_removal openvswitch
|
||
|
||
%files
|
||
%defattr(-,root,root)
|
||
%doc source/AUTHORS source/DESIGN source/INSTALL.* source/NOTICE
|
||
%doc source/REPORTING-BUGS source/ChangeLog source/PORTING
|
||
%doc source/SubmittingPatches source/CodingStyle source/README
|
||
%doc source/WHY-OVS source/COPYING source/README-gcov
|
||
%_bindir/ovs*
|
||
%_sbindir/ovs-brcompatd
|
||
%_sbindir/ovsdb-server
|
||
%_sbindir/ovs-vlan-bug-workaround
|
||
%_sbindir/ovs-vswitchd
|
||
%_sbindir/ovs-bugtool
|
||
%_datadir/%name
|
||
%_mandir/man1/*
|
||
%_mandir/man5/*
|
||
%_mandir/man8/*
|
||
%_sysconfdir/init.d/openvswitch
|
||
%_sysconfdir/init.d/openvswitch-xapi-update
|
||
%config %_sysconfdir/logrotate.d/openvswitch
|
||
%_sysconfdir/profile.d/openvswitch.sh
|
||
%dir %_sysconfdir/xapi.d
|
||
%dir %dir %_sysconfdir/xapi.d/plugins
|
||
%dir %_libdir/xsconsole/
|
||
%dir %_libdir/xsconsole/plugins-base/
|
||
%_sysconfdir/xapi.d/plugins/openvswitch-cfg-update
|
||
%_sysconfdir/openvswitch
|
||
%_libdir/xsconsole/plugins-base/XSFeatureVSwitch.py
|
||
/var/adm/fillup-templates/sysconfig.openvswitch
|
||
|
||
|
||
%changelog
|