%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} %define ocaml_major 3.10 %define ocaml_minor 2 Name: ocaml-cmigrep Version: 1.5 Release: 2%{?dist} Summary: Search OCaml compiled interface (cmi) files Group: Development/Libraries License: GPLv2+ URL: http://homepage.mac.com/letaris/ Source0: http://homepage.mac.com/letaris/cmigrep-%{version}.tar.bz2 Source1: http://caml.inria.fr/distrib/ocaml-%{ocaml_major}/ocaml-%{ocaml_major}.%{ocaml_minor}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch0: cmigrep-make-without-godi-debian.patch Patch1: ocaml-3.10.1-ppc64.patch Patch2: ocaml-3.10.1-map32bit.patch Patch3: ocaml-3.11-dev12-no-executable-stack.patch BuildRequires: ocaml = %{ocaml_major}.%{ocaml_minor} BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-pcre-devel BuildRequires: ocaml-ocamldoc %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 A utility to mine the data in Caml compiled interface (cmi) files, and elisp that allows emacs to use cmigrep for completion. %prep %setup -q -n cmigrep-%{version} %patch0 -p1 # Unpack OCaml sources into compiler/ subdirectory. # XXX On Debian the compiled compiler libs are shipped in a # +compiler-libs directory. It would be good to copy this, # however in Debian the only packages which actually use # compiler-libs are camlp5 & cmigrep. bzcat %{SOURCE1} | tar xf - pushd ocaml-%{ocaml_major}.%{ocaml_minor} %patch1 -p1 %patch2 -p1 %patch3 -p0 popd mv ocaml-%{ocaml_major}.%{ocaml_minor} compiler %build # Build the compiler libs. pushd compiler CFLAGS="$RPM_OPT_FLAGS" ./configure \ -bindir %{_bindir} \ -libdir %{_libdir}/ocaml \ -x11lib %{_libdir} \ -x11include %{_includedir} \ -mandir %{_mandir}/man1 make world %if %opt make opt.opt %endif popd # Build cmigrep itself. make byte %if %opt make all %endif strip cmigrep %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} install -m 0755 cmigrep $RPM_BUILD_ROOT%{_bindir} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc GPL README cmigrep.el %{_bindir}/cmigrep %changelog * Mon Jun 9 2008 Richard W.M. Jones - 1.5-2 - Include ppc64 compiler patch. - Include MAP_32BITS compiler patch. - Include no-executable-stack compiler patch. - Rebuild for OCaml 3.10.2-4 (https://bugzilla.redhat.com/show_bug.cgi?id=444428#c5) * Mon Apr 28 2008 Richard W.M. Jones - 1.5-1 - Initial RPM release.