]>
Commit | Line | Data |
---|---|---|
c387939e ER |
1 | # |
2 | # Conditional build: | |
b063ee86 | 3 | %bcond_without ocaml_opt # native optimized binaries (bytecode is always built) |
26f5462e | 4 | |
b063ee86 JB |
5 | # not yet available on x32 (ocaml 4.02.1), update when upstream will support it |
6 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 | |
26f5462e JR |
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 | |
cbc6980f | 13 | Summary(pl.UTF-8): Biblioteka JSON dla OCamla |
2c1e68e3 | 14 | Name: ocaml-%{module} |
b9f19bb4 | 15 | Version: 1.7.0 |
def79497 | 16 | Release: 4 |
c387939e ER |
17 | License: BSD |
18 | Group: Libraries | |
80ff84d1 | 19 | #Source0Download: https://github.com/ocaml-community/yojson/releases |
b9f19bb4 JR |
20 | Source0: https://github.com/ocaml-community/yojson/releases/download/%{version}/%{module}-%{version}.tbz |
21 | # Source0-md5: b89d39ca3f8c532abe5f547ad3b8f84d | |
22 | URL: https://github.com/ocaml-community/yojson | |
72311284 | 23 | BuildRequires: cppo >= 1.5.0 |
b063ee86 JB |
24 | BuildRequires: ocaml >= 1:4.02.3 |
25 | BuildRequires: ocaml-biniou-devel >= 1.2.0 | |
b9f19bb4 | 26 | BuildRequires: ocaml-dune |
c387939e ER |
27 | BuildRequires: ocaml-easy-format-devel >= 1.0.1 |
28 | BuildRequires: ocaml-findlib >= 1.4 | |
29 | %requires_eq ocaml-runtime | |
b063ee86 | 30 | Requires: ocaml-biniou >= 1.2.0 |
14a8d409 | 31 | Requires: ocaml-easy-format >= 1.0.1 |
c387939e ER |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
34 | %description | |
35 | Yojson is an optimized parsing and printing library for the JSON | |
36 | format. It addresses a few shortcomings of json-wheel including 3x | |
37 | speed improvement, polymorphic variants and optional syntax for tuples | |
cbc6980f | 38 | and variants. |
c387939e ER |
39 | |
40 | %description -l pl.UTF-8 | |
cbc6980f JB |
41 | Yojson to zoptymalizowana biblioteka do analizy i wypisywania formatu |
42 | JSON. Wychodzi naprzeciw kilku ograniczeniom biblioteki json-wheel, | |
43 | m.in. daje trzykrotne przyspieszenie, warianty polimorficzne i | |
44 | składnię opcjonalną dla krotek i wariantów. | |
c387939e ER |
45 | |
46 | %package devel | |
cbc6980f | 47 | Summary: JSON library for OCaml - development part |
e811cfc4 | 48 | Summary(pl.UTF-8): Biblioteka JSON dla OCamla - część programistyczna |
c387939e | 49 | Group: Development/Libraries |
a49967bb | 50 | Requires: %{name} = %{version}-%{release} |
cbc6980f | 51 | %requires_eq ocaml |
b063ee86 | 52 | Requires: ocaml-biniou-devel >= 1.2.0 |
14a8d409 | 53 | Requires: ocaml-easy-format-devel >= 1.0.1 |
c387939e ER |
54 | |
55 | %description devel | |
56 | This package contains files needed to develop OCaml programs using | |
57 | this library. | |
58 | ||
59 | %description devel -l pl.UTF-8 | |
cbc6980f JB |
60 | Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu |
61 | używających biblioteki yojson. | |
c387939e ER |
62 | |
63 | %prep | |
2c1e68e3 | 64 | %setup -q -n %{module}-%{version} |
c387939e ER |
65 | |
66 | %build | |
b063ee86 | 67 | dune build --verbose |
c387939e ER |
68 | |
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
b063ee86 JB |
71 | |
72 | dune install --destdir=$RPM_BUILD_ROOT | |
73 | ||
74 | # sources | |
75 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}/*.ml | |
76 | # packaged as %doc | |
77 | %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc/%{module} | |
c387939e | 78 | |
c387939e ER |
79 | %clean |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
a49967bb JR |
82 | %files |
83 | %defattr(644,root,root,755) | |
b063ee86 JB |
84 | %doc LICENSE.md README.md |
85 | %dir %{_libdir}/ocaml/yojson | |
2e761ba0 | 86 | %{_libdir}/ocaml/yojson/META |
b063ee86 | 87 | %{_libdir}/ocaml/yojson/*.cma |
26f5462e | 88 | %if %{with ocaml_opt} |
b063ee86 JB |
89 | %attr(755,root,root) %{_bindir}/ydump |
90 | %attr(755,root,root) %{_libdir}/ocaml/yojson/*.cmxs | |
26f5462e | 91 | %endif |
a49967bb | 92 | |
c387939e ER |
93 | %files devel |
94 | %defattr(644,root,root,755) | |
b063ee86 JB |
95 | %{_libdir}/ocaml/yojson/*.cmi |
96 | %{_libdir}/ocaml/yojson/*.cmt | |
97 | %{_libdir}/ocaml/yojson/*.cmti | |
98 | %{_libdir}/ocaml/yojson/*.mli | |
26f5462e | 99 | %if %{with ocaml_opt} |
b063ee86 JB |
100 | %{_libdir}/ocaml/yojson/*.a |
101 | %{_libdir}/ocaml/yojson/*.cmx | |
102 | %{_libdir}/ocaml/yojson/*.cmxa | |
2c1e68e3 | 103 | %endif |
b063ee86 JB |
104 | %{_libdir}/ocaml/yojson/dune-package |
105 | %{_libdir}/ocaml/yojson/opam |