]>
Commit | Line | Data |
---|---|---|
46f28b30 JR |
1 | # |
2 | # Conditional build: | |
c3c5f57f | 3 | %bcond_without ocaml_opt # native optimized binaries (bytecode is always built) |
46f28b30 JR |
4 | |
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 | |
7 | %undefine with_ocaml_opt | |
8 | %endif | |
9 | ||
10 | %if %{without ocaml_opt} | |
11 | %define _enable_debug_packages 0 | |
12 | %endif | |
13 | ||
0c952b3b JR |
14 | %define module ctypes |
15 | Summary: Library for binding to C libraries using pure OCaml | |
adbf4531 | 16 | Summary(pl.UTF-8): Biblioteka do wiązania z bibliotekami C przy użyciu czystego OCamla |
0c952b3b | 17 | Name: ocaml-%{module} |
c3c5f57f | 18 | Version: 0.19.1 |
b7e549ef | 19 | Release: 3 |
adbf4531 | 20 | License: MIT |
0c952b3b | 21 | Group: Libraries |
6596d3f6 | 22 | #Source0Download: https://github.com/ocamllabs/ocaml-ctypes/releases |
cfd85255 | 23 | Source0: https://github.com/ocamllabs/ocaml-ctypes/archive/%{version}/%{module}-%{version}.tar.gz |
c3c5f57f | 24 | # Source0-md5: ceb891ec568fd7da76c31af270a2afe2 |
0c952b3b | 25 | URL: https://github.com/ocamllabs/ocaml-ctypes |
adbf4531 | 26 | BuildRequires: libffi-devel |
c3c5f57f | 27 | BuildRequires: ocaml >= 1:4.03.0 |
c79b9828 | 28 | BuildRequires: ocaml-bigarray-compat-devel |
c3c5f57f | 29 | BuildRequires: ocaml-integers-devel >= 0.3.0 |
0c952b3b JR |
30 | %requires_eq ocaml-runtime |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
c79b9828 JR |
34 | ctypes is a library for binding to C libraries using pure OCaml. The |
35 | primary aim is to make writing C extensions as straightforward as | |
36 | possible. | |
0c952b3b | 37 | |
c79b9828 JR |
38 | The core of ctypes is a set of combinators for describing the |
39 | structure of C types -- numeric types, arrays, pointers, structs, | |
0c952b3b JR |
40 | unions and functions. You can use these combinators to describe the |
41 | types of the functions that you want to call, then bind directly to | |
42 | those functions -- all without writing or generating any C! | |
adbf4531 | 43 | |
0c952b3b JR |
44 | This package contains files needed to run bytecode executables using |
45 | this library. | |
46 | ||
adbf4531 JB |
47 | %description -l pl.UTF-8 |
48 | ctypes to biblioteka do wiązania z bibliotekami C przy użyciu czystego | |
49 | OCamla. Głównym celem jest uczynienie pisania rozszerzeń w C jak | |
50 | najprostszym. | |
51 | ||
52 | Serce ctypes to zbiór kombinatorów do opisu struktur typów C - typów | |
53 | liczbowych, tablic, wskaźników, struktur, unii oraz funkcji. Można ich | |
54 | używać do opisu typów funkcji, które mają być wywoływane, a następnie | |
55 | dowiązać bezpośrednio do tych funkcji - bez pisania ani generowania | |
56 | żadnego kodu w C! | |
57 | ||
58 | Ten pakiet zawiera pliki niezbędne do uruchamiania programów | |
59 | bajtkodowych wykorzystujących bibliotekę. | |
60 | ||
0c952b3b | 61 | %package devel |
6e15805b | 62 | Summary: Library for binding to C libraries using pure OCaml - development part |
adbf4531 | 63 | Summary(pl.UTF-8): Biblioteka do wiązania z bibliotekami C przy użyciu czystego OCamla - część programistyczna |
0c952b3b JR |
64 | Group: Development/Libraries |
65 | Requires: %{name} = %{version}-%{release} | |
64406cb8 JB |
66 | Requires: ocaml-bigarray-compat-devel |
67 | Requires: ocaml-integers-devel >= 0.3.0 | |
c3c5f57f | 68 | %requires_eq ocaml |
0c952b3b JR |
69 | |
70 | %description devel | |
71 | This package contains files needed to develop OCaml programs using | |
6e15805b | 72 | ctypes library. |
0c952b3b | 73 | |
adbf4531 JB |
74 | %description devel -l pl.UTF-8 |
75 | Ten pakiet zawiera pliki niezbędne do tworzenia programów w OCamlu | |
76 | wykorzystujących bibliotekę ctypes. | |
77 | ||
0c952b3b | 78 | %prep |
7ab0e45d | 79 | %setup -q |
0c952b3b JR |
80 | |
81 | %build | |
7ab0e45d | 82 | %{__make} -j1 all \ |
0c952b3b JR |
83 | CC="%{__cc} %{rpmcflags} -fPIC" |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
88 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
c3c5f57f | 89 | |
0c952b3b JR |
90 | %{__make} install \ |
91 | DESTDIR=$RPM_BUILD_ROOT | |
92 | ||
7ab0e45d JR |
93 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
94 | cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
0c952b3b | 95 | |
cfd85255 JB |
96 | # packaged as %doc |
97 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/ctypes/CHANGES.md | |
98 | # findlib files, useless when packaging to rpm | |
99 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.owner | |
100 | ||
0c952b3b JR |
101 | %clean |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %files | |
105 | %defattr(644,root,root,755) | |
adbf4531 | 106 | %doc CHANGES.md LICENSE README.md |
adbf4531 | 107 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllctypes_stubs.so |
c79b9828 | 108 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllctypes-foreign_stubs.so |
dbd2b6bd | 109 | %dir %{_libdir}/ocaml/%{module} |
c79b9828 | 110 | %{_libdir}/ocaml/%{module}/META |
46f28b30 | 111 | %if %{with ocaml_opt} |
dbd2b6bd | 112 | %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs |
46f28b30 | 113 | %endif |
dbd2b6bd | 114 | %{_libdir}/ocaml/%{module}/*.cma |
0c952b3b JR |
115 | |
116 | %files devel | |
117 | %defattr(644,root,root,755) | |
6e15805b | 118 | %{_libdir}/ocaml/%{module}/*.h |
46f28b30 JR |
119 | %{_libdir}/ocaml/%{module}/*.cmi |
120 | %{_libdir}/ocaml/%{module}/*.cmti | |
0c952b3b | 121 | %{_libdir}/ocaml/%{module}/*.mli |
6596d3f6 | 122 | %{_libdir}/ocaml/%{module}/*.a |
46f28b30 | 123 | %if %{with ocaml_opt} |
60d10e85 | 124 | %{_libdir}/ocaml/%{module}/*.cmt |
46f28b30 | 125 | %{_libdir}/ocaml/%{module}/*.cmx |
0c952b3b | 126 | %{_libdir}/ocaml/%{module}/*.cmxa |
46f28b30 | 127 | %endif |
0c952b3b | 128 | %{_examplesdir}/%{name}-%{version} |