]>
Commit | Line | Data |
---|---|---|
97fa1e21 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ocaml_opt # native optimized binaries (bytecode is always built) | |
4 | %bcond_without apidocs # API documentation | |
5 | ||
6 | # not yet available on x32 (ocaml 4.02.1), update when upstream will support it | |
7 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 | |
8 | %undefine with_ocaml_opt | |
9 | %endif | |
10 | ||
11 | Summary: Non-blocking streaming Unicode codec for OCaml | |
12 | Summary(pl.UTF-8): Nieblokujący strumieniowy kodek Unicode dla OCamla | |
13 | Name: ocaml-uutf | |
14 | Version: 1.0.2 | |
15 | Release: 1 | |
16 | License: ISC | |
17 | Group: Libraries | |
18 | Source0: https://erratique.ch/software/uutf/releases/uutf-%{version}.tbz | |
19 | # Source0-md5: a7c542405a39630c689a82bd7ef2292c | |
20 | # don't require uchar package, drop compatibility with ocaml < 4.03 | |
21 | Patch0: %{name}-uchar.patch | |
22 | Patch1: %{name}-deprecated.patch | |
23 | URL: https://erratique.ch/software/uutf | |
24 | BuildRequires: ocaml >= 1:4.03 | |
25 | BuildRequires: ocaml-cmdliner-devel >= 0.9.6 | |
26 | BuildRequires: ocaml-findlib-devel | |
27 | BuildRequires: ocaml-ocamlbuild | |
28 | %{?with_apidocs:BuildRequires: ocaml-ocamldoc} | |
29 | BuildRequires: ocaml-topkg-devel | |
30 | BuildRequires: rpm-build >= 4.6 | |
31 | %requires_eq ocaml-runtime | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %define debug_package %{nil} | |
35 | ||
36 | %description | |
37 | Uutf is a non-blocking streaming codec to decode and encode the UTF-8, | |
38 | UTF-16, UTF-16LE and UTF-16BE encoding schemes. It can efficiently | |
39 | work character by character without blocking on I/O. Decoders perform | |
40 | character position tracking and support newline normalization. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Uutf to nieblokujący strumieniowy kodek do dekodowania i kodowania | |
44 | schematów UTF-8, UTF-16, UTF16LE i UTF-16BE. Potrafi efektywnie | |
45 | działać znak po znaku bez blokowania na we/wy. Dekodery wykonują | |
46 | śledzenie pozycji znaków i obsługują normalizację znaków nowego | |
47 | wiersza. | |
48 | ||
49 | %package devel | |
50 | Summary: Non-blocking streaming Unicode codec for OCaml - development part | |
3e6f7898 | 51 | Summary(pl.UTF-8): Nieblokujący strumieniowy kodek Unicode dla OCamla - część programistyczna |
97fa1e21 JB |
52 | Group: Development/Libraries |
53 | Requires: %{name} = %{version}-%{release} | |
54 | %requires_eq ocaml | |
55 | ||
56 | %description devel | |
57 | This package contains files needed to develop OCaml programs using | |
58 | uutf library. | |
59 | ||
60 | %description devel -l pl.UTF-8 | |
61 | Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu | |
62 | używających biblioteki uutf. | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for OCaml uutf library | |
66 | Summary(pl.UTF-8): Dokumentacja API biblioteki OCamla uutf | |
67 | Group: Documentation | |
68 | BuildArch: noarch | |
69 | ||
70 | %description apidocs | |
71 | API documentation for OCaml uutf library. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API biblioteki OCamla uutf. | |
75 | ||
76 | %prep | |
77 | %setup -q -n uutf-%{version} | |
78 | %patch0 -p1 | |
79 | %patch1 -p1 | |
80 | ||
81 | %build | |
82 | ocaml pkg/pkg.ml build --with-cmdliner true | |
83 | ||
84 | %if %{with apidocs} | |
85 | install -d html | |
86 | ocamldoc -html -d html -I _build/src _build/src/uutf.mli | |
87 | %endif | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/uutf | |
92 | ||
93 | cp -p _build/{opam,pkg/META} $RPM_BUILD_ROOT%{_libdir}/ocaml/uutf | |
94 | cp -p _build/src/*.{cma,cmi,cmt,cmti,mli} $RPM_BUILD_ROOT%{_libdir}/ocaml/uutf | |
95 | %if %{with ocaml_opt} | |
96 | cp -p _build/src/*.{a,cmx,cmxa,cmxs} $RPM_BUILD_ROOT%{_libdir}/ocaml/uutf | |
97 | %endif | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %files | |
103 | %defattr(644,root,root,755) | |
104 | %doc CHANGES.md LICENSE.md README.md | |
105 | %dir %{_libdir}/ocaml/uutf | |
106 | %{_libdir}/ocaml/uutf/META | |
107 | %{_libdir}/ocaml/uutf/*.cma | |
108 | %if %{with ocaml_opt} | |
109 | %attr(755,root,root) %{_libdir}/ocaml/uutf/*.cmxs | |
110 | %endif | |
111 | ||
112 | %files devel | |
113 | %defattr(644,root,root,755) | |
97fa1e21 JB |
114 | %{_libdir}/ocaml/uutf/*.cmi |
115 | %{_libdir}/ocaml/uutf/*.cmt | |
116 | %{_libdir}/ocaml/uutf/*.cmti | |
117 | %{_libdir}/ocaml/uutf/*.mli | |
118 | %if %{with ocaml_opt} | |
b9888b4c | 119 | %{_libdir}/ocaml/uutf/*.a |
97fa1e21 JB |
120 | %{_libdir}/ocaml/uutf/*.cmx |
121 | %{_libdir}/ocaml/uutf/*.cmxa | |
122 | %endif | |
123 | %{_libdir}/ocaml/uutf/opam | |
124 | ||
125 | %if %{with apidocs} | |
126 | %files apidocs | |
127 | %defattr(644,root,root,755) | |
128 | %doc html/* | |
129 | %endif |