]>
Commit | Line | Data |
---|---|---|
0c952b3b JR |
1 | %define module ctypes |
2 | Summary: Library for binding to C libraries using pure OCaml | |
3 | Name: ocaml-%{module} | |
4 | Version: 0.3.4 | |
5 | Release: 1 | |
6 | License: BSD | |
7 | Group: Libraries | |
8 | Source0: https://github.com/ocamllabs/ocaml-ctypes/archive/%{version}.tar.gz?/%{module}-%{version}.tar.gz | |
9 | # Source0-md5: 5356f0bab5cbc29eba3dded5e35a9e9d | |
10 | URL: https://github.com/ocamllabs/ocaml-ctypes | |
11 | #BuildRequires: -devel | |
12 | BuildRequires: ocaml >= 3.04-7 | |
13 | %requires_eq ocaml-runtime | |
6e15805b JR |
14 | # requires opt not yet available on x32 (ocaml 4.02.1), remove when upstream will support it |
15 | ExclusiveArch: %{ix86} %{x8664} | |
16 | %undefine with_ocaml_opt | |
0c952b3b JR |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
18 | ||
19 | %description | |
20 | ctypes is a library for binding to C libraries using pure OCaml. | |
21 | The primary aim is to make writing C extensions as straightforward | |
22 | as possible. | |
23 | ||
24 | The core of ctypes is a set of combinators for describing | |
25 | the structure of C types -- numeric types, arrays, pointers, structs, | |
26 | unions and functions. You can use these combinators to describe the | |
27 | types of the functions that you want to call, then bind directly to | |
28 | those functions -- all without writing or generating any C! | |
29 | This package contains files needed to run bytecode executables using | |
30 | this library. | |
31 | ||
32 | %package devel | |
6e15805b | 33 | Summary: Library for binding to C libraries using pure OCaml - development part |
0c952b3b JR |
34 | Group: Development/Libraries |
35 | Requires: %{name} = %{version}-%{release} | |
36 | %requires_eq ocaml | |
37 | ||
38 | %description devel | |
39 | This package contains files needed to develop OCaml programs using | |
6e15805b | 40 | ctypes library. |
0c952b3b JR |
41 | |
42 | %prep | |
7ab0e45d | 43 | %setup -q |
0c952b3b JR |
44 | |
45 | %build | |
7ab0e45d | 46 | %{__make} -j1 all \ |
0c952b3b JR |
47 | CC="%{__cc} %{rpmcflags} -fPIC" |
48 | ||
49 | %install | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
52 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
53 | %{__make} install \ | |
54 | DESTDIR=$RPM_BUILD_ROOT | |
55 | ||
7ab0e45d JR |
56 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
57 | cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
0c952b3b JR |
58 | |
59 | # move to dir pld ocamlfind looks | |
60 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} | |
61 | mv $OCAMLFIND_DESTDIR/%{module}/META \ | |
62 | $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} | |
63 | cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META | |
64 | directory="+%{module}" | |
65 | EOF | |
66 | ||
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
72 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so | |
73 | ||
74 | %files devel | |
75 | %defattr(644,root,root,755) | |
76 | %doc LICENSE | |
6e15805b | 77 | %{_libdir}/ocaml/%{module}/*.h |
0c952b3b | 78 | %{_libdir}/ocaml/%{module}/*.cm[xi] |
0c952b3b | 79 | %{_libdir}/ocaml/%{module}/*.mli |
0c952b3b | 80 | %{_libdir}/ocaml/%{module}/*.[ao] |
6e15805b | 81 | %{_libdir}/ocaml/%{module}/*.cma |
0c952b3b | 82 | %{_libdir}/ocaml/%{module}/*.cmxa |
6e15805b | 83 | %{_libdir}/ocaml/%{module}/*.cmxs |
0c952b3b JR |
84 | %{_libdir}/ocaml/site-lib/%{module} |
85 | %{_examplesdir}/%{name}-%{version} |