%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-xml-light Version: 2.2.cvs20070817 Release: 2%{?dist} Summary: Minimal XML parser and printer for OCaml Group: Development/Libraries License: LGPLv2+ URL: http://tech.motion-twin.com/xmllight.html Source0: xml-light-2.2.cvs20070817.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExcludeArch: ppc64 BuildRequires: ocaml, ocaml-findlib-devel, 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 Xml-Light is a minimal XML parser & printer for OCaml. It provides functions to parse an XML document into an OCaml data structure, work with it, and print it back to an XML document. It support also DTD parsing and checking, and is entirely written in OCaml, hence it does not require additional C library. %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 -c -q -n xml-light-%{version} %build make all doc %if %opt make opt %endif sed -e 's/@VERSION@/%{VERSION}/' < META.in > META %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 ocamlfind install xml-light META *.mli *.cmi *.cma *.a *.cmxa *.cmx %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README %{_libdir}/ocaml/xml-light %if %opt %exclude %{_libdir}/ocaml/xml-light/*.a %exclude %{_libdir}/ocaml/xml-light/*.cmxa %exclude %{_libdir}/ocaml/xml-light/*.cmx %endif %exclude %{_libdir}/ocaml/xml-light/*.mli %files devel %defattr(-,root,root,-) %doc README doc/* %if %opt %{_libdir}/ocaml/xml-light/*.a %{_libdir}/ocaml/xml-light/*.cmxa %{_libdir}/ocaml/xml-light/*.cmx %endif %{_libdir}/ocaml/xml-light/*.mli %changelog * Fri Aug 24 2007 Richard W.M. Jones - 2.2.cvs20070817-2 - Clarified that the license is LGPLv2+. * Fri Aug 17 2007 Richard W.M. Jones - 2.2.cvs20070817-1 - Initial RPM release.