ocaml-libvirt/ocaml-libvirt.spec

110 lines
3.2 KiB
RPMSpec

#
# spec file for package ocaml-libvirt
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ocaml-libvirt
Version: 0.6.1.4
%{ocaml_preserve_bytecode}
Release: 0
Summary: OCaml binding for libvirt
License: LGPL-2.0+
Group: Development/Libraries/Other
Url: http://libvirt.org/ocaml/
Source0: http://libvirt.org/sources/ocaml/%{name}-%{version}.tar.gz
# Upstream patch to fix int types.
Patch1: 0001-Use-C99-standard-int64_t-instead-of-OCaml-defined-an.patch
BuildRequires: gawk
# 0.9.10-3 contains virDomainGetCPUStats API, but not the qemu driver.
BuildRequires: libvirt-devel >= 0.9.10-3
BuildRequires: ocaml >= 3.10.0
BuildRequires: ocaml-rpm-macros >= 4.02.1
BuildRequires: ocaml-findlib-devel
BuildRequires: ocaml-ocamldoc
BuildRequires: perl
Requires: libvirt-client >= 0.9.10-3
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# ocaml autodep start for pkg: ocaml-libvirt
# hardcoded rpm dependency for pre 12.1 to compensate for lack of ocaml() provides/requires
%if 0%{?suse_version} < 1210
Requires: ocaml-runtime
%endif
# ocaml autodep end for pkg: ocaml-libvirt
%description
OCaml binding for libvirt.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
%setup -q
%patch1 -p1
%build
%configure
make %{?_smp_mflags} all doc
%if %{ocaml_native_compiler}
make %{?_smp_mflags} opt
%endif
%install
# These rules work if the library uses 'ocamlfind install' to install itself.
export DESTDIR=%{buildroot}
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
mkdir -p %{buildroot}%{_bindir}
%if %{ocaml_native_compiler}
make install-opt
%else
make install-byte
%endif
%files
%defattr(-,root,root,-)
%doc COPYING.LIB README ChangeLog
%{_libdir}/ocaml/libvirt
%if %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/libvirt/*.a
%exclude %{_libdir}/ocaml/libvirt/*.cmxa
%exclude %{_libdir}/ocaml/libvirt/*.cmx
%endif
%exclude %{_libdir}/ocaml/libvirt/*.mli
%{_libdir}/ocaml/stublibs/*.so
%{_libdir}/ocaml/stublibs/*.so.owner
%files devel
%defattr(-,root,root,-)
%doc COPYING.LIB README TODO.libvirt ChangeLog html/*
%if %{ocaml_native_compiler}
%{_libdir}/ocaml/libvirt/*.a
%{_libdir}/ocaml/libvirt/*.cmxa
%{_libdir}/ocaml/libvirt/*.cmx
%endif
%{_libdir}/ocaml/libvirt/*.mli
%changelog