%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-json-wheel Version: 1.0.4 Release: 4%{?dist} Summary: OCaml library for parsing JSON Group: Development/Libraries License: BSD URL: http://martin.jambon.free.fr/json-wheel.html Source0: http://martin.jambon.free.fr/json-wheel-%{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-ocamlnet-devel BuildRequires: ocaml-pcre-devel BuildRequires: 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 %description JSON library for OCaml following RFC 4627. If you use this library, consider installing ocaml-json-static, the syntax extension to the language which makes using JSON much easier. %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 json-wheel-%{version} %build make strip jsoncat %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 mkdir -p $RPM_BUILD_ROOT%{_bindir} make BINDIR=$RPM_BUILD_ROOT%{_bindir} install # Remove *.cmo and *.o files. These aren't needed for # anything because they are included in the *.cma/*.a. rm $RPM_BUILD_ROOT%{_libdir}/ocaml/json-wheel/*.cmo rm $RPM_BUILD_ROOT%{_libdir}/ocaml/json-wheel/*.o %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE %{_libdir}/ocaml/json-wheel %if %opt %exclude %{_libdir}/ocaml/json-wheel/*.a %exclude %{_libdir}/ocaml/json-wheel/*.cmxa %exclude %{_libdir}/ocaml/json-wheel/*.cmx %endif %exclude %{_libdir}/ocaml/json-wheel/*.mli %exclude %{_libdir}/ocaml/json-wheel/*.ml %{_bindir}/jsoncat %files devel %defattr(-,root,root,-) %doc LICENSE Changes README html %if %opt %{_libdir}/ocaml/json-wheel/*.a %{_libdir}/ocaml/json-wheel/*.cmxa %{_libdir}/ocaml/json-wheel/*.cmx %endif %{_libdir}/ocaml/json-wheel/*.mli %{_libdir}/ocaml/json-wheel/*.ml %changelog * Wed Mar 5 2008 Richard W.M. Jones - 1.0.4-4 - Remove ExcludeArch ppc64. * Wed Mar 5 2008 Richard W.M. Jones - 1.0.4-3 - Don't distribute the *.cmo and *.o files. - Better way to install jsoncat in the right directory. * Sat Mar 1 2008 Richard W.M. Jones - 1.0.4-2 - Missing BR ocaml-pcre-devel. - Missing BR pcre-devel. * Thu Feb 28 2008 Richard W.M. Jones - 1.0.4-1 - Initial RPM release.