]> git.pld-linux.org Git - projects/template-specs.git/blob - ocaml.spec
0b956e1fd56ca8e4964d9042ded6ff354e54e9b1
[projects/template-specs.git] / ocaml.spec
1 #
2 # Conditional build:
3 %bcond_without  ocaml_opt               # build opt
4
5 %ifarch x32
6 # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
7 %undefine▸      with_ocaml_opt
8 %endif
9
10 %if %{without ocaml_opt}
11 %define▸▸       no_install_post_strip▸  1
12 # no opt means no native binary, stripping bytecode breaks such programs
13 %define▸▸       _enable_debug_packages▸ 0
14 %endif
15
16 %define         module  %{module}
17 Summary:        %{module} binding for OCaml
18 Summary(pl.UTF-8):      Wiązania %{module} dla OCamla
19 Name:           ocaml-%{module}
20 Version:        -
21 Release:        1
22 License:        - (enter GPL/LGPL/BSD/BSD-like/other license name here)
23 Group:          Libraries
24 Source0:        %{module}-%{version}.tar.gz
25 URL:            -
26 # Source0-md5:  -
27 #BuildRequires: -devel
28 BuildRequires:  ocaml >= 3.04-7
29 %requires_eq    ocaml-runtime
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         debug_package   %{nil}
33
34 %description
35 This package contains files needed to run bytecode executables using
36 this library.
37
38 %description -l pl.UTF-8
39 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
40 używających tej biblioteki.
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 TEMPLATE biblioteki.
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 %install
65 rm -rf $RPM_BUILD_ROOT
66 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
67 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
68 %{__make} install \
69         DESTDIR=$RPM_BUILD_ROOT
70
71 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
72 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
73
74 # move to dir pld ocamlfind looks
75 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
76 mv $OCAMLFIND_DESTDIR/%{module}/META \
77         $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
78 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
79 directory="+%{module}"
80 EOF
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %files
86 %defattr(644,root,root,755)
87 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
88
89 %files devel
90 %defattr(644,root,root,755)
91 %doc LICENSE
92 %{_libdir}/ocaml/%{module}/*.cm[xi]
93 %{_libdir}/ocaml/%{module}/*.cmo
94 %{_libdir}/ocaml/%{module}/*.mli
95 %if %{with ocaml_opt}
96 %{_libdir}/ocaml/%{module}/*.[ao]
97 %{_libdir}/ocaml/%{module}/*.cmxa
98 %endif
99 %{_libdir}/ocaml/site-lib/%{module}
100 %{_examplesdir}/%{name}-%{version}
This page took 0.051005 seconds and 3 git commands to generate.