]>
Commit | Line | Data |
---|---|---|
d5b28b2d JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) | |
4 | ||
5 | # not yet available on x32 (ocaml 4.02.1), update when upstream will support it | |
6 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 | |
7 | %undefine with_ocaml_opt | |
8 | %endif | |
9 | ||
10 | %define module dune | |
11 | Summary: A composable build system for OCaml | |
12 | Name: ocaml-%{module} | |
5a04a328 | 13 | Version: 2.8.4 |
12178e23 | 14 | Release: 2 |
d5b28b2d JR |
15 | License: MIT |
16 | Group: Libraries | |
17 | Source0: https://github.com/ocaml/dune/archive/%{version}/%{module}-%{version}.tar.gz | |
5a04a328 | 18 | # Source0-md5: 68fbc294aeed510425d20498225d416b |
d5b28b2d JR |
19 | URL: https://github.com/ocaml/dune |
20 | BuildRequires: ocaml >= 3.04-7 | |
12178e23 | 21 | BuildRequires: ocaml-csexp |
d5b28b2d JR |
22 | %requires_eq ocaml-runtime |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
d5b28b2d JR |
25 | %if %{without ocaml_opt} |
26 | %define no_install_post_strip 1 | |
27 | # no opt means no native binary, stripping bytecode breaks such programs | |
28 | %define _enable_debug_packages 0 | |
29 | %endif | |
30 | ||
31 | %description | |
85cc6715 JR |
32 | Dune is a build system designed for OCaml/Reason projects only. It |
33 | focuses on providing the user with a consistent experience and takes | |
34 | care of most of the low-level details of OCaml compilation. All you | |
35 | have to do is provide a description of your project and dune will do | |
36 | the rest. | |
d5b28b2d | 37 | |
12178e23 JR |
38 | %package devel |
39 | Summary: Development files for dune | |
40 | Requires: %{name} = %{version}-%{release} | |
41 | Requires: ocaml-csexp-devel | |
42 | ||
43 | %description devel | |
44 | This package contains libraries and signature files for developing | |
45 | applications that use dune. | |
46 | ||
d5b28b2d JR |
47 | %prep |
48 | %setup -q -n %{module}-%{version} | |
d5b28b2d JR |
49 | |
50 | %build | |
5a04a328 JR |
51 | ./configure \ |
52 | --libdir %{_libdir}/ocaml \ | |
53 | --mandir %{_mandir} | |
d5b28b2d | 54 | |
5a04a328 | 55 | %{__make} release \ |
d5b28b2d JR |
56 | CC="%{__cc} %{rpmcflags} -fPIC" |
57 | ||
12178e23 JR |
58 | ./dune.exe build @install |
59 | ||
5a04a328 JR |
60 | %{__make} doc |
61 | ||
12178e23 JR |
62 | # Relink the stublibs. See https://github.com/ocaml/dune/issues/2977. |
63 | cd _build/default/src/stdune | |
64 | ocamlmklib -g -ldopt "%{rpmldflags}" -o stdune_stubs fcntl_stubs.o | |
65 | cd - | |
66 | cd _build/default/src/dune_filesystem_stubs | |
67 | ocamlmklib -g -ldopt "%{rpmldflags}" -o dune_filesystem_stubs_stubs \ | |
68 | $(ar t libdune_filesystem_stubs_stubs.a) | |
69 | ||
d5b28b2d JR |
70 | %install |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %{__make} install \ | |
74 | DESTDIR=$RPM_BUILD_ROOT | |
75 | ||
12178e23 JR |
76 | # "make install" only installs the binary. We want the libraries, too. |
77 | ./dune.exe install --destdir $RPM_BUILD_ROOT | |
78 | ||
d5b28b2d JR |
79 | %clean |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %files | |
83 | %defattr(644,root,root,755) | |
12178e23 | 84 | %doc LICENSE.md CHANGES.md README.md MIGRATION.md doc/_build/* |
d5b28b2d | 85 | %attr(755,root,root) %{_bindir}/dune |
12178e23 JR |
86 | %dir %{_libdir}/ocaml/dune |
87 | %dir %{_libdir}/ocaml/dune-action-plugin | |
88 | %dir %{_libdir}/ocaml/dune-build-info | |
89 | %dir %{_libdir}/ocaml/dune-configurator | |
90 | %dir %{_libdir}/ocaml/dune-glob | |
91 | %dir %{_libdir}/ocaml/dune-private-libs | |
92 | %dir %{_libdir}/ocaml/dune-private-libs/dune-lang | |
93 | %dir %{_libdir}/ocaml/dune-private-libs/dune_re | |
94 | %dir %{_libdir}/ocaml/dune-private-libs/ocaml-config | |
95 | %dir %{_libdir}/ocaml/dune-private-libs/stdune | |
96 | %dir %{_libdir}/ocaml/dune-site | |
97 | %dir %{_libdir}/ocaml/dune-site/plugins | |
98 | %{_libdir}/ocaml/dune*/META | |
99 | %{_libdir}/ocaml/dune*/*.cma | |
100 | %{_libdir}/ocaml/dune*/*.cmi | |
101 | %{_libdir}/ocaml/dune-configurator/.private | |
102 | %{_libdir}/ocaml/dune-private-libs/*/*.cma | |
103 | %{_libdir}/ocaml/dune-private-libs/*/*.cmi | |
104 | %{_libdir}/ocaml/dune-site/*/*.cma | |
105 | %{_libdir}/ocaml/dune-site/*/*.cmi | |
106 | %if %{with ocaml_opt} | |
107 | %{_libdir}/ocaml/dune*/*.a | |
108 | %{_libdir}/ocaml/dune*/*.cmx | |
109 | %{_libdir}/ocaml/dune*/*.cmxa | |
110 | %{_libdir}/ocaml/dune*/*.cmxs | |
111 | %{_libdir}/ocaml/dune-private-libs/*/*.a | |
112 | %{_libdir}/ocaml/dune-private-libs/*/*.cmx | |
113 | %{_libdir}/ocaml/dune-private-libs/*/*.cmxa | |
114 | %{_libdir}/ocaml/dune-private-libs/*/*.cmxs | |
115 | %{_libdir}/ocaml/dune-site/*/*.cmx | |
116 | %{_libdir}/ocaml/dune-site/*/*.a | |
117 | %{_libdir}/ocaml/dune-site/*/*.cmxa | |
118 | %{_libdir}/ocaml/dune-site/*/*.cmxs | |
119 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllstdune_stubs.so | |
120 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dlldune_filesystem_stubs_stubs.so | |
121 | %endif | |
d5b28b2d JR |
122 | %{_mandir}/man1/dune*.1* |
123 | %{_mandir}/man5/dune*.5* | |
12178e23 JR |
124 | |
125 | %files devel | |
126 | %defattr(644,root,root,755) | |
127 | %{_libdir}/ocaml/dune*/dune-package | |
128 | %{_libdir}/ocaml/dune*/opam | |
129 | %{_libdir}/ocaml/dune*/*.cmt | |
130 | %{_libdir}/ocaml/dune*/*.cmti | |
131 | %{_libdir}/ocaml/dune*/*.ml | |
132 | %{_libdir}/ocaml/dune*/*.mli | |
133 | %{_libdir}/ocaml/dune-private-libs/*/*.cmt | |
134 | %{_libdir}/ocaml/dune-private-libs/*/*.cmti | |
135 | %{_libdir}/ocaml/dune-private-libs/*/*.ml | |
136 | %{_libdir}/ocaml/dune-private-libs/*/*.mli | |
137 | %{_libdir}/ocaml/dune-site/*/*.cmt | |
138 | %{_libdir}/ocaml/dune-site/*/*.cmti | |
139 | %{_libdir}/ocaml/dune-site/*/*.ml | |
140 | %{_libdir}/ocaml/dune-site/*/*.mli | |
141 | %ifarch %{ocaml_native_compiler} | |
142 | %{_libdir}/ocaml/dune*/*.a | |
143 | %{_libdir}/ocaml/dune*/*.cmx | |
144 | %{_libdir}/ocaml/dune*/*.cmxa | |
145 | %{_libdir}/ocaml/dune-private-libs/*/*.a | |
146 | %{_libdir}/ocaml/dune-private-libs/*/*.cmx | |
147 | %{_libdir}/ocaml/dune-private-libs/*/*.cmxa | |
148 | %{_libdir}/ocaml/dune-site/*/*.a | |
149 | %{_libdir}/ocaml/dune-site/*/*.cmx | |
150 | %{_libdir}/ocaml/dune-site/*/*.cmxa | |
151 | %endif |