File libcamlpdf.spec of Package libcamlpdf
#
# spec file for package libcamlpdf
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# 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 https://bugs.opensuse.org/
#
Name: libcamlpdf
Version: 2.9.0
Release: 0
Summary: Objective CAML PDF Library
License: LGPL-2.1-or-later
Group: Development/Libraries/OCaml
URL: https://community.coherentpdf.com/
Source0: %{name}-%{version}.tar.xz
BuildRequires: ocaml-findlib
BuildRequires: ocaml-ocamlbuild
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-rpm-macros
%define install_libdir %{buildroot}%{ocaml_standard_library}
%define install_docdir %{buildroot}%{_defaultdocdir}/%{name}/html
%description
CamlPDF is an OCaml library for reading, writing and modifying PDF files. It is the basis of the "CPDF" command line tool and C/C++/Java/Python/.NET/JavaScript API.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/OCaml
Requires: %{name} = %{version}
%description devel
The %{name}-devel package contains libraries and header files for developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
Group: Documentation/Man
BuildArch: noarch
%description doc
This package contains the documentation for %{name}.
%prep
%setup -q
%build
%{__make}
%{__strip} -s dllcamlpdf_stubs.so
%install
%{__install} -d -m 0755 %{install_libdir}
%{__install} -d -m 0755 %{install_docdir}
%{_bindir}/touch %{install_libdir}/ld.conf
OCAMLFIND_INSTFLAGS="-destdir %{install_libdir} -ldconf %{install_libdir}/ld.conf -patch-version %{version}" OCAMLDOCFLAGS="-d %{install_docdir}" %{__make} install
%{__rm} %{install_libdir}/ld.conf
%ocaml_create_file_list
%check
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files -f %{name}.files
%defattr(-,root,root,-)
%license LICENSE
%files devel -f %{name}.files.devel
%defattr(-,root,root,-)
%license LICENSE
%files doc
%defattr(-,root,root,-)
%{_defaultdocdir}
%doc Changes.txt README.md
%license LICENSE
%changelog