Skip to content

Commit

Permalink
debian, rhel: Ship ovs shared libraries and header files
Browse files Browse the repository at this point in the history
Compile and package ovs shared libraries and create new header
package for debian (openvswitch-dev) and rhel (openvswitch-devel).

VMware-BZ: #1556299
Signed-off-by: Edwin Chiu <[email protected]>
Co-authored-by: Harold Lim <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
2 people authored and blp committed Jun 7, 2016
1 parent cd8747c commit 4886d4d
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 7 deletions.
1 change: 1 addition & 0 deletions debian/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EXTRA_DIST += \
debian/openvswitch-datapath-source.copyright \
debian/openvswitch-datapath-source.dirs \
debian/openvswitch-datapath-source.install \
debian/openvswitch-dev.install \
debian/openvswitch-ipsec.dirs \
debian/openvswitch-ipsec.init \
debian/openvswitch-ipsec.install \
Expand Down
16 changes: 16 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,19 @@ Description: Open vSwitch VTEP utilities
.
This package provides utilities that are useful to interact with a
VTEP-configured database and a VTEP emulator.

Package: openvswitch-dev
Architecture: linux-any
Depends:
openvswitch-common (>= ${binary:Version}),
${misc:Depends}
Description: Open vSwitch development package
Open vSwitch is a production quality, multilayer, software-based, Ethernet
virtual switch. It is designed to enable massive network automation through
programmatic extension, while still supporting standard management interfaces
and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, 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.
.
This package provides openvswitch headers and libopenvswitch for developers.
1 change: 1 addition & 0 deletions debian/openvswitch-common.install
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ usr/sbin/ovs-bugtool
usr/share/openvswitch/bugtool-plugins
usr/share/openvswitch/scripts/ovs-bugtool-*
usr/share/openvswitch/scripts/ovs-lib
usr/lib/lib*.so.*
11 changes: 11 additions & 0 deletions debian/openvswitch-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
usr/lib/lib*.so
usr/lib/lib*.a
usr/lib/pkgconfig
include/*.h usr/include/openvswitch
include/openflow/*.h usr/include/openvswitch/openflow
include/openvswitch/*.h usr/include/openvswitch/openvswitch
include/sparse/*.h usr/include/openvswitch/sparse
include/sparse/arpa/*.h usr/include/openvswitch/sparse/arpa
include/sparse/netinet/*.h usr/include/openvswitch/sparse/netinet
include/sparse/sys/*.h usr/include/openvswitch/sparse/sys
lib/*.h usr/include/openvswitch/lib
4 changes: 3 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ override_dh_autoreconf:
dh_autoreconf $(DH_AS_NEEDED)

override_dh_auto_configure:
dh_auto_configure -- --enable-ssl $(DATAPATH_CONFIGURE_OPTS)
dh_auto_configure -- --enable-ssl --enable-shared $(DATAPATH_CONFIGURE_OPTS)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
Expand Down Expand Up @@ -91,3 +91,5 @@ override_dh_installinit:

override_dh_strip:
dh_strip --dbg-package=openvswitch-dbg

override_dh_usrlocal:
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}
Cflags: -I${includedir}/openvswitch
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}
Cflags: -I${includedir}/openvswitch
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}
Cflags: -I${includedir}/openvswitch
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}
Cflags: -I${includedir}/openvswitch
37 changes: 35 additions & 2 deletions rhel/openvswitch.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ Open vSwitch provides standard network bridging functions and
support for the OpenFlow protocol for remote per-flow control of
traffic.

%package devel
Summary: Open vSwitch development package
Group: Development/Libraries

%description devel
This package provides openvswitch headers and libopenvswitch for developers.

%prep
%setup -q

%build
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} \
--libdir=%{_libdir} --enable-ssl --enable-shared
make %{_smp_mflags}

%install
Expand Down Expand Up @@ -69,11 +77,29 @@ rm \
$RPM_BUILD_ROOT/usr/share/man/man?/ovn-* \
$RPM_BUILD_ROOT/usr/share/openvswitch/ovn-* \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovn-*
(cd "$RPM_BUILD_ROOT" && rm -rf usr/lib)
(cd "$RPM_BUILD_ROOT" && rm -rf usr/%{_lib}/*.la)
(cd "$RPM_BUILD_ROOT" && rm -rf usr/include)

install -d -m 755 $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 Expand Up @@ -144,6 +170,7 @@ exit 0
/usr/bin/ovsdb-client
/usr/bin/ovsdb-tool
/usr/bin/vtep-ctl
%{_libdir}/lib*.so.*
/usr/sbin/ovs-bugtool
/usr/sbin/ovs-vswitchd
/usr/sbin/ovsdb-server
Expand Down Expand Up @@ -181,3 +208,9 @@ exit 0
%doc INSTALL.DPDK.md rhel/README.RHEL README-native-tunneling.md
/var/lib/openvswitch
/var/log/openvswitch

%files devel
%{_libdir}/lib*.so
%{_libdir}/lib*.a
%{_libdir}/pkgconfig
%{_includedir}/openvswitch/*

0 comments on commit 4886d4d

Please sign in to comment.