Enable tests
[fedora-reviews.git] / ocaml-yaml / ocaml-yaml.spec
1 Name:           ocaml-yaml
2 Version:        3.1.0
3 Release:        %autorelease
4 Summary:        Parse and generate YAML 1.1/1.2 files
5
6 License:        ISC
7 URL:            https://avsm.github.io/ocaml-yaml/
8 Source0:        https://github.com/avsm/ocaml-yaml/releases/download/v%{version}/yaml-%{version}.tbz
9
10 # These are used to unbundle libyaml.
11 Patch1:         fix-yaml.h.patch
12 Source1:        unbundled-dune
13
14 BuildRequires:  ocaml >= 4.13.0
15 BuildRequires:  ocaml-bos-devel
16 BuildRequires:  ocaml-ctypes-devel >= 0.14.0
17 BuildRequires:  ocaml-dune >= 2.0
18 BuildRequires:  ocaml-dune-configurator-devel
19 BuildRequires:  ocaml-ppx-sexp-conv-devel >= 0.9.0
20 BuildRequires:  ocaml-sexplib-devel
21 BuildRequires:  libyaml-devel
22
23 # Test dependencies
24 # Fedora does not have crowbar, ezjsonm, or junit_alcotest
25 %if 0
26 BuildRequires:  ocaml-alcotest-devel
27 BuildRequires:  ocaml-crowbar-devel
28 BuildRequires:  ocaml-ezjsonm-devel
29 BuildRequires:  ocaml-fmt-devel
30 BuildRequires:  ocaml-junit-alcotest-devel
31 BuildRequires:  ocaml-logs-devel
32 BuildRequires:  ocaml-mdx-devel >= 2.10
33 %endif
34
35 %description
36 This is an OCaml library to parse and generate the YAML file format.  It
37 is intended to be interoperable with the Ezjsonm
38 (https://github.com/mirage/ezjsonm) JSON handling library, if the simple
39 common subset of Yaml is used.  Anchors and other advanced Yaml features
40 are not implemented in the JSON compatibility layer.
41
42 %package        devel
43 Summary:        Development files for %{name}
44 Requires:       %{name}%{?_isa} = %{version}-%{release}
45 Requires:       ocaml-bos-devel%{?_isa}
46 Requires:       ocaml-ctypes-devel%{?_isa}
47
48 %description    devel
49 The %{name}-devel package contains libraries and signature
50 files for developing applications that use %{name}.
51
52 %package        sexp
53 Summary:        Parse and generate YAML 1.1/1.2 files with sexp support
54 Requires:       %{name}%{?_isa} = %{version}-%{release}
55
56 %description    sexp
57 This package adds sexp support to the functionality of ocaml-yaml.
58
59 %package        sexp-devel
60 Summary:        Development files for %{name}-sexp
61 Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
62 Requires:       %{name}-sexp%{?_isa} = %{version}-%{release}
63 Requires:       ocaml-ppx-sexp-conv-devel%{?_isa}
64 Requires:       ocaml-sexplib-devel%{?_isa}
65
66 %description    sexp-devel
67 The %{name}-sexp-devel package contains libraries and signature
68 files for developing applications that use %{name}-sexp.
69
70 %prep
71 %setup -n yaml-%{version}
72
73 # Unbundle the included copy of libyaml.
74 # https://bugzilla.redhat.com/show_bug.cgi?id=2217729#c4
75 rm vendor/*.c vendor/yaml.h vendor/yaml_private.h vendor/dune
76 cp %{_includedir}/yaml.h vendor/yaml.h
77 %patch -P1 -p1
78 touch vendor/dummy.c
79 cp %{SOURCE1} vendor/dune
80
81 sed -i 's|../../vendor/yaml_private.h||g' ffi/lib/dune
82
83 %build
84 %dune_build
85
86 %install
87 %dune_install -s
88
89 %if 0
90 %check
91 %dune_check
92 %endif
93
94 %files -f .ofiles-yaml
95 %license LICENSE.md
96 %doc README.md CHANGES.md
97
98 %files devel -f .ofiles-yaml-devel
99
100 %files sexp -f .ofiles-yaml-sexp
101 %license LICENSE.md
102 %doc README.md CHANGES.md
103
104 %files sexp-devel -f .ofiles-yaml-sexp-devel
105
106 %changelog
107 %autochangelog