]> git.pld-linux.org Git - projects/template-specs.git/blob - ocaml.spec
2970d1c93302eaa9fc57a67c06cd68fb3cbf630d
[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 używających
55 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 %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
87 %dir %{_libdir}/ocaml/%{module}
88 %{_libdir}/ocaml/%{module}/META
89 %{_libdir}/ocaml/%{module}/*.cma
90 %if %{with ocaml_opt}
91 %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs
92 %endif
93
94 %files devel
95 %defattr(644,root,root,755)
96 %doc LICENSE
97 %{_libdir}/ocaml/%{module}/*.cmi
98 %{_libdir}/ocaml/%{module}/*.cmo
99 %{_libdir}/ocaml/%{module}/*.cmt
100 %{_libdir}/ocaml/%{module}/*.cmti
101 %{_libdir}/ocaml/%{module}/*.mli
102 %if %{with ocaml_opt}
103 %{_libdir}/ocaml/%{module}/*.[ao]
104 %{_libdir}/ocaml/%{module}/*.cmx
105 %{_libdir}/ocaml/%{module}/*.cmxa
106 %endif
107 %{_libdir}/ocaml/%{module}/dune-package
108 %{_libdir}/ocaml/%{module}/opam
109 %{_examplesdir}/%{name}-%{version}
This page took 0.039571 seconds and 3 git commands to generate.