From a68002cd9a93907c831667fcdb1fe2cae6b8c41f Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Mon, 25 Jul 2022 14:19:36 +0200 Subject: [PATCH] rhel: Stop installing internal headers. Currently, openvswitch-devel installs following header tree: /usr/include /openflow/*.h /openvswitch /*.h /openflow/*.h /openvswitch/*.h /sparse/*.h /lib/*.h Few issues with that: 1. openflow and openvswitch headers are installed twice. Once in the main /usr/include and second time in the /usr/include/openvswitch/. 2. For some reason internal headers such as lib/*.h and fairly useless headers such as sparse/*.h are installed as well. One more issue is that current pkg-config files doesn't work with builds installed with 'make install', because 'make install' doesn't create this weird header tree. While double install of same headers is not a huge problem, it doesn't seem right. Installation of the internal headers is a bigger issue. They are not part of API/ABI and we do not provide any stability guarantees for them. We are making incompatible changes constantly in minor updates, so users should not rely on these headers. If it's necessary for some external application to use them, this external application should not link with libopenvswitch dynamically and also it can't expect the static library to not break these API/ABI, hence there is no real point installing them. Application should use OVS as a submodule like OVN does or compile itself by obtaining required version of OVS sources otherwise. Another option is to properly export and install required headers. pkg-config configuration files updated as necessary. Fixes: 4886d4d2495b ("debian, rhel: Ship ovs shared libraries and header files") Reviewed-by: David Marchand Signed-off-by: Ilya Maximets --- lib/libopenvswitch.pc.in | 2 +- lib/libsflow.pc.in | 2 +- ofproto/libofproto.pc.in | 2 +- ovsdb/libovsdb.pc.in | 2 +- rhel/openvswitch-fedora.spec.in | 14 -------------- rhel/openvswitch.spec.in | 18 ------------------ 6 files changed, 4 insertions(+), 36 deletions(-) diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in index 2a3f2ca7b..4c40a4caf 100644 --- a/lib/libopenvswitch.pc.in +++ b/lib/libopenvswitch.pc.in @@ -8,4 +8,4 @@ Description: Open vSwitch library Version: @VERSION@ Libs: -L${libdir} -lopenvswitch Libs.private: @LIBS@ -Cflags: -I${includedir}/openvswitch +Cflags: -I${includedir} diff --git a/lib/libsflow.pc.in b/lib/libsflow.pc.in index e70a2b704..34bb7e3d6 100644 --- a/lib/libsflow.pc.in +++ b/lib/libsflow.pc.in @@ -8,4 +8,4 @@ Description: sFlow library of Open vSwitch Version: @VERSION@ Libs: -L${libdir} -lsflow Libs.private: @LIBS@ -Cflags: -I${includedir}/openvswitch +Cflags: -I${includedir} diff --git a/ofproto/libofproto.pc.in b/ofproto/libofproto.pc.in index 274071250..49894fb69 100644 --- a/ofproto/libofproto.pc.in +++ b/ofproto/libofproto.pc.in @@ -8,4 +8,4 @@ Description: OpenFlow library of Open vSwitch Version: @VERSION@ Libs: -L${libdir} -lofproto Libs.private: @LIBS@ -Cflags: -I${includedir}/openvswitch +Cflags: -I${includedir} diff --git a/ovsdb/libovsdb.pc.in b/ovsdb/libovsdb.pc.in index fe367ea7b..54c9039cf 100644 --- a/ovsdb/libovsdb.pc.in +++ b/ovsdb/libovsdb.pc.in @@ -8,4 +8,4 @@ Description: OVSDB library of Open vSwitch Version: @VERSION@ Libs: -L${libdir} -lovsdb Libs.private: @LIBS@ -Cflags: -I${includedir}/openvswitch +Cflags: -I${includedir} diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index 113b53813..67268cb78 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -197,20 +197,6 @@ make install DESTDIR=$RPM_BUILD_ROOT install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch -copy_headers() { - src=$1 - dst=$RPM_BUILD_ROOT/$2 - install -d -m 0755 $dst - install -m 0644 $src/*.h $dst -} -copy_headers include %{_includedir}/openvswitch -copy_headers include/openflow %{_includedir}/openvswitch/openflow -copy_headers include/openvswitch %{_includedir}/openvswitch/openvswitch -copy_headers include/sparse %{_includedir}/openvswitch/sparse -copy_headers include/sparse/arpa %{_includedir}/openvswitch/sparse/arpa -copy_headers include/sparse/netinet %{_includedir}/openvswitch/sparse/netinet -copy_headers include/sparse/sys %{_includedir}/openvswitch/sparse/sys -copy_headers lib %{_includedir}/openvswitch/lib %if %{with dpdk} install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in index dbfff333c..9903dd10a 100644 --- a/rhel/openvswitch.spec.in +++ b/rhel/openvswitch.spec.in @@ -108,24 +108,6 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch install -d -m 0755 $RPM_BUILD_ROOT/var/lib/openvswitch -copy_headers() { - src=$1 - dst=$RPM_BUILD_ROOT/$2 - install -d -m 0755 $dst - install -m 0644 $src/*.h $dst -} -copy_headers include %{_includedir}/openvswitch -copy_headers include/openflow %{_includedir}/openvswitch/openflow -copy_headers include/openvswitch %{_includedir}/openvswitch/openvswitch -copy_headers include/sparse %{_includedir}/openvswitch/sparse -copy_headers include/sparse/arpa %{_includedir}/openvswitch/sparse/arpa -copy_headers include/sparse/netinet %{_includedir}/openvswitch/sparse/netinet -copy_headers include/sparse/sys %{_includedir}/openvswitch/sparse/sys -copy_headers lib %{_includedir}/openvswitch/lib - -install -D -m 0644 lib/.libs/libopenvswitch.a \ - $RPM_BUILD_ROOT/%{_libdir}/libopenvswitch.a - %check %if %{with check} if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;