File ocaml-labltk.spec of Package ocaml-labltk

# spec file for package ocaml-labltk
# Copyright (c) 2017 SUSE LINUX 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

Name:           ocaml-labltk
Version:        8.06.3
Release:        0
Summary:        Tcl/Tk framework for ocaml
License:        SUSE-LGPL-2.0-with-linking-exception
Group:          Development/Languages/OCaml
Source:         %{name}-%{version}.tar.xz
Patch0:         ocaml-labltk.patch
BuildRequires:  ocaml(ocaml_base_version) = 4.05
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-rpm-macros >= 20200220
BuildRequires:  tcl-devel
BuildRequires:  tk-devel

LablTk is an interface to the Tcl/Tk GUI framework. It allows to
develop GUI applications in a speedy and type safe way. A legacy
Camltk interface is included. The OCamlBrowser library viewer is
also part of this project.

%package devel
Summary:        Development files for labltk
Group:          Development/Languages/OCaml
Requires:       %{name} = %{version}
Requires:       tcl-devel
Requires:       tk-devel
Requires:       xorg-x11-libX11-devel

%description devel
Labltk is a library for interfacing Objective Caml with the scripting
language Tcl/Tk.

This package contains the development files.  It includes the ocaml
browser for code editing and library browsing.
%autosetup -p1

env \
ocamlopt=$(type -P ocamlc) \
bash -e \
./configure \
	--tklibs '-L%{_libdir}' \
make \
%if 0%{?ocaml_native_compiler}
make \

> $ld_conf
d="$RPM_BUILD_ROOT`ocamlfind printconf destdir`"
mkdir -vp $d/labltk
mkdir -vp $d/stublibs
env \
make \
	BINDIR="$RPM_BUILD_ROOT%{_bindir}" \
	INSTALLDIR=$d/labltk \
	STUBLIBDIR=$d/stublibs \

find examples* -type f -exec chmod -v 644 {} \;
cat $ld_conf

%post   -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.files

%files devel -f %{name}.files.devel