File cpdf.spec of Package cpdf

#
# spec file for package cpdf
#
# Copyright (c) 2025 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:           cpdf
Version:        2.8.1
Release:        0
Summary:        Coherent PDF Command Line Tools
License:        AGPL-3.0-only
Group:          Productivity/Publishing/PDF
URL:            https://community.coherentpdf.com/
Source0:        %{name}-%{version}.tar.xz
Patch0:         %{name}-make.patch
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-ocamlbuild
BuildRequires:  ocaml-rpm-macros
BuildRequires:  libcamlpdf-devel

%define install_libdir %{buildroot}%{ocaml_standard_library}

%description
The Coherent PDF Command Line Tools and C/C++/Python/.NET/Java/JavaScript API allow you to manipulate existing PDF files in a variety of ways. For example:

- Merge PDF files together, or split them apart
- Encrypt and decrypt
- Scale, crop and rotate pages
- Read and set document info and metadata
- Copy, add or remove bookmarks
- Read, write and modify annotations
- Put multiple pages on one (imposition)
- Stamp logos, text, dates, page numbers
- Add or remove attachments
- Losslessly compress PDF files
- Convert PDF files to and from JSON
- Draw shapes and text on PDF files
- Create and modify PDF/UA and PDF/UA-2 documents

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

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

%prep
%setup -q
%patch -P0

%build
%{__make}
%{__strip} -s %{name}

%install
%{__install} -d -m 0755 %{install_libdir}
%{__install} -d -m 0755 %{buildroot}%{_defaultdocdir}
%{__install} -D -m 0755 -p %{name} %{buildroot}%{_bindir}/%{name}
OCAMLFIND_INSTFLAGS="-destdir %{install_libdir} -patch-version %{version}" %{__make} install
%ocaml_create_file_list

%check

%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{name}
%license LICENSE.md

%files devel -f %{name}.files.devel
%defattr(-,root,root,-)
%doc Changes README.md
%license LICENSE.md

%changelog
openSUSE Build Service is sponsored by