File ocaml-curses.spec of Package ocaml-curses

#
# spec file for package ocaml-curses
#
# 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-curses
Version:        1.0.3
Release:        0
%{ocaml_preserve_bytecode}
Summary:        OCaml bindings for ncurses
License:        LGPL-2.0+
Group:          Development/Libraries/Other
Url:            http://savannah.nongnu.org/projects/ocaml-tmk/
Source0:        http://download.savannah.gnu.org/releases/ocaml-tmk/%{name}-%{version}.tar.gz
# Doesn't include a configure script, so we have to make one.
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gawk
BuildRequires:  libtool
BuildRequires:  ncurses-devel
BuildRequires:  ocaml >= 4.00.1
BuildRequires:  ocaml-rpm-macros >= 4.02.1
BuildRequires:  ocaml-findlib-devel >= 1.3.3-3
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# ocaml autodep start for pkg: ocaml-curses
# 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-curses

%description
OCaml bindings for ncurses.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%prep
%setup -q


%build
autoreconf
# Parallel builds don't work (with bytecode)
%configure --enable-widec
make all
%if %{ocaml_native_compiler}
make opt
%endif


%install

export DESTDIR=%{buildroot}
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
export OCAMLFILES="curses META *.cmi *.cma *.so *.mli"
%if %{ocaml_native_compiler}
export OCAMLFILES="$OCAMLFILES *.cmx *.cmxa *.a"
%endif
ocamlfind install $OCAMLFILES
#
mkdir -vp %{buildroot}/etc/ld.so.conf.d/
tee %{buildroot}/etc/ld.so.conf.d/%{name}-stub.conf <<_EOF_
%{_libdir}/ocaml/stublibs
_EOF_
#

%post   -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc COPYING
/etc/ld.so.conf.d/*.conf
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%{_libdir}/ocaml/*/*.so
%{_libdir}/ocaml/*/*.so.owner

%files devel
%defattr(-,root,root,-)
%doc COPYING
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/*
%if %{ocaml_native_compiler}
%{_libdir}/ocaml/*/*.a
%{_libdir}/ocaml/*/*.cmx
%{_libdir}/ocaml/*/*.cmxa
%endif
%{_libdir}/ocaml/*/*.cma
%{_libdir}/ocaml/*/*.cmi
%{_libdir}/ocaml/*/*.mli
%{_libdir}/ocaml/*/META

%changelog
openSUSE Build Service is sponsored by