]> git.pld-linux.org Git - projects/template-specs.git/blobdiff - ocaml.spec
pecl: add example how to make failed tests as XFAIL
[projects/template-specs.git] / ocaml.spec
index b3d5878f960443a89d730caaf516b32d74a72f09..41a410f91a47ab41ff7340b019e7d81ca4086cb3 100644 (file)
@@ -1,24 +1,42 @@
-Summary:       TEMPLATE binding for OCaml
-Summary(pl.UTF-8):     Wiązania TEMPLATE dla OCamla
-Name:          ocaml-template
-Version:
+#
+# Conditional build:
+%bcond_without ocaml_opt       # skip building native optimized binaries (bytecode is always built)
+
+# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
+%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
+%undefine      with_ocaml_opt
+%endif
+
+%define                module  %{module}
+Summary:       %{module} binding for OCaml
+Summary(pl.UTF-8):     Wiązania %{module} dla OCamla
+Name:          ocaml-%{module}
+Version:       -
 Release:       1
-License:
+License:       - (enter GPL/LGPL/BSD/BSD-like/other license name here)
 Group:         Libraries
-Vendor:
-Source0:       template-%{version}.tar.gz
-BuildRequires: -devel
+Source0:       %{module}-%{version}.tar.gz
+URL:           -
+# Source0-md5: -
+#BuildRequires:        -devel
 BuildRequires: ocaml >= 3.04-7
 %requires_eq   ocaml-runtime
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                debug_package   %{nil}
+%if %{without ocaml_opt}
+%define                no_install_post_strip   1
+# no opt means no native binary, stripping bytecode breaks such programs
+%define                _enable_debug_packages  0
+%endif
+
 %description
 This package contains files needed to run bytecode executables using
-this library.
+TEMPLATE library.
 
 %description -l pl.UTF-8
 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
-używających tej biblioteki.
+używających biblioteki TEMPLATE.
 
 %package devel
 Summary:       TEMPLATE binding for OCaml - development part
@@ -29,36 +47,35 @@ Requires:   %{name} = %{version}-%{release}
 
 %description devel
 This package contains files needed to develop OCaml programs using
-this library.
+TEMPLATE library.
 
 %description devel -l pl.UTF-8
 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
-tej biblioteki.
+biblioteki TEMPLATE.
 
 %prep
-%setup -q -n template-%{version}
+%setup -q -n %{module}-%{version}
 
 %build
-%{__make} CC="%{__cc} %{rpmcflags} -fPIC" all opt
+%{__make} -j1 all %{?with_ocaml_opt:opt} \
+       CC="%{__cc} %{rpmcflags} -fPIC"
 
 %install
 rm -rf $RPM_BUILD_ROOT
+export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
+install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+#install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+#cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/{template,stublibs}
-install *.cm[ixa]* *.a dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/template
-install dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
-
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/template
-cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/template/META <<EOF
-requires = ""
-version = "%{version}"
-directory = "+template"
-archive(byte) = "template.cma"
-archive(native) = "template.cmxa"
-linkopts = ""
+# move to dir pld ocamlfind looks
+install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
+mv $OCAMLFIND_DESTDIR/%{module}/META \
+       $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
+cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
+directory="+%{module}"
 EOF
 
 %clean
@@ -67,12 +84,22 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
+%dir %{_libdir}/ocaml/%{module}
+%{_libdir}/ocaml/%{module}/*.cma
+%if %{with ocaml_opt}
+%attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs
+%endif
 
 %files devel
 %defattr(644,root,root,755)
-%doc LICENSE *.mli
-%dir %{_libdir}/ocaml/template
-%{_libdir}/ocaml/template/*.cm[ixa]*
-%{_libdir}/ocaml/template/*.a
+%doc LICENSE
+%{_libdir}/ocaml/%{module}/*.cmi
+%{_libdir}/ocaml/%{module}/*.cmo
+%{_libdir}/ocaml/%{module}/*.mli
+%if %{with ocaml_opt}
+%{_libdir}/ocaml/%{module}/*.[ao]
+%{_libdir}/ocaml/%{module}/*.cmx
+%{_libdir}/ocaml/%{module}/*.cmxa
+%endif
+%{_libdir}/ocaml/site-lib/%{module}
 %{_examplesdir}/%{name}-%{version}
-%{_libdir}/ocaml/site-lib/template
This page took 0.058219 seconds and 4 git commands to generate.