3b4ee94
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
3b4ee94
%define debug_package %{nil}
3b4ee94
3b4ee94
Name:           ocaml-sexplib
3b4ee94
Version:        3.7.4
a723a3a
Release:        3%{?dist}
3b4ee94
Summary:        OCaml library for converting OCaml values to S-expressions
3b4ee94
3b4ee94
Group:          Development/Libraries
3b4ee94
License:        LGPLv2+ with exceptions and BSD
3b4ee94
URL:            http://www.ocaml.info/home/ocaml_sources.html#sexplib310
3b4ee94
Source0:        http://www.ocaml.info/ocaml_sources/sexplib310-%{version}.tar.bz2
3b4ee94
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3b4ee94
a723a3a
ExcludeArch:    ppc64
a723a3a
3b4ee94
BuildRequires:  ocaml >= 3.10.0
3b4ee94
BuildRequires:  ocaml-findlib-devel
3b4ee94
BuildRequires:  ocaml-ocamldoc
3b4ee94
BuildRequires:  ocaml-type-conv >= 1.5.0
3b4ee94
BuildRequires:  ocaml-camlp4-devel
3b4ee94
BuildRequires:  dos2unix
3b4ee94
3b4ee94
%define _use_internal_dependency_generator 0
3b4ee94
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
3b4ee94
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
3b4ee94
3b4ee94
3b4ee94
%description
3b4ee94
This library contains functionality for parsing and pretty-printing
3b4ee94
S-expressions. In addition to that it contains an extremely useful
3b4ee94
preprocessing module for Camlp4, which can be used to automatically
3b4ee94
generate code from type definitions for efficiently converting
3b4ee94
OCaml-values to S-expressions and vice versa. In combination with the
3b4ee94
parsing and pretty-printing functionality this frees users from having
3b4ee94
to write their own I/O-routines for datastructures they
3b4ee94
define. Possible errors during automatic conversions from
3b4ee94
S-expressions to OCaml-values are reported in a very human-readable
3b4ee94
way. Another module in the library allows you to extract and replace
3b4ee94
sub-expressions in S-expressions.
3b4ee94
3b4ee94
3b4ee94
%package        devel
3b4ee94
Summary:        Development files for %{name}
3b4ee94
Group:          Development/Libraries
3b4ee94
Requires:       %{name} = %{version}-%{release}
3b4ee94
3b4ee94
3b4ee94
%description    devel
3b4ee94
The %{name}-devel package contains libraries and signature files for
3b4ee94
developing applications that use %{name}.
3b4ee94
3b4ee94
3b4ee94
%prep
3b4ee94
%setup -q -n sexplib310-%{version}
3b4ee94
dos2unix LICENSE.Tywith
3b4ee94
3b4ee94
3b4ee94
%build
3b4ee94
make
3b4ee94
3b4ee94
3b4ee94
%check
3b4ee94
./lib_test/conv_test
3b4ee94
./lib_test/sexp_test < lib_test/test.sexp
3b4ee94
3b4ee94
3b4ee94
%install
3b4ee94
rm -rf $RPM_BUILD_ROOT
3b4ee94
export DESTDIR=$RPM_BUILD_ROOT
3b4ee94
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
3b4ee94
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
3b4ee94
make install
3b4ee94
3b4ee94
3b4ee94
%clean
3b4ee94
rm -rf $RPM_BUILD_ROOT
3b4ee94
3b4ee94
3b4ee94
%files
3b4ee94
%defattr(-,root,root,-)
3b4ee94
%doc LICENSE LICENSE.Tywith
3b4ee94
%{_libdir}/ocaml/sexplib
3b4ee94
%if %opt
3b4ee94
%exclude %{_libdir}/ocaml/sexplib/*.a
3b4ee94
%exclude %{_libdir}/ocaml/sexplib/*.cmxa
3b4ee94
%endif
3b4ee94
%exclude %{_libdir}/ocaml/sexplib/*.mli
3b4ee94
3b4ee94
3b4ee94
%files devel
3b4ee94
%defattr(-,root,root,-)
3b4ee94
%doc LICENSE LICENSE.Tywith CHANGES COPYRIGHT README.txt VERSION
3b4ee94
%if %opt
3b4ee94
%{_libdir}/ocaml/sexplib/*.a
3b4ee94
%{_libdir}/ocaml/sexplib/*.cmxa
3b4ee94
%endif
3b4ee94
%{_libdir}/ocaml/sexplib/*.mli
3b4ee94
3b4ee94
3b4ee94
%changelog
a723a3a
* Mon May 12 2008 Richard W.M. Jones <rjones@redhat.com> - 3.7.4-3
a723a3a
- ExcludeArch ppc64 (only for F-8).
a723a3a
a723a3a
* Mon May 12 2008 Richard W.M. Jones <rjones@redhat.com> - 3.7.4-2
3b4ee94
- Added BR ocaml-camlp4-devel.
3b4ee94
- Added a check section to run the included tests.
3b4ee94
3b4ee94
* Sat May  3 2008 Richard W.M. Jones <rjones@redhat.com> - 3.7.4-1
3b4ee94
- New upstream version 3.7.4.
3b4ee94
3b4ee94
* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 3.7.1-1
3b4ee94
- New upstream version 3.7.1.
3b4ee94
- Fixed upstream URL.
3b4ee94
- Depend on latest type-conv.
3b4ee94
3b4ee94
* Wed Mar  5 2008 Richard W.M. Jones <rjones@redhat.com> - 3.5.0-2
3b4ee94
- Remove ExcludeArch ppc64.
3b4ee94
3b4ee94
* Sun Feb 24 2008 Richard W.M. Jones <rjones@redhat.com> - 3.5.0-1
3b4ee94
- Initial RPM release.