Blame ocaml-uutf.spec

c002250
%ifnarch %{ocaml_native_compiler}
c002250
%global debug_package %{nil}
c002250
%endif
c002250
c002250
%global srcname uutf
c002250
c002250
Name:           ocaml-%{srcname}
c002250
Version:        1.0.2
a1110aa
Release:        11%{?dist}
c002250
Summary:        Non-blocking streaming Unicode codec for OCaml
c002250
c002250
License:        ISC
c002250
URL:            https://erratique.ch/software/uutf
c002250
Source0:        https://github.com/dbuenzli/uutf/archive/v%{version}/%{srcname}-%{version}.tar.gz
c002250
# The uchar package is a forward compatibility package for OCaml versions prior
c002250
# to 4.03.  We have a later OCaml in Fedora; uchar is in the standard library.
c002250
# Therefore, remove references to the compatibility package.
c002250
Patch0:         %{name}-uchar.patch
c002250
c002250
BuildRequires:  ocaml >= 4.01.0
c002250
BuildRequires:  ocaml-cmdliner-devel >= 0.9.6
c002250
BuildRequires:  ocaml-findlib
c002250
BuildRequires:  ocaml-ocamlbuild
c002250
BuildRequires:  ocaml-ocamldoc
c002250
BuildRequires:  ocaml-topkg-devel
c002250
c002250
%description
c002250
Uutf is a non-blocking streaming codec to decode and encode the UTF-8,
c002250
UTF-16, UTF-16LE and UTF-16BE encoding schemes.  It can efficiently work
c002250
character by character without blocking on I/O.  Decoders perform
c002250
character position tracking and support newline normalization.
c002250
c002250
Functions are also provided to fold over the characters of UTF-encoded
c002250
OCaml string values and to directly encode characters in OCaml Buffer.t
c002250
values.
c002250
c002250
%package        devel
c002250
Summary:        Development files for %{name}
c002250
Requires:       %{name}%{?_isa} = %{version}-%{release}
c002250
c002250
%description    devel
c002250
The %{name}-devel package contains libraries and signature files for
c002250
developing applications that use %{name}.
c002250
c002250
%prep
c002250
%autosetup -n %{srcname}-%{version} -p1
c002250
c002250
# Topkg does watermark replacements only if run inside a git checkout.  Github
c002250
# tarballs do not come with a .git directory.  Therefore, we do the watermark
c002250
# replacement manually.
c002250
for fil in $(find . -type f); do
c002250
  sed -e 's,%%%%NAME%%%%,%{srcname},' \
c002250
      -e 's,%%%%PKG_HOMEPAGE%%%%,%{url},' \
c002250
      -e 's,%%%%VERSION%%%%,v%{version},' \
c002250
      -e 's,%%%%VERSION_NUM%%%%,%{version},' \
c002250
      -i.orig $fil
c002250
  touch -r $fil.orig $fil
c002250
  rm $fil.orig
c002250
done
c002250
c002250
%build
c002250
# Build the library and the tests
c002250
ocaml pkg/pkg.ml build --tests true --with-cmdliner true
c002250
c002250
# Build the documentation
c002250
mkdir html
c002250
ocamldoc -html -d html -I _build/src _build/src/uutf.mli
c002250
c002250
%install
c002250
# Install the library
c002250
mkdir -p %{buildroot}%{_libdir}/ocaml/uutf
c002250
cp -p _build/{opam,pkg/META} %{buildroot}%{_libdir}/ocaml/uutf
c002250
%ifarch %{ocaml_native_compiler}
c002250
cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \
c002250
  %{buildroot}%{_libdir}/ocaml/uutf
c002250
%else
c002250
cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{_libdir}/ocaml/uutf
c002250
%endif
c002250
c002250
%check
c002250
ocaml pkg/pkg.ml test
c002250
c002250
%files
c002250
%doc CHANGES.md README.md
c002250
%license LICENSE.md
c002250
%dir %{_libdir}/ocaml/%{srcname}/
c002250
%{_libdir}/ocaml/%{srcname}/META
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cma
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmi
c002250
%ifarch %{ocaml_native_compiler}
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxs
c002250
%endif
c002250
c002250
%files devel
c002250
%doc html/*
c002250
%{_libdir}/ocaml/%{srcname}/opam
c002250
%ifarch %{ocaml_native_compiler}
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.a
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmx
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxa
c002250
%endif
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmt
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmti
c002250
%{_libdir}/ocaml/%{srcname}/%{srcname}*.mli
c002250
c002250
%changelog
a1110aa
* Fri Aug 21 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-11
a1110aa
- OCaml 4.11.0 rebuild
a1110aa
3724d25
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-10
3724d25
- Second attempt - Rebuilt for
3724d25
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
3724d25
cf3d5e6
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-9
cf3d5e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
cf3d5e6
3c2014c
* Tue May 05 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-8
3c2014c
- OCaml 4.11.0+dev2-2020-04-22 rebuild
3c2014c
46bd80a
* Tue Apr 21 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-7
46bd80a
- OCaml 4.11.0 pre-release attempt 2
46bd80a
b37eb31
* Sat Apr 18 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-6
b37eb31
- OCaml 4.11.0 pre-release
b37eb31
3db3902
* Fri Apr 03 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-5
3db3902
- Update all OCaml dependencies for RPM 4.16.
3db3902
8b23577
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-4
8b23577
- OCaml 4.10.0 final.
8b23577
188e433
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-3
188e433
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
188e433
35221e4
* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-2
35221e4
- OCaml 4.10.0+beta1 rebuild.
35221e4
c002250
* Thu Jan  9 2020 Jerry James <loganjerry@gmail.com> - 1.0.2-1
c002250
- Initial RPM