]> git.pld-linux.org Git - projects/template-specs.git/blob - ocaml.spec
- added setting wrt ocaml opt
[projects/template-specs.git] / ocaml.spec
1 #
2 # Conditional build:
3 %bcond_without  ocaml_opt               # build opt
4
5 %ifarch x32
6 %undefine▸      with_opt
7 %endif
8
9 %if %{without ocaml_opt}
10 %define▸▸       no_install_post_strip▸  1
11 # no opt means no native binary, stripping bytecode breaks such programs
12 %define▸▸       _enable_debug_packages▸ 0
13 %endif
14
15 %define         module  %{module}
16 Summary:        %{module} binding for OCaml
17 Summary(pl.UTF-8):      Wiązania %{module} dla OCamla
18 Name:           ocaml-%{module}
19 Version:        -
20 Release:        1
21 License:        - (enter GPL/LGPL/BSD/BSD-like/other license name here)
22 Group:          Libraries
23 Source0:        %{module}-%{version}.tar.gz
24 URL:            -
25 # Source0-md5:  -
26 #BuildRequires: -devel
27 BuildRequires:  ocaml >= 3.04-7
28 %requires_eq    ocaml-runtime
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         debug_package   %{nil}
32
33 %description
34 This package contains files needed to run bytecode executables using
35 this library.
36
37 %description -l pl.UTF-8
38 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
39 używających tej biblioteki.
40
41 %package devel
42 Summary:        TEMPLATE binding for OCaml - development part
43 Summary(pl.UTF-8):      Wiązania TEMPLATE dla OCamla - cześć programistyczna
44 Group:          Development/Libraries
45 Requires:       %{name} = %{version}-%{release}
46 %requires_eq    ocaml
47
48 %description devel
49 This package contains files needed to develop OCaml programs using
50 TEMPLATE library.
51
52 %description devel -l pl.UTF-8
53 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
54 TEMPLATE biblioteki.
55
56 %prep
57 %setup -q -n %{module}-%{version}
58
59 %build
60 %{__make} -j1 all %{?with_ocaml_opt:opt} \
61         CC="%{__cc} %{rpmcflags} -fPIC"
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
66 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
67 %{__make} install \
68         DESTDIR=$RPM_BUILD_ROOT
69
70 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
71 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
72
73 # move to dir pld ocamlfind looks
74 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
75 mv $OCAMLFIND_DESTDIR/%{module}/META \
76         $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
77 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
78 directory="+%{module}"
79 EOF
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
88 %files devel
89 %defattr(644,root,root,755)
90 %doc LICENSE
91 %{_libdir}/ocaml/%{module}/*.cm[xi]
92 %{_libdir}/ocaml/%{module}/*.cmo
93 %{_libdir}/ocaml/%{module}/*.mli
94 %if %{with ocaml_opt}
95 %{_libdir}/ocaml/%{module}/*.[ao]
96 %{_libdir}/ocaml/%{module}/*.cmxa
97 %endif
98 %{_libdir}/ocaml/site-lib/%{module}
99 %{_examplesdir}/%{name}-%{version}
This page took 0.058551 seconds and 4 git commands to generate.