]> git.pld-linux.org Git - projects/template-specs.git/blob - ocaml.spec
- update systemd scriptlets to use upstream macros and add user units
[projects/template-specs.git] / ocaml.spec
1 #
2 # Conditional build:
3 %bcond_without  ocaml_opt       # 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  TEMPLATE
11 Summary:        %{module} binding for OCaml
12 Summary(pl.UTF-8):      Wiązania %{module} dla OCamla
13 Name:           ocaml-%{module}
14 Version:        -
15 Release:        1
16 License:        - (enter GPL/LGPL/BSD/BSD-like/other license name here)
17 Group:          Libraries
18 Source0:        %{module}-%{version}.tar.gz
19 # Source0-md5:  -
20 URL:            -
21 #BuildRequires: -devel
22 BuildRequires:  ocaml >= 1:4.00
23 #BuildRequires: ocaml-dune
24 %requires_eq    ocaml-runtime
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         debug_package   %{nil}
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
33
34 %description
35 This package contains files needed to run bytecode executables using
36 TEMPLATE library.
37
38 %description -l pl.UTF-8
39 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
40 używających biblioteki TEMPLATE.
41
42 %package devel
43 Summary:        TEMPLATE binding for OCaml - development part
44 Summary(pl.UTF-8):      Wiązania TEMPLATE dla OCamla - cześć programistyczna
45 Group:          Development/Libraries
46 Requires:       %{name} = %{version}-%{release}
47 %requires_eq    ocaml
48
49 %description devel
50 This package contains files needed to develop OCaml programs using
51 TEMPLATE library.
52
53 %description devel -l pl.UTF-8
54 Pakiet ten zawiera pliki niezbędne do tworzenia programów w OCamlu
55 używających biblioteki TEMPLATE.
56
57 %prep
58 %setup -q -n %{module}-%{version}
59
60 %build
61 %{__make} -j1 all %{?with_ocaml_opt:opt} \
62         CC="%{__cc} %{rpmcflags} -fPIC"
63
64 # or
65 dune build --verbose
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69
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
75 # or
76 dune install --destdir=$RPM_BUILD_ROOT
77
78 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
79 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
80
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
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %files
91 %defattr(644,root,root,755)
92 %doc CHANGES.md LICENSE.md README.md
93 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
94 %dir %{_libdir}/ocaml/%{module}
95 %{_libdir}/ocaml/%{module}/META
96 %{_libdir}/ocaml/%{module}/*.cma
97 %if %{with ocaml_opt}
98 %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs
99 %endif
100
101 %files devel
102 %defattr(644,root,root,755)
103 %{_libdir}/ocaml/%{module}/*.a
104 %{_libdir}/ocaml/%{module}/*.cmi
105 %{_libdir}/ocaml/%{module}/*.cmo
106 %{_libdir}/ocaml/%{module}/*.cmt
107 %{_libdir}/ocaml/%{module}/*.cmti
108 %{_libdir}/ocaml/%{module}/*.mli
109 %if %{with ocaml_opt}
110 %{_libdir}/ocaml/%{module}/*.o
111 %{_libdir}/ocaml/%{module}/*.cmx
112 %{_libdir}/ocaml/%{module}/*.cmxa
113 %endif
114 %{_libdir}/ocaml/%{module}/dune-package
115 %{_libdir}/ocaml/%{module}/opam
116 %{_examplesdir}/%{name}-%{version}
This page took 0.054099 seconds and 3 git commands to generate.