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