]>
Commit | Line | Data |
---|---|---|
7ebc219f ER |
1 | # |
2 | # Conditional build: | |
2800a261 | 3 | %bcond_without ocaml_opt # 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 |
2bd7838d | 6 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 |
44fcb5b9 | 7 | %undefine with_ocaml_opt |
e24c4309 JR |
8 | %endif |
9 | ||
2800a261 | 10 | %define module TEMPLATE |
846e7db4 ER |
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 |
7dfc48d9 | 19 | # Source0-md5: - |
2800a261 | 20 | URL: - |
846e7db4 | 21 | #BuildRequires: -devel |
7043b3a2 | 22 | BuildRequires: ocaml >= 1:4.00 |
2800a261 | 23 | #BuildRequires: ocaml-dune |
9e120d3c MM |
24 | %requires_eq ocaml-runtime |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
846e7db4 | 27 | %define debug_package %{nil} |
06bc3075 JB |
28 | %if %{without ocaml_opt} |
29 | %define no_install_post_strip 1 | |
30 | # no opt means no native binary, stripping bytecode breaks such programs | |
31 | %define _enable_debug_packages 0 | |
32 | %endif | |
846e7db4 | 33 | |
9e120d3c | 34 | %description |
d954f2a4 | 35 | This package contains files needed to run bytecode executables using |
51635295 | 36 | TEMPLATE library. |
9e120d3c | 37 | |
9be49f18 JR |
38 | %description -l pl.UTF-8 |
39 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów | |
51635295 | 40 | używających biblioteki TEMPLATE. |
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 | 53 | %description devel -l pl.UTF-8 |
106d060c JB |
54 | Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu |
55 | używających biblioteki TEMPLATE. | |
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 | 63 | |
2800a261 JB |
64 | # or |
65 | dune build --verbose | |
66 | ||
9e120d3c MM |
67 | %install |
68 | rm -rf $RPM_BUILD_ROOT | |
59705d57 | 69 | |
846e7db4 ER |
70 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml |
71 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
72 | %{__make} install \ | |
73 | DESTDIR=$RPM_BUILD_ROOT | |
74 | ||
2800a261 JB |
75 | # or |
76 | dune install --destdir=$RPM_BUILD_ROOT | |
77 | ||
846e7db4 ER |
78 | #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
79 | #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
80 | ||
fa3b60ec JB |
81 | # cleanup after dune install |
82 | ## sources | |
83 | # %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/%{module}/*.ml | |
84 | ## packaged as %doc | |
85 | #%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc/%{module} | |
86 | ||
9e120d3c MM |
87 | %clean |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %files | |
91 | %defattr(644,root,root,755) | |
fa3b60ec | 92 | %doc CHANGES.md LICENSE.md README.md |
9e120d3c | 93 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so |
06bc3075 | 94 | %dir %{_libdir}/ocaml/%{module} |
59705d57 | 95 | %{_libdir}/ocaml/%{module}/META |
06bc3075 JB |
96 | %{_libdir}/ocaml/%{module}/*.cma |
97 | %if %{with ocaml_opt} | |
98 | %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs | |
99 | %endif | |
9e120d3c MM |
100 | |
101 | %files devel | |
102 | %defattr(644,root,root,755) | |
3bd9c7f5 | 103 | %{_libdir}/ocaml/%{module}/*.a |
06bc3075 | 104 | %{_libdir}/ocaml/%{module}/*.cmi |
846e7db4 | 105 | %{_libdir}/ocaml/%{module}/*.cmo |
faab622f JR |
106 | %{_libdir}/ocaml/%{module}/*.cmt |
107 | %{_libdir}/ocaml/%{module}/*.cmti | |
846e7db4 | 108 | %{_libdir}/ocaml/%{module}/*.mli |
86b3d4c5 | 109 | %if %{with ocaml_opt} |
3bd9c7f5 | 110 | %{_libdir}/ocaml/%{module}/*.o |
06bc3075 | 111 | %{_libdir}/ocaml/%{module}/*.cmx |
846e7db4 ER |
112 | %{_libdir}/ocaml/%{module}/*.cmxa |
113 | %endif | |
faab622f JR |
114 | %{_libdir}/ocaml/%{module}/dune-package |
115 | %{_libdir}/ocaml/%{module}/opam | |
9e120d3c | 116 | %{_examplesdir}/%{name}-%{version} |