%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-fieldslib Version: 109.20.02 Release: 1%{?dist} Summary: Syntax extension for record fields. Group: Development/Libraries License: Apache Software License 2.0 URL: https://github.com/janestreet/fieldslib Source0: https://ocaml.janestreet.com/ocaml-core/%{version}/individual/fieldslib-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExcludeArch: sparc64 s390 s390x BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-camlp4-devel BuildRequires: ocaml-type-conv >= 109.53.02 %define _use_internal_dependency_generator 0 %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh %description This library defines a syntax extension for OCaml using Camlp4 that can be used to define first class values representing record fields, and additional routines, to get and set record fields, iterate and fold over all fields of a record and create new record values. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. %prep %setup -q -n fieldslib-%{version} ocaml setup.ml -configure --prefix %{_prefix} \ --libdir %{_libdir} \ --libexecdir %{_libexecdir} \ --exec-prefix %{_exec_prefix} \ --bindir %{_bindir} \ --sbindir %{_sbindir} \ --mandir %{_mandir} \ --datadir %{_datadir} \ --localstatedir %{_localstatedir} \ --sharedstatedir %{_sharedstatedir} \ --destdir $RPM_BUILD_ROOT %build ocaml setup.ml -build %check ocaml setup.ml -test %install rm -rf $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs ocaml setup.ml -install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE.txt THIRD-PARTY.txt INRIA-DISCLAIMER.txt %{_libdir}/ocaml/fieldslib %if %opt %exclude %{_libdir}/ocaml/fieldslib/*.a %exclude %{_libdir}/ocaml/fieldslib/*.cmxa %endif %exclude %{_libdir}/ocaml/fieldslib/*.mli %files devel %defattr(-,root,root,-) %doc LICENSE.txt THIRD-PARTY.txt INRIA-DISCLAIMER.txt README.txt %if %opt %{_libdir}/ocaml/fieldslib/*.a %{_libdir}/ocaml/fieldslib/*.cmxa %endif %{_libdir}/ocaml/fieldslib/*.mli %changelog * Wed Jan 01 2014 Edvard Fagerholm - 109.20.02-1 - Initial package for Fedora 20