Skip to content

Commit

Permalink
rhel: Stop installing internal headers.
Browse files Browse the repository at this point in the history
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: 4886d4d ("debian, rhel: Ship ovs shared libraries and header files")
Reviewed-by: David Marchand <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Jul 29, 2022
1 parent 099d1c7 commit a68002c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lib/libopenvswitch.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Description: Open vSwitch library
Version: @VERSION@
Libs: -L${libdir} -lopenvswitch
Libs.private: @LIBS@
Cflags: -I${includedir}/openvswitch
Cflags: -I${includedir}
2 changes: 1 addition & 1 deletion lib/libsflow.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion ofproto/libofproto.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion ovsdb/libovsdb.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
14 changes: 0 additions & 14 deletions rhel/openvswitch-fedora.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
18 changes: 0 additions & 18 deletions rhel/openvswitch.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 :;
Expand Down

0 comments on commit a68002c

Please sign in to comment.