This provides static library, libopenswitch.a and the openvswitch
header files needed to build an external application in a separate
RPM package.

Signed-off-by: Flavio Leitner <f...@redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 5fd2d55..9dc607c 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -68,6 +68,16 @@ Requires: python python-twisted-core python-twisted-web
 Utilities that are useful to diagnose performance and connectivity
 issues in Open vSwitch setup.
 
+%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 openvswitch header
+files needed to build an external application.
+
+
 %prep
 %setup -q -n openvswitch-%{version}
 
@@ -109,8 +119,18 @@ rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
 
 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
 
-# Get rid of stuff we don't want to make RPM happy.
-(cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*)
+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
 
 %check
 %if %{with check}
@@ -162,6 +182,12 @@ systemctl start openvswitch.service
 %{_mandir}/man8/ovs-l3ping.8*
 %{python_sitelib}/ovstest
 
+%files devel
+%{_libdir}/*.a
+%{_libdir}/*.la
+%{_includedir}/openvswitch/*
+%{_includedir}/openflow/*
+
 %files
 %defattr(-,root,root)
 %config /etc/sysconfig/openvswitch
-- 
1.9.3

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to