%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} %define mainversion 1.0 %define subversion alpha Name: ocaml-bisect Version: %{mainversion} Release: 0.1.%{subversion}%{?dist} Summary: OCaml code coverage tool Group: Development/Libraries License: GPLv3+ URL: http://bisect.x9c.fr/ Source0: http://bisect.x9c.fr/distrib/bisect-%{mainversion}-%{subversion}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch0: bisect-1.0-alpha-nojava.patch BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-camlp4-devel %define _use_internal_dependency_generator 0 %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh -i Asttypes -i Parsetree %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh %description Bisect is a code coverage tool for the Objective Caml language. It is a camlp4-based tool that allows to instrument your application before running tests. After application execution, it is possible to generate a report in HTML format that is the replica of the application source code annotated with code coverage information. %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 bisect-%{mainversion}-%{subversion} %patch0 -p1 %build make all %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/bisect install -m 0755 bin/bisect-report.opt \ $RPM_BUILD_ROOT%{_bindir}/bisect-report strip $RPM_BUILD_ROOT%{_bindir}/bisect-report install -m 0644 bin/*.{a,cmi,cma,cmx,cmxa} \ $RPM_BUILD_ROOT%{_libdir}/ocaml/bisect %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING %{_bindir}/bisect-report %{_libdir}/ocaml/bisect %if %opt %exclude %{_libdir}/ocaml/bisect/*.a %exclude %{_libdir}/ocaml/bisect/*.cmxa %exclude %{_libdir}/ocaml/bisect/*.cmx %endif %files devel %defattr(-,root,root,-) %doc CHANGES COPYING README VERSION doc/bisect.pdf ocamldoc %if %opt %{_libdir}/ocaml/bisect/*.a %{_libdir}/ocaml/bisect/*.cmxa %{_libdir}/ocaml/bisect/*.cmx %endif %changelog * Sun Aug 24 2008 Richard W.M. Jones - 1.0-0.1.alpha - Initial RPM release.