%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-bitmatch Version: 0.5 Release: 1%{?dist} Summary: OCaml library for matching and constructing bitstrings Group: Development/Libraries License: LGPLv2+ with exceptions URL: http://et.redhat.com/~rjones/bitmatch/ Source0: http://et.redhat.com/~rjones/bitmatch/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 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 -i Pa_bitmatch %description Bitmatch adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml. You can use this module to both parse and generate binary formats, for example, communications protocols, disk formats and binary files. %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 rm examples/.cvsignore %build ./configure --libdir=%{_libdir} make make doc %check make 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 make install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING.LIB %{_libdir}/ocaml/bitmatch %if %opt %exclude %{_libdir}/ocaml/bitmatch/*.a %exclude %{_libdir}/ocaml/bitmatch/*.cmxa %exclude %{_libdir}/ocaml/bitmatch/*.cmx %endif %exclude %{_libdir}/ocaml/bitmatch/*.mli %files devel %defattr(-,root,root,-) %doc COPYING.LIB README html examples %if %opt %{_libdir}/ocaml/bitmatch/*.a %{_libdir}/ocaml/bitmatch/*.cmxa %{_libdir}/ocaml/bitmatch/*.cmx %endif %{_libdir}/ocaml/bitmatch/*.mli %changelog * Fri Apr 25 2008 Richard W.M. Jones - 0.5-1 - New upstream release 0.5. * Fri Apr 16 2008 Richard W.M. Jones - 0.4-1 - New upstream release 0.4. * Fri Apr 2 2008 Richard W.M. Jones - 0.2-1 - Initial RPM release.