[PATCH] openvswitch -devel package


Chris Wright <chrisw@...>
 

(resend w/ proper list addr)

Andy, I just hacked this together in case you find it helpful.
As I mentioned on IRC, the right longer term solution is probably not
this one. The result of this is (on 64bit build as example):

src/lib/libopenvswitch.a -> /usr/lib64/libopenvswitch.a
src/lib/*.h -> /usr/include/openvswitch/lib/*.h
src/config.h -> /usr/include/openvswitch/config.h
src/include/openvswitch/*.h -> /usr/include/openvswitch/*.h (dove doesn't seem to use this)
src/include/openflow/*.h -> /usr/include/openflow/*.h

Which means that the opendove Makefile would need to update OVS_INCLUDE
to have something like looks like -I/usr/include/openvswitch/lib
-I/usr/include/openvswitch/ -I/usr/include/openflow

Flavio, I've Cc'd you just so you're aware, and in the off chance you
think it's something you'd be interested in carrying in Fedora and RHEL.

Cc: Andy Grimberg <agrimberg@...>
Cc: Flavio Leitner <fbl@...>
Cc: Ryan Moats <rmoats@...>
Cc: Anees A Shaikh <aashaikh@...>
Signed-off-by: Chris Wright <chrisw@...>
---
openvswitch.spec | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/openvswitch.spec b/openvswitch.spec
index 350a609..39b00f8 100644
--- a/openvswitch.spec
+++ b/openvswitch.spec
@@ -15,7 +15,7 @@

Name: openvswitch
Version: 2.0.0
-Release: 4%{?dist}
+Release: 5.odl%{?dist}
Summary: Open vSwitch daemon/database/utilities

# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
@@ -98,6 +98,15 @@ Simple reference implementation of an OpenFlow controller for Open
vSwitch. Manages any number of remote switches over OpenFlow protocol,
causing them to function as L2 MAC-learning switches or hub.

+%package devel
+Summary: Open vSwitch OpenFlow development package (library, headers)
+License: ASL 2.0
+Provides: openvswitch-static = %{version}-%{release}
+
+%description devel
+This provides static library, libopenswitch.a and the openvswtich header
+files needed to build an external application.
+
%prep
%setup -q
%patch1 -p1
@@ -162,6 +171,22 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/applications/ovsdbmonitor.desktop
rm -rf $RPM_BUILD_ROOT%{_docdir}/ovsdbmonitor
%endif

+# devel files
+install -p -D -m 0644 lib/libopenvswitch.a \
+ $RPM_BUILD_ROOT%{_libdir}/openvswitch/libopenvswitch.a
+
+install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch
+install -p -D -m 0644 include/openvswitch/*.h \
+ -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
+install -p -D -m 0644 config.h -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
+
+install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
+install -p -D -m 0644 lib/*.h \
+ -t $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
+
+install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openflow
+install -p -D -m 0644 include/openflow/*.h \
+ -t $RPM_BUILD_ROOT%{_includedir}/openflow

%post
%if 0%{?systemd_post:1}
@@ -281,8 +306,15 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ovsdbmonitor
%{_bindir}/ovs-controller
%{_mandir}/man8/ovs-controller.8*

+%files devel
+%{_libdir}/openvswitch/libopenvswitch.a
+%{_includedir}/openvswitch/*
+%{_includedir}/openflow/*

%changelog
+* Fri Jan 24 2014 Chris Wright <chrisw@...> - 2.0.0-5.odl
+- create a -devel package
+
* Wed Jan 15 2014 Flavio Leitner <fbl@...> - 2.0.0-5
- Enable DHCP support for internal ports
(upstream commit 490db96efaf89c63656b192d5ca287b0908a6c77)


Flavio Leitner <fbl@...>
 

On Fri, Jan 24, 2014 at 03:41:35PM -0800, Chris Wright wrote:
(resend w/ proper list addr)

Andy, I just hacked this together in case you find it helpful.
As I mentioned on IRC, the right longer term solution is probably not
this one. The result of this is (on 64bit build as example):

src/lib/libopenvswitch.a -> /usr/lib64/libopenvswitch.a
src/lib/*.h -> /usr/include/openvswitch/lib/*.h
src/config.h -> /usr/include/openvswitch/config.h
src/include/openvswitch/*.h -> /usr/include/openvswitch/*.h (dove doesn't seem to use this)
src/include/openflow/*.h -> /usr/include/openflow/*.h

Which means that the opendove Makefile would need to update OVS_INCLUDE
to have something like looks like -I/usr/include/openvswitch/lib
-I/usr/include/openvswitch/ -I/usr/include/openflow

Flavio, I've Cc'd you just so you're aware, and in the off chance you
think it's something you'd be interested in carrying in Fedora and RHEL.
Yeah, makes sense. I've applied on Rawhide for now. I will push
to f20 and f19 later on.

Thanks,
fbl


Chris Wright <chrisw@...>
 

* Flavio Leitner (fbl@...) wrote:
On Fri, Jan 24, 2014 at 03:41:35PM -0800, Chris Wright wrote:
Flavio, I've Cc'd you just so you're aware, and in the off chance you
think it's something you'd be interested in carrying in Fedora and RHEL.
Yeah, makes sense. I've applied on Rawhide for now. I will push
to f20 and f19 later on.
Cool, thank you