3c25bf
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
3c25bf
%global debug_package %{nil}
3c25bf
3c25bf
Name:           ocaml-csv
3c25bf
Version:        1.2.3
3c25bf
Release:        8%{?dist}
3c25bf
Summary:        OCaml library for reading and writing CSV files
3c25bf
3c25bf
License:        LGPLv2+
3c25bf
URL:            https://forge.ocamlcore.org/projects/csv/
3c25bf
Source0:        https://forge.ocamlcore.org/frs/download.php/978/csv-%{version}.tar.gz
3c25bf
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3c25bf
3c25bf
ExcludeArch:    s390
3c25bf
3c25bf
BuildRequires:  ocaml >= 4.00.1
3c25bf
BuildRequires:  ocaml-ocamlbuild
3c25bf
BuildRequires:  ocaml-ocamldoc
3c25bf
BuildRequires:  ocaml-findlib-devel >= 1.3.3-3
3c25bf
BuildRequires:  ocaml-extlib-devel >= 1.5.3-2
3c25bf
BuildRequires:  gawk
3c25bf
3c25bf
3c25bf
%description
3c25bf
This OCaml library can read and write CSV files, including all
3c25bf
extensions used by Excel - eg. quotes, newlines, 8 bit characters in
3c25bf
fields, quote-0 etc.
3c25bf
3c25bf
The library comes with a handy command line tool called csvtool for
3c25bf
handling CSV files from shell scripts.
3c25bf
3c25bf
3c25bf
%package        devel
3c25bf
Summary:        Development files for %{name}
3c25bf
Requires:       %{name} = %{version}-%{release}
3c25bf
3c25bf
3c25bf
%description    devel
3c25bf
The %{name}-devel package contains libraries and signature files for
3c25bf
developing applications that use %{name}.
3c25bf
3c25bf
3c25bf
%prep
3c25bf
%setup -q -n csv-%{version}
3c25bf
3c25bf
3c25bf
%build
3c25bf
ocaml setup.ml -configure --prefix %{_prefix} --destdir $RPM_BUILD_ROOT
3c25bf
make
3c25bf
3c25bf
3c25bf
%install
3c25bf
export DESTDIR=$RPM_BUILD_ROOT
3c25bf
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
3c25bf
mkdir -p $OCAMLFIND_DESTDIR
3c25bf
3c25bf
make install
3c25bf
3c25bf
%if %opt
3c25bf
strip csvtool.native
3c25bf
mkdir -p $DESTDIR%{_bindir}
3c25bf
install -m 0755 csvtool.native $DESTDIR%{_bindir}/csvtool
3c25bf
%endif
3c25bf
3c25bf
3c25bf
%check
3c25bf
make test
3c25bf
3c25bf
3c25bf
%files
3c25bf
%doc LICENSE.txt
3c25bf
%{_libdir}/ocaml/csv
3c25bf
%if %opt
3c25bf
%exclude %{_libdir}/ocaml/csv/*.a
3c25bf
%exclude %{_libdir}/ocaml/csv/*.cmxa
3c25bf
%exclude %{_libdir}/ocaml/csv/*.cmx
3c25bf
%endif
3c25bf
%exclude %{_libdir}/ocaml/csv/*.mli
3c25bf
%if %opt
3c25bf
%{_bindir}/csvtool
3c25bf
%endif
3c25bf
3c25bf
3c25bf
%files devel
3c25bf
%doc AUTHORS.txt LICENSE.txt README.txt
3c25bf
%if %opt
3c25bf
%{_libdir}/ocaml/csv/*.a
3c25bf
%{_libdir}/ocaml/csv/*.cmxa
3c25bf
%{_libdir}/ocaml/csv/*.cmx
3c25bf
%endif
3c25bf
%{_libdir}/ocaml/csv/*.mli
3c25bf
3c25bf
3c25bf
%changelog
3c25bf
* Sat Sep 23 2017 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-8
3c25bf
- Remove ExcludeArch and build on s390x.
3c25bf
  related: rhbz#1447992
3c25bf
3c25bf
* Fri Sep 22 2017 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-7
3c25bf
- Rebuild for OCaml 4.05.0
3c25bf
- Add missing/implicit dependency on ocamlbuild.
3c25bf
  resolves: rhbz#1447992
3c25bf
3c25bf
* Fri Aug 08 2014 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-6
3c25bf
- Resolves: rhbz#1125623
3c25bf
3c25bf
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.2.3-5
3c25bf
- Mass rebuild 2013-12-27
3c25bf
3c25bf
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
3c25bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
3c25bf
3c25bf
* Tue Nov 27 2012 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-3
3c25bf
- BR >= OCaml 4.00.1 so we can't be built against the wrong OCaml.
3c25bf
3c25bf
* Mon Nov 26 2012 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-2
3c25bf
- New upstream version 1.2.3.
3c25bf
- New upstream location.
3c25bf
- Clean up the spec file.
3c25bf
- Remove patches since they are no longer relevant.
3c25bf
- New setup appears to require ocamldoc.
3c25bf
3c25bf
* Mon Oct 29 2012 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-13
3c25bf
- Rebuild for OCaml 4.00.1.
3c25bf
3c25bf
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-12
3c25bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3c25bf
3c25bf
* Thu Jun  7 2012 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-11
3c25bf
- Rebuild for OCaml 4.00.0.
3c25bf
3c25bf
* Fri Jan 06 2012 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-10
3c25bf
- Rebuild for OCaml 3.12.1.
3c25bf
3c25bf
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-9
3c25bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3c25bf
3c25bf
* Wed Jan 05 2011 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-8
3c25bf
- Rebuild for OCaml 3.12 (http://fedoraproject.org/wiki/Features/OCaml3.12).
3c25bf
3c25bf
* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-7
3c25bf
- Rebuild for OCaml 3.11.2.
3c25bf
3c25bf
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-6
3c25bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
3c25bf
3c25bf
* Sat May 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-5
3c25bf
- Rebuild for OCaml 3.11.1
3c25bf
3c25bf
* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
3c25bf
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
3c25bf
  (added sparc64 per request from the sparc maintainer)
3c25bf
3c25bf
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-4
3c25bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
3c25bf
3c25bf
* Thu Dec  4 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-3
3c25bf
- Rebuild.
3c25bf
3c25bf
* Wed Nov 19 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-2
3c25bf
- Rebuild for OCaml 3.11.0
3c25bf
3c25bf
* Mon Oct 27 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-1
3c25bf
- New upstream version 1.1.7.
3c25bf
3c25bf
* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-8
3c25bf
- Rebuild for OCaml 3.10.2
3c25bf
3c25bf
* Sat Mar  1 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-7
3c25bf
- Rebuild for ppc64.
3c25bf
3c25bf
* Tue Feb 12 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-6
3c25bf
- Force rebuild for OCaml 3.10.1.
3c25bf
3c25bf
* Thu Sep  6 2007 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-5
3c25bf
- Force rebuild because of base OCaml.
3c25bf
3c25bf
* Thu Aug 30 2007 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-4
3c25bf
- Force rebuild because of changed BRs in base OCaml.
3c25bf
3c25bf
* Fri Aug 24 2007 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-3
3c25bf
- License clarified to LGPLv2+ (and fixed/clarified upstream).
3c25bf
- Added ExcludeArch ppc64
3c25bf
3c25bf
* Mon Jun 11 2007 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-2
3c25bf
- Updated to latest packaging guidelines.
3c25bf
3c25bf
* Tue May 29 2007 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-1
3c25bf
- Initial RPM release.