fedora-spec: add openvswitch-devel subpackage
authorFlavio Leitner <fbl@redhat.com>
Thu, 6 Nov 2014 18:45:30 +0000 (16:45 -0200)
committerBen Pfaff <blp@nicira.com>
Thu, 6 Nov 2014 22:09:53 +0000 (14:09 -0800)
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 <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
rhel/openvswitch-fedora.spec.in

index 5fd2d55..9dc607c 100644 (file)
@@ -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