2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

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 <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets 2022-07-25 14:19:36 +02:00
parent 099d1c7454
commit a68002cd9a
6 changed files with 4 additions and 36 deletions

View File

@ -8,4 +8,4 @@ Description: Open vSwitch library
Version: @VERSION@
Libs: -L${libdir} -lopenvswitch
Libs.private: @LIBS@
Cflags: -I${includedir}/openvswitch
Cflags: -I${includedir}

View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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 \

View File

@ -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 :;