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