]>
Commit | Line | Data |
---|---|---|
c387939e ER |
1 | # |
2 | # Conditional build: | |
26f5462e JR |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) |
4 | ||
5 | # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it | |
6 | %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9 | |
7 | %undefine with_ocaml_opt | |
8 | %endif | |
c387939e | 9 | |
2c1e68e3 | 10 | %define module yojson |
c387939e ER |
11 | %define debug_package %{nil} |
12 | Summary: JSON library for OCaml | |
2c1e68e3 | 13 | Name: ocaml-%{module} |
b9f19bb4 | 14 | Version: 1.7.0 |
def79497 | 15 | Release: 4 |
c387939e ER |
16 | License: BSD |
17 | Group: Libraries | |
b9f19bb4 JR |
18 | Source0: https://github.com/ocaml-community/yojson/releases/download/%{version}/%{module}-%{version}.tbz |
19 | # Source0-md5: b89d39ca3f8c532abe5f547ad3b8f84d | |
20 | URL: https://github.com/ocaml-community/yojson | |
72311284 | 21 | BuildRequires: cppo >= 1.5.0 |
c387939e ER |
22 | BuildRequires: ocaml >= 3.04-7 |
23 | BuildRequires: ocaml-biniou-devel >= 1.0.6 | |
b9f19bb4 | 24 | BuildRequires: ocaml-dune |
c387939e ER |
25 | BuildRequires: ocaml-easy-format-devel >= 1.0.1 |
26 | BuildRequires: ocaml-findlib >= 1.4 | |
b9f19bb4 | 27 | BuildRequires: ocamlbuild-cppo >= 1.6.1 |
c387939e | 28 | %requires_eq ocaml-runtime |
14a8d409 JR |
29 | Requires: ocaml-biniou >= 1.0.6 |
30 | Requires: ocaml-easy-format >= 1.0.1 | |
c387939e ER |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
34 | Yojson is an optimized parsing and printing library for the JSON | |
35 | format. It addresses a few shortcomings of json-wheel including 3x | |
36 | speed improvement, polymorphic variants and optional syntax for tuples | |
37 | and variants. . It is a replacement for json-wheel | |
38 | (libjson-wheel-ocaml-dev). . This package contain the development | |
39 | files needed for programming with the library. | |
40 | ||
41 | %description -l pl.UTF-8 | |
42 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów | |
43 | używających tej biblioteki. | |
44 | ||
45 | %package devel | |
46 | Summary: yojson binding for OCaml - development part | |
47 | Summary(pl.UTF-8): Wiązania yojson dla OCamla - cześć programistyczna | |
48 | Group: Development/Libraries | |
b9f19bb4 | 49 | %requires_eq ocaml |
a49967bb | 50 | Requires: %{name} = %{version}-%{release} |
14a8d409 JR |
51 | Requires: ocaml-biniou-devel >= 1.0.6 |
52 | Requires: ocaml-easy-format-devel >= 1.0.1 | |
c387939e ER |
53 | |
54 | %description devel | |
55 | This package contains files needed to develop OCaml programs using | |
56 | this library. | |
57 | ||
58 | %description devel -l pl.UTF-8 | |
59 | Pakiet ten zawiera pliki niezbędne do tworzenia programów używających | |
60 | tej biblioteki. | |
61 | ||
62 | %prep | |
2c1e68e3 | 63 | %setup -q -n %{module}-%{version} |
c387939e ER |
64 | |
65 | %build | |
b9f19bb4 | 66 | dune build |
c387939e ER |
67 | |
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
2c1e68e3 ER |
70 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml} |
71 | %{__make} install \ | |
72 | OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml \ | |
73 | PREFIX=$RPM_BUILD_ROOT%{_prefix} \ | |
74 | DESTDIR=$RPM_BUILD_ROOT | |
c387939e | 75 | |
c387939e ER |
76 | %clean |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
a49967bb JR |
79 | %files |
80 | %defattr(644,root,root,755) | |
b9f19bb4 | 81 | %doc README.md |
a49967bb | 82 | %dir %{_libdir}/ocaml/%{module} |
2e761ba0 | 83 | %{_libdir}/ocaml/yojson/META |
b9f19bb4 JR |
84 | %{_libdir}/ocaml/yojson/dune-package |
85 | %{_libdir}/ocaml/yojson/opam | |
26f5462e | 86 | %if %{with ocaml_opt} |
a49967bb | 87 | %{_libdir}/ocaml/%{module}/*.cmxs |
26f5462e | 88 | %endif |
a49967bb | 89 | |
c387939e ER |
90 | %files devel |
91 | %defattr(644,root,root,755) | |
b9f19bb4 | 92 | %doc LICENSE.md |
2c1e68e3 ER |
93 | %{_libdir}/ocaml/%{module}/*.cm[ix] |
94 | %{_libdir}/ocaml/%{module}/*.cm[ao] | |
95 | %{_libdir}/ocaml/%{module}/*.mli | |
26f5462e | 96 | %if %{with ocaml_opt} |
2c1e68e3 ER |
97 | %attr(755,root,root) %{_bindir}/ydump |
98 | %{_libdir}/ocaml/%{module}/*.[ao] | |
b9f19bb4 | 99 | %{_libdir}/ocaml/%{module}/*.cmxa |
2c1e68e3 | 100 | %endif |
b9f19bb4 JR |
101 | %{_libdir}/ocaml/yojson/yojson.cmt |
102 | %{_libdir}/ocaml/yojson/yojson.cmti | |
103 | %{_libdir}/ocaml/yojson/yojson_biniou.cmt | |
104 | %{_libdir}/ocaml/yojson/yojson_biniou.cmti |