]> git.pld-linux.org Git - packages/ocaml-ctypes.git/blame - ocaml-ctypes.spec
- this is native only library, so can't disable opt
[packages/ocaml-ctypes.git] / ocaml-ctypes.spec
CommitLineData
0c952b3b
JR
1%define module ctypes
2Summary: Library for binding to C libraries using pure OCaml
3Name: ocaml-%{module}
4Version: 0.3.4
5Release: 1
6License: BSD
7Group: Libraries
8Source0: https://github.com/ocamllabs/ocaml-ctypes/archive/%{version}.tar.gz?/%{module}-%{version}.tar.gz
9# Source0-md5: 5356f0bab5cbc29eba3dded5e35a9e9d
10URL: https://github.com/ocamllabs/ocaml-ctypes
11#BuildRequires: -devel
12BuildRequires: 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
15ExclusiveArch: %{ix86} %{x8664}
16%undefine with_ocaml_opt
0c952b3b
JR
17BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19%description
20ctypes is a library for binding to C libraries using pure OCaml.
21The primary aim is to make writing C extensions as straightforward
22as possible.
23
24The core of ctypes is a set of combinators for describing
25the structure of C types -- numeric types, arrays, pointers, structs,
26unions and functions. You can use these combinators to describe the
27types of the functions that you want to call, then bind directly to
28those functions -- all without writing or generating any C!
29This package contains files needed to run bytecode executables using
30this library.
31
32%package devel
6e15805b 33Summary: Library for binding to C libraries using pure OCaml - development part
0c952b3b
JR
34Group: Development/Libraries
35Requires: %{name} = %{version}-%{release}
36%requires_eq ocaml
37
38%description devel
39This package contains files needed to develop OCaml programs using
6e15805b 40ctypes 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
50rm -rf $RPM_BUILD_ROOT
51export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
52install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
53%{__make} install \
54 DESTDIR=$RPM_BUILD_ROOT
55
7ab0e45d
JR
56install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
57cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
0c952b3b
JR
58
59# move to dir pld ocamlfind looks
60install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
61mv $OCAMLFIND_DESTDIR/%{module}/META \
62 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
63cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
64directory="+%{module}"
65EOF
66
67%clean
68rm -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}
This page took 0.088412 seconds and 4 git commands to generate.