0df6389
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
0df6389
%define debug_package %{nil}
0df6389
0df6389
Name:           ocaml-camomile
541a222
Version:        0.8.3
db39bf2
Release:        5%{?dist}
0df6389
Summary:        Unicode library for OCaml
0df6389
0df6389
Group:          Development/Libraries
0df6389
# Several files are MIT and UCD licensed, but the overall work is LGPLv2+
0df6389
# and the LGPL/GPL supercedes compatible licenses.
0df6389
# https://www.redhat.com/archives/fedora-legal-list/2008-March/msg00005.html
0df6389
License:        LGPLv2+
0df6389
URL:            http://sourceforge.net/projects/camomile/
31a43a7
Source0:        http://downloads.sourceforge.net/camomile/camomile-%{version}.tar.bz2
0df6389
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3a02209
ExcludeArch:    sparc64 s390 s390x
0df6389
db39bf2
BuildRequires:  ocaml >= 3.12.1-9
db39bf2
BuildRequires:  ocaml-findlib-devel
db39bf2
BuildRequires:  ocaml-ocamldoc
db39bf2
BuildRequires:  ocaml-camlp4-devel
0a30d4a
0df6389
%define _use_internal_dependency_generator 0
0df6389
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
0df6389
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
0df6389
0df6389
%description
0df6389
Camomile is a Unicode library for ocaml. Camomile provides Unicode
0df6389
character type, UTF-8, UTF-16, UTF-32 strings, conversion to/from
0df6389
about 200 encodings, collation and locale-sensitive case mappings, and
0df6389
more.
0df6389
0df6389
0df6389
%package        devel
0df6389
Summary:        Development files for %{name}
0df6389
Group:          Development/Libraries
0df6389
Requires:       %{name} = %{version}-%{release}
0df6389
0df6389
0df6389
%description    devel
0df6389
The %{name}-devel package contains libraries and signature files for
0df6389
developing applications that use %{name}.
0df6389
0df6389
0df6389
%package        data
0df6389
Summary:        Data files for %{name}
0df6389
Group:          Development/Libraries
0df6389
Requires:       %{name} = %{version}-%{release}
0df6389
0df6389
0df6389
%description    data
0df6389
The %{name}-data package contains data files for developing
0df6389
applications that use %{name}.
0df6389
0df6389
0df6389
%prep
0df6389
%setup -q -n camomile-%{version}
0df6389
3a02209
# This is a horrible hack to work around a bug in our ppc64 code
3a02209
# generator.  For some reason which we don't fully understand it barfs
3a02209
# on the long entry function created by the series of alias commands
3a02209
# at the end of public/charEncoding.ml:
3a02209
#
3a02209
#   let () = alias "IANA/csGB2312" "GB2312"
3a02209
#   let () = alias "IANA/GB2312" "GB2312"
3a02209
#   (* etc for 573 lines *)
3a02209
#
3a02209
# Use a sed script to change to the equivalent code:
3a02209
#
3a02209
#   let aliases = [
3a02209
#   "IANA/csGB2312", "GB2312";
3a02209
#   "IANA/GB2312", "GB2312";
3a02209
#   (* etc *)
3a02209
#   ] ;; List.iter (fun (a,b) -> alias a b) aliases
3a02209
#
3a02209
# The equivalent code contains just data plus a small entry function
3a02209
# so it doesn't break the ppc64 generator.  It's likely also to be
3a02209
# more efficient.  Since the code is equivalent, we do this
3a02209
# transformation on all arches, not just ppc64.
3a02209
#
3a02209
#   - RWMJ 2012-05-30
3a02209
3a02209
mv public/charEncoding.ml public/charEncoding.ml.orig
3a02209
sed -e 's/let () = alias \("[^[:space:]]*"\) \("[^[:space:]]*"\)/\1, \2;/' \
3a02209
    -e 's/(\* IANA \*)/let aliases = [/' \
3a02209
    -e '$ i] ;; List.iter (fun (a,b) -> alias a b) aliases' \
3a02209
    public/charEncoding.ml.orig > public/charEncoding.ml
3a02209
0df6389
0df6389
%build
0df6389
./configure --prefix=%{_prefix} --datadir=%{_datadir} --libdir=%{_libdir}
0df6389
make
0df6389
make dochtml
0df6389
make man
0df6389
strip tools/*.opt
0df6389
0df6389
0df6389
%install
0df6389
rm -rf $RPM_BUILD_ROOT
0df6389
export DESTDIR=$RPM_BUILD_ROOT
0df6389
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
0df6389
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
0df6389
mkdir -p $RPM_BUILD_ROOT%{_bindir}
0df6389
make install prefix=$RPM_BUILD_ROOT%{_prefix} DATADIR=$RPM_BUILD_ROOT%{_datadir}
0df6389
%if %opt
31a43a7
cp tools/camomilecharmap.opt $RPM_BUILD_ROOT%{_bindir}/camomilecharmap
31a43a7
cp tools/camomilelocaledef.opt $RPM_BUILD_ROOT%{_bindir}/camomilelocaledef
0df6389
%endif
0df6389
0df6389
0df6389
%clean
0df6389
rm -rf $RPM_BUILD_ROOT
0df6389
0df6389
0df6389
%files
0df6389
%defattr(-,root,root,-)
0df6389
%doc README
0df6389
%{_libdir}/ocaml/camomile
0df6389
%if %opt
0df6389
%exclude %{_libdir}/ocaml/camomile/*.a
0df6389
%exclude %{_libdir}/ocaml/camomile/*.cmxa
0df6389
%exclude %{_libdir}/ocaml/camomile/*.cmx
0df6389
%endif
0df6389
%exclude %{_libdir}/ocaml/camomile/*.mli
0df6389
%if %opt
0df6389
%{_bindir}/camomilecharmap
0df6389
%{_bindir}/camomilelocaledef
0df6389
%endif
0df6389
0df6389
0df6389
%files devel
0df6389
%defattr(-,root,root,-)
0df6389
%doc README dochtml/*
0df6389
%if %opt
0df6389
%{_libdir}/ocaml/camomile/*.a
0df6389
%{_libdir}/ocaml/camomile/*.cmxa
0df6389
%{_libdir}/ocaml/camomile/*.cmx
0df6389
%endif
0df6389
%{_libdir}/ocaml/camomile/*.mli
0df6389
0df6389
0df6389
%files data
0df6389
%defattr(-,root,root,-)
0df6389
%doc README
0df6389
%{_datadir}/camomile/
0df6389
0df6389
0df6389
%changelog
db39bf2
* Sun Jun  3 2012 Richard W.M. Jones <rjones@redhat.com> - 0.8.3-5
db39bf2
- Remove patch which worked around segfault on ARM.  Now fixed
db39bf2
  in OCaml >= 3.12.1-9.
db39bf2
3a02209
* Wed May 30 2012 Richard W.M. Jones <rjones@redhat.com> - 0.8.3-4
3a02209
- Remove ExcludeArch ppc64.
3a02209
- Add sed hack to reduce size of long entry function which breaks
3a02209
  ppc64 code generator.  See comment in spec file for full details.
3a02209
0a30d4a
* Sat May 19 2012 Richard W.M. Jones <rjones@redhat.com> - 0.8.3-2
0a30d4a
- Include workaround for segfault in gen_mappings.ml on ARM.
0a30d4a
- Bump release and rebuild for new OCaml on ARM.
0a30d4a
541a222
* Fri Jan  6 2012 Richard W.M. Jones <rjones@redhat.com> - 0.8.3-1
541a222
- New upstream version 0.8.3.
541a222
8fce710
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-2
8fce710
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
8fce710
31a43a7
* Wed Jan  5 2011 Richard W.M. Jones <rjones@redhat.com> - 0.8.1-1
31a43a7
- New upstream version 0.8.1.
31a43a7
- Rebuild for OCaml 3.12.0.
31a43a7
- camomilecharmap and camomilelocaledef no longer installed by default,
31a43a7
  install them by hand instead.
31a43a7
9b68bb7
* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 0.7.2-2
9b68bb7
- Rebuild for OCaml 3.11.2.
9b68bb7
cde8a94
* Thu Oct  8 2009 Richard W.M. Jones <rjones@redhat.com> - 0.7.2-1
cde8a94
- New upstream version 0.7.2.
cde8a94
7c75710
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-12
7c75710
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
7c75710
955cd03
* Sat May 23 2009 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-11
955cd03
- Rebuild for OCaml 3.11.1
955cd03
4f4812f
* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
4f4812f
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
4f4812f
  (added sparc64 per request from the sparc maintainer)
4f4812f
c83744e
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-10
c83744e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
c83744e
2884df8
* Wed Nov 26 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-9
2884df8
- Rebuild for OCaml 3.11.0+rc1.
2884df8
9cb07f4
* Wed Nov 19 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-8
9cb07f4
- Rebuild for OCaml 3.11.0
9cb07f4
35d8d23
* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-7
35d8d23
- Rebuild for OCaml 3.10.2
35d8d23
495ec58
* Fri Mar 21 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-6
495ec58
- ExcludeArch ppc64 (#438486).
495ec58
0df6389
* Mon Mar 17 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-5
0df6389
- Definitive license.
0df6389
- Move ./configure into the build section.
0df6389
- Remove a superfluous comment in the install section.
0df6389
- Fix rpmlint error 'configure-without-libdir-spec'.
0df6389
- Scratch build in Koji.
0df6389
0df6389
* Wed Mar  5 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-4
0df6389
- License is LGPLv2+ (no OCaml exception).
0df6389
0df6389
* Wed Mar  5 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-3
0df6389
- Remove ExcludeArch ppc64.
0df6389
0df6389
* Tue Feb 12 2008 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-2
0df6389
- Added BR ocaml-camlp4-devel.
0df6389
- Rename /usr/bin/*.opt as /usr/bin.
0df6389
0df6389
* Wed Aug 08 2007 Richard W.M. Jones <rjones@redhat.com> - 0.7.1-1
0df6389
- Initial RPM release.