%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-mikmatch Version: 1.0.0 Release: 1%{?dist} Summary: OCaml extension for pattern matching with regexps Group: Development/Libraries License: BSD URL: http://martin.jambon.free.fr/micmatch.html Source0: http://martin.jambon.free.fr/mikmatch-%{version}.tar.bz2 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 BuildRequires: ocaml-pcre-devel %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 -i Charset -i Constants -i Global_def -i Match -i Messages -i Mm_util -i Pa_mikmatch_pcre -i Pa_mikmatch_str -i Pcre_lib -i Regexp_ast -i Select_lib -i Str_lib -i Syntax_common -i Syntax_pcre -i Syntax_str %description Mikmatch (with a 'k') is the OCaml >= 3.10 version of Micmatch, an extension for adding pattern matching with regular expressions to the language. The goal of Micmatch/Mikmatch is to make text-oriented programs even easier to write, read and run without losing the unique and powerful features of Objective Caml (OCaml). Micmatch/Mikmatch provides a concise and highly readable syntax for regular expressions, and integrates it into the syntax of OCaml thanks to Camlp4. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pcre-devel %description devel The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. %prep %setup -q -n mikmatch-%{version} %build make all str pcre %if %opt make opt %endif %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-str install-pcre %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE %{_libdir}/ocaml/mikmatch_str %{_libdir}/ocaml/mikmatch_pcre %if %opt %exclude %{_libdir}/ocaml/mikmatch_str/*.a %exclude %{_libdir}/ocaml/mikmatch_str/*.cmxa %exclude %{_libdir}/ocaml/mikmatch_str/*.cmx %exclude %{_libdir}/ocaml/mikmatch_pcre/*.a %exclude %{_libdir}/ocaml/mikmatch_pcre/*.cmxa %exclude %{_libdir}/ocaml/mikmatch_pcre/*.cmx %endif %exclude %{_libdir}/ocaml/mikmatch_str/*.mli %exclude %{_libdir}/ocaml/mikmatch_pcre/*.mli %files devel %defattr(-,root,root,-) %doc LICENSE README %if %opt %{_libdir}/ocaml/mikmatch_str/*.a %{_libdir}/ocaml/mikmatch_str/*.cmxa %{_libdir}/ocaml/mikmatch_str/*.cmx %{_libdir}/ocaml/mikmatch_pcre/*.a %{_libdir}/ocaml/mikmatch_pcre/*.cmxa %{_libdir}/ocaml/mikmatch_pcre/*.cmx %endif %{_libdir}/ocaml/mikmatch_str/*.mli %{_libdir}/ocaml/mikmatch_pcre/*.mli %changelog * Mon Jul 28 2008 Richard W.M. Jones - 1.0.0-1 - Initial RPM release.