]>
Commit | Line | Data |
---|---|---|
7ebc219f ER |
1 | # |
2 | # Conditional build: | |
86b3d4c5 | 3 | %bcond_without ocaml_opt # build opt |
7ebc219f | 4 | |
e24c4309 | 5 | %ifarch x32 |
6a83d391 | 6 | # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it |
ef427480 | 7 | %undefine▸ with_ocaml_opt |
e24c4309 JR |
8 | %endif |
9 | ||
10 | %if %{without ocaml_opt} | |
11 | %define▸▸ no_install_post_strip▸ 1 | |
12 | # no opt means no native binary, stripping bytecode breaks such programs | |
13 | %define▸▸ _enable_debug_packages▸ 0 | |
14 | %endif | |
15 | ||
846e7db4 ER |
16 | %define module %{module} |
17 | Summary: %{module} binding for OCaml | |
18 | Summary(pl.UTF-8): Wiązania %{module} dla OCamla | |
19 | Name: ocaml-%{module} | |
7dfc48d9 | 20 | Version: - |
9e120d3c | 21 | Release: 1 |
7dfc48d9 | 22 | License: - (enter GPL/LGPL/BSD/BSD-like/other license name here) |
9e120d3c | 23 | Group: Libraries |
846e7db4 | 24 | Source0: %{module}-%{version}.tar.gz |
f2b77a6b | 25 | URL: - |
7dfc48d9 | 26 | # Source0-md5: - |
846e7db4 | 27 | #BuildRequires: -devel |
9e120d3c MM |
28 | BuildRequires: ocaml >= 3.04-7 |
29 | %requires_eq ocaml-runtime | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
846e7db4 ER |
32 | %define debug_package %{nil} |
33 | ||
9e120d3c | 34 | %description |
d954f2a4 | 35 | This package contains files needed to run bytecode executables using |
9e120d3c MM |
36 | this library. |
37 | ||
9be49f18 JR |
38 | %description -l pl.UTF-8 |
39 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów | |
40 | używających tej biblioteki. | |
9e120d3c MM |
41 | |
42 | %package devel | |
efaa8943 ER |
43 | Summary: TEMPLATE binding for OCaml - development part |
44 | Summary(pl.UTF-8): Wiązania TEMPLATE dla OCamla - cześć programistyczna | |
9e120d3c MM |
45 | Group: Development/Libraries |
46 | Requires: %{name} = %{version}-%{release} | |
47 | %requires_eq ocaml | |
48 | ||
49 | %description devel | |
d954f2a4 | 50 | This package contains files needed to develop OCaml programs using |
efaa8943 | 51 | TEMPLATE library. |
9e120d3c | 52 | |
9be49f18 JR |
53 | %description devel -l pl.UTF-8 |
54 | Pakiet ten zawiera pliki niezbędne do tworzenia programów używających | |
efaa8943 | 55 | TEMPLATE biblioteki. |
9e120d3c MM |
56 | |
57 | %prep | |
846e7db4 | 58 | %setup -q -n %{module}-%{version} |
9e120d3c MM |
59 | |
60 | %build | |
86b3d4c5 | 61 | %{__make} -j1 all %{?with_ocaml_opt:opt} \ |
795d4115 | 62 | CC="%{__cc} %{rpmcflags} -fPIC" |
9e120d3c MM |
63 | |
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
846e7db4 ER |
66 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml |
67 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
68 | %{__make} install \ | |
69 | DESTDIR=$RPM_BUILD_ROOT | |
70 | ||
71 | #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
72 | #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
73 | ||
74 | # move to dir pld ocamlfind looks | |
75 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} | |
76 | mv $OCAMLFIND_DESTDIR/%{module}/META \ | |
77 | $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} | |
78 | cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META | |
79 | directory="+%{module}" | |
9e120d3c MM |
80 | EOF |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so | |
88 | ||
89 | %files devel | |
90 | %defattr(644,root,root,755) | |
846e7db4 ER |
91 | %doc LICENSE |
92 | %{_libdir}/ocaml/%{module}/*.cm[xi] | |
93 | %{_libdir}/ocaml/%{module}/*.cmo | |
94 | %{_libdir}/ocaml/%{module}/*.mli | |
86b3d4c5 | 95 | %if %{with ocaml_opt} |
846e7db4 ER |
96 | %{_libdir}/ocaml/%{module}/*.[ao] |
97 | %{_libdir}/ocaml/%{module}/*.cmxa | |
98 | %endif | |
99 | %{_libdir}/ocaml/site-lib/%{module} | |
9e120d3c | 100 | %{_examplesdir}/%{name}-%{version} |