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