Build OVS as shared library

Build the C json native extension for Python (60x faster)
Fix TPS VerifyTest (rpm -V) by do not verify md5, size and mtime of
  /etc/sysconfig/openvswitch
Backport spec file modfications from "rhel: Use openvswitch user/group for
  the log directory"
f38
Timothy Redaelli 7 years ago
parent 940804d189
commit 936ab4a8ef

@ -40,7 +40,7 @@ Name: openvswitch
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
URL: http://www.openvswitch.org/ URL: http://www.openvswitch.org/
Version: 2.9.2 Version: 2.9.2
Release: 2%{?commit0:.%{date}git%{shortcommit0}}%{?dist} Release: 3%{?commit0:.%{date}git%{shortcommit0}}%{?dist}
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
# lib/sflow*.[ch] files are SISSL # lib/sflow*.[ch] files are SISSL
@ -72,7 +72,7 @@ Patch42: 0001-lib-netdev-tc-offloads-Fix-frag-first-later-translat.patch
Patch43: 0002-lib-tc-Fix-sparse-warnings.patch Patch43: 0002-lib-tc-Fix-sparse-warnings.patch
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gcc BuildRequires: gcc
BuildRequires: python2-sphinx BuildRequires: python2-sphinx
BuildRequires: autoconf automake libtool BuildRequires: autoconf automake libtool
@ -119,7 +119,6 @@ traffic.
%package -n python2-openvswitch %package -n python2-openvswitch
Summary: Open vSwitch python2 bindings Summary: Open vSwitch python2 bindings
License: ASL 2.0 License: ASL 2.0
BuildArch: noarch
Requires: python2 python2-six Requires: python2 python2-six
Obsoletes: python-openvswitch < 2.6.1-2 Obsoletes: python-openvswitch < 2.6.1-2
Provides: python-openvswitch = %{version}-%{release} Provides: python-openvswitch = %{version}-%{release}
@ -130,7 +129,6 @@ Python bindings for the Open vSwitch database
%package -n python3-openvswitch %package -n python3-openvswitch
Summary: Open vSwitch python3 bindings Summary: Open vSwitch python3 bindings
License: ASL 2.0 License: ASL 2.0
BuildArch: noarch
Requires: python3 python3-six Requires: python3 python3-six
%description -n python3-openvswitch %description -n python3-openvswitch
@ -150,10 +148,9 @@ issues in Open vSwitch setup.
%package devel %package devel
Summary: Open vSwitch OpenFlow development package (library, headers) Summary: Open vSwitch OpenFlow development package (library, headers)
License: ASL 2.0 License: ASL 2.0
Provides: openvswitch-static = %{version}-%{release}
%description devel %description devel
This provides static library, libopenswitch.a and the openvswitch header This provides shared library, libopenswitch.so and the openvswitch header
files needed to build an external application. files needed to build an external application.
%package ovn-central %package ovn-central
@ -227,7 +224,9 @@ sed -i.old -e "s/^AC_INIT(openvswitch,.*,/AC_INIT(openvswitch, %{version},/" con
%else %else
--disable-libcapng \ --disable-libcapng \
%endif %endif
--enable-ssl \ --disable-static \
--enable-shared \
--enable-ssl \
%if %{with dpdk} %if %{with dpdk}
%ifarch %{dpdkarches} %ifarch %{dpdkarches}
--with-dpdk \ --with-dpdk \
@ -281,12 +280,22 @@ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
install -d -m 0755 $RPM_BUILD_ROOT%{python2_sitelib} install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib} cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovstest \
cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ $RPM_BUILD_ROOT%{python_sitelib}
$RPM_BUILD_ROOT%{python2_sitelib}
cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovs \ # Build the JSON C extension for the Python lib (#1417738)
$RPM_BUILD_ROOT%{python3_sitelib} pushd python
CPPFLAGS="-I ../include" \
LDFLAGS="${RPM_LD_FLAGS} -L $RPM_BUILD_ROOT%{_libdir}" \
%py2_build
%py2_install
CPPFLAGS="-I ../include" \
LDFLAGS="${RPM_LD_FLAGS} -L $RPM_BUILD_ROOT%{_libdir}" \
%py3_build
%py3_install
popd
rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
@ -485,11 +494,13 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%files -n python2-openvswitch %files -n python2-openvswitch
%{python2_sitelib}/ovs %{python2_sitearch}/ovs
%{python2_sitearch}/ovs-*.egg-info
%doc COPYING %doc COPYING
%files -n python3-openvswitch %files -n python3-openvswitch
%{python3_sitelib}/ovs %{python3_sitearch}/ovs
%{python3_sitearch}/ovs-*.egg-info
%doc COPYING %doc COPYING
%files test %files test
@ -508,12 +519,12 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%{python2_sitelib}/ovstest %{python2_sitelib}/ovstest
%files devel %files devel
%{_libdir}/*.a %{_libdir}/*.so
%{_libdir}/*.la
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%{_includedir}/openvswitch/* %{_includedir}/openvswitch/*
%{_includedir}/openflow/* %{_includedir}/openflow/*
%{_includedir}/ovn/* %{_includedir}/ovn/*
%exclude %{_libdir}/*.la
%files %files
%defattr(-,openvswitch,openvswitch) %defattr(-,openvswitch,openvswitch)
@ -523,7 +534,7 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%ghost %attr(0600,-,-) %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/.conf.db.~lock~ %ghost %attr(0600,-,-) %verify(not owner group md5 size mtime) %{_sysconfdir}/openvswitch/.conf.db.~lock~
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
%defattr(-,root,root) %defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/openvswitch
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
@ -553,6 +564,7 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%{_bindir}/ovsdb-tool %{_bindir}/ovsdb-tool
%{_bindir}/ovs-pki %{_bindir}/ovs-pki
%{_bindir}/vtep-ctl %{_bindir}/vtep-ctl
%{_libdir}/*.so.*
%{_sbindir}/ovs-bugtool %{_sbindir}/ovs-bugtool
%{_sbindir}/ovs-vswitchd %{_sbindir}/ovs-vswitchd
%{_sbindir}/ovsdb-server %{_sbindir}/ovsdb-server
@ -580,7 +592,7 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%{_udevrulesdir}/91-vfio.rules %{_udevrulesdir}/91-vfio.rules
%doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst %doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst
/var/lib/openvswitch /var/lib/openvswitch
%attr(755,-,-) /var/log/openvswitch %attr(750,openvswitch,openvswitch) /var/log/openvswitch
%ghost %attr(755,root,root) %verify(not owner group) %{_rundir}/openvswitch %ghost %attr(755,root,root) %verify(not owner group) %{_rundir}/openvswitch
%if %{with ovn_docker} %if %{with ovn_docker}
@ -629,6 +641,14 @@ chown -R openvswitch:openvswitch /etc/openvswitch
%{_unitdir}/ovn-controller-vtep.service %{_unitdir}/ovn-controller-vtep.service
%changelog %changelog
* Wed Aug 01 2018 Timothy Redaelli <tredaelli@redhat.com> - 2.9.2-3
- Build OVS as shared library
- Build the C json native extension for Python (60x faster)
- Fix TPS VerifyTest (rpm -V) by do not verify md5, size and mtime of
/etc/sysconfig/openvswitch
- Backport spec file modfications from "rhel: Use openvswitch user/group for
the log directory"
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.2-2 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

Loading…
Cancel
Save