2011-05-20 21:19:18 +02:00
|
|
|
|
#
|
|
|
|
|
# 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/
|
|
|
|
|
#
|
|
|
|
|
|
2010-12-11 17:10:38 +01:00
|
|
|
|
# norootforbuild
|
2011-01-11 16:04:59 +01:00
|
|
|
|
|
|
|
|
|
# build the kmp for opensuse 11.3 and earlier, openvswitch went upstream after
|
2011-05-20 21:19:18 +02:00
|
|
|
|
#%if 0%{?suse_version} <= 1130
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%define build_kmp 1
|
2011-05-20 21:19:18 +02:00
|
|
|
|
#%endif
|
|
|
|
|
|
|
|
|
|
%bcond_with pyside
|
|
|
|
|
|
|
|
|
|
Name: openvswitch
|
|
|
|
|
Version: 1.1.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.1.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
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%endif
|
2011-05-20 21:19:18 +02:00
|
|
|
|
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
|
2010-12-11 17:10:38 +01:00
|
|
|
|
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%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.
|
2010-12-11 17:10:38 +01:00
|
|
|
|
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%if 0%{?build_kmp}
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%package -n %{name}-KMP
|
2010-12-11 17:10:38 +01:00
|
|
|
|
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
|
|
|
|
|
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%description -n %{name}-KMP
|
2010-12-11 17:10:38 +01:00
|
|
|
|
Kernel modules supporting the openvswitch datapath
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%endif
|
2010-12-11 17:10:38 +01:00
|
|
|
|
|
|
|
|
|
%prep
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%setup -q
|
2010-12-11 17:10:38 +01:00
|
|
|
|
%patch0 -p1
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%patch1 -p1
|
2010-12-11 17:10:38 +01:00
|
|
|
|
|
2011-05-20 21:19:18 +02:00
|
|
|
|
set -- *
|
|
|
|
|
mkdir source
|
|
|
|
|
mv "$@" source/
|
2010-12-11 17:10:38 +01:00
|
|
|
|
mkdir obj
|
2011-05-20 21:19:18 +02:00
|
|
|
|
|
|
|
|
|
%build
|
2010-12-11 17:10:38 +01:00
|
|
|
|
pushd source
|
|
|
|
|
bash -x boot.sh
|
|
|
|
|
popd
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%if 0%{?build_kmp}
|
|
|
|
|
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
|
2011-05-20 21:19:18 +02:00
|
|
|
|
for flavor in %flavors_to_build; do
|
2010-12-11 17:10:38 +01:00
|
|
|
|
rm -rf obj/$flavor
|
|
|
|
|
cp -r source obj/$flavor
|
|
|
|
|
pushd obj/$flavor
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%configure \
|
|
|
|
|
--with-logdir=/var/log \
|
|
|
|
|
--with-l26=/usr/src/linux-obj/%_target_cpu/$flavor \
|
|
|
|
|
--with-l26-source=/usr/src/linux
|
2010-12-11 17:10:38 +01:00
|
|
|
|
cd datapath/linux-2.6
|
|
|
|
|
make
|
|
|
|
|
popd
|
|
|
|
|
done
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%endif
|
2010-12-11 17:10:38 +01:00
|
|
|
|
ls source
|
|
|
|
|
pushd source
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%configure \
|
|
|
|
|
--with-logdir=/var/log
|
2010-12-11 17:10:38 +01:00
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%install
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%if 0%{?build_kmp}
|
2011-05-20 21:19:18 +02:00
|
|
|
|
export INSTALL_MOD_PATH=%{buildroot}
|
2010-12-11 17:10:38 +01:00
|
|
|
|
export INSTALL_MOD_DIR=updates
|
2011-05-20 21:19:18 +02:00
|
|
|
|
for flavor in %flavors_to_build; do
|
2010-12-11 17:10:38 +01:00
|
|
|
|
pushd obj/$flavor/datapath/linux-2.6
|
|
|
|
|
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD
|
|
|
|
|
popd
|
|
|
|
|
done
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%endif
|
2010-12-11 17:10:38 +01:00
|
|
|
|
pushd source
|
2011-05-20 21:19:18 +02:00
|
|
|
|
|
|
|
|
|
%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
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 644 vswitchd/vswitch.ovsschema \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_datadir}/%{name}/vswitch.ovsschema
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 755 xenserver/opt_xensource_libexec_interface-reconfigure \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_datadir}/%{name}/scripts/interface-reconfigure
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigure.py \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigure.py
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureBridge.py
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_datadir}/%{name}/scripts/InterfaceReconfigureVswitch.py
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 755 xenserver/etc_xensource_scripts_vif \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{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
|
2010-12-11 17:10:38 +01:00
|
|
|
|
install -m 644 \
|
|
|
|
|
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%{buildroot}/%{_libdir}/xsconsole/plugins-base/XSFeatureVSwitch.py
|
|
|
|
|
install -m 644 xenserver/uuid.py %{buildroot}/%{_datadir}/%{name}/python
|
2010-12-11 17:10:38 +01:00
|
|
|
|
popd
|
|
|
|
|
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%clean
|
|
|
|
|
%{?buildroot:%__rm -rf "%{buildroot}"}
|
2010-12-11 17:10:38 +01:00
|
|
|
|
|
2011-01-11 16:04:59 +01:00
|
|
|
|
%post
|
|
|
|
|
%{fillup_and_insserv openvswitch}
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%stop_on_removal openvswitch
|
|
|
|
|
|
2011-05-20 21:19:18 +02:00
|
|
|
|
%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
|
|
|
|
|
%_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
|
|
|
|
|
%_libdir/xsconsole/plugins-base/XSFeatureVSwitch.py
|
|
|
|
|
/var/adm/fillup-templates/sysconfig.openvswitch
|
|
|
|
|
|
|
|
|
|
|
2010-12-11 17:10:38 +01:00
|
|
|
|
%changelog
|