Blob Blame History Raw
# OCaml packages not built on i686 since OCaml 5 / Fedora 39.
ExcludeArch: %{ix86}

# There is also a separate test data repository for a different set of tests
# that is distributed separately.

Name:           ocaml-dose3
Version:        7.0.0
Release:        %autorelease
Summary:        Framework for managing distribution packages and dependencies

License:        LGPL-3.0-or-later WITH OCaml-LGPL-linking-exception
URL:            http://www.mancoosi.org/software/

Source0:        https://gitlab.com/irill/dose3/-/archive/%{version}/dose3-%{version}.tar.gz

# Use oUnit2 instead of oUnit
Patch0:         0001-Use-ounit2.patch
# We do not need stdlib-shims, which provides forward compatibility
Patch1:         0002-Do-not-depend-on-stdlib-shims.patch
# Expose a dependency on the math library so RPM can see it
Patch2:         0003-Depend-on-the-math-library.patch
# Changes for OCaml 5 compatibility
Patch3:         0004-OCaml-5-compatibility.patch
# ocamlgraph 2.1.0 adds a blank line to the end of its output, breaking tests
Patch4:         0005-OCamlgraph-2.1.0-adds-a-newline.patch

BuildRequires:  ocaml
BuildRequires:  ocaml-dune
BuildRequires:  ocaml-base64-devel >= 3.4.0-1
BuildRequires:  ocaml-camlbz2-devel
BuildRequires:  ocaml-camlp-streams-devel
BuildRequires:  ocaml-cudf-devel
BuildRequires:  ocaml-extlib-devel
BuildRequires:  ocaml-ocamlgraph-devel
BuildRequires:  ocaml-ounit-devel
BuildRequires:  ocaml-parmap-devel
BuildRequires:  ocaml-re-devel
BuildRequires:  ocaml-zip-devel

BuildRequires:  zlib-devel

BuildRequires:  perl, perl-generators

# Test dependencies
BuildRequires:  dpkg
BuildRequires:  %{py3_dist pyyaml}

# Needs latex for documentation.
BuildRequires:  tex(latex)
BuildRequires:  tex(comment.sty)
BuildRequires:  pandoc
BuildRequires:  graphviz
BuildRequires:  poetry
BuildRequires:  python3
BuildRequires:  %{py3_dist sphinx}
BuildRequires:  %{py3_dist sphinx_rtd_theme}
BuildRequires:  %{py3_dist wheel}

# Depend on pod2man, pod2html.
BuildRequires:  /usr/bin/pod2man
BuildRequires:  /usr/bin/pod2html

%description
Dose3 is a framework made of several OCaml libraries for managing
distribution packages and their dependencies.

Though not tied to any particular distribution, dose3 constitutes a pool of
libraries which enable analyzing packages coming from various distributions.

Besides basic functionalities for querying and setting package properties,
dose3 also implements algorithms for solving more complex problems
(monitoring package evolutions, correct and complete dependency resolution,
repository-wide uninstallability checks).

%package        devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}
Requires:       ocaml-base64-devel%{?_isa}
Requires:       ocaml-camlbz2-devel%{?_isa}
Requires:       ocaml-cudf-devel%{?_isa}
Requires:       ocaml-extlib-devel%{?_isa}
Requires:       ocaml-ocamlgraph-devel%{?_isa}
Requires:       ocaml-re-devel%{?_isa}
Requires:       ocaml-zip-devel%{?_isa}

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

# Since these are applications, I think the correct name is "dose3-tools"
# and not "ocaml-dose3-tools", but I'm happy to change it if necessary.

%package -n dose3-tools
Summary:        Tools suite from the dose3 framework

%description -n dose3-tools
Dose3 is a framework made of several OCaml libraries for managing
distribution packages and their dependencies.

This package contains the tools shipped with the dose3 framework
for manipulating packages of various formats.

%prep
%autosetup -p1 -n dose3-%{version}

# Do not run linkcheck; the koji builders have no network access
sed -i 's/html linkcheck/html/' doc/rtd/Makefile

%build
%dune_build
# FIXME: parallel build does not work
make -C doc

%install
%dune_install
sed -i '\@%{_bindir}@d;\@%{_mandir}@d' .ofiles

# Install manpages.
mkdir -p %{buildroot}%{_mandir}/man1/
mkdir -p %{buildroot}%{_mandir}/man5/
mkdir -p %{buildroot}%{_mandir}/man8/
cp -a doc/manpages/*.8 %{buildroot}%{_mandir}/man8/
cp -a doc/manpages/*.5 %{buildroot}%{_mandir}/man5/
cp -a doc/manpages/*.1 %{buildroot}%{_mandir}/man1/

%check
%dune_check

%files -f .ofiles
%license COPYING
%doc CHANGES CREDITS README.architecture

%files devel -f .ofiles-devel
%license COPYING

%files -n dose3-tools
%license COPYING
%doc doc/debcheck.primer/*.pdf
%doc doc/apt-external-solvers.primer/*.pdf
%doc doc/apt-cudf/
%{_bindir}/apt-cudf
%{_bindir}/dose-builddebcheck
%{_bindir}/dose-ceve
%{_bindir}/dose-challenged
%{_bindir}/dose-deb-coinstall
%{_bindir}/dose-distcheck
%{_bindir}/dose-outdated
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_mandir}/man8/*.8*

%changelog
%autochangelog