0269ccb
%undefine _package_note_flags
7c49ae1
c002250
%ifnarch %{ocaml_native_compiler}
c002250
%global debug_package %{nil}
c002250
%endif
c002250
2baed36
Name:           ocaml-uutf
7c49ae1
Version:        1.0.3
ef416d1
Release:        6%{?dist}
c002250
Summary:        Non-blocking streaming Unicode codec for OCaml
c002250
c002250
License:        ISC
c002250
URL:            https://erratique.ch/software/uutf
2baed36
Source0:        https://github.com/dbuenzli/uutf/archive/v%{version}/uutf-%{version}.tar.gz
ffc5bbe
# Handle cmdliner 1.1.0 deprecations
ffc5bbe
Patch0:         https://github.com/dbuenzli/uutf/commit/ee1bdb7.patch
c002250
7c49ae1
BuildRequires:  ocaml >= 4.03.0
ffc5bbe
BuildRequires:  ocaml-cmdliner-devel >= 1.1.0
c002250
BuildRequires:  ocaml-findlib
c002250
BuildRequires:  ocaml-ocamlbuild
c002250
BuildRequires:  ocaml-ocamldoc
2baed36
BuildRequires:  ocaml-topkg-devel
2baed36
BuildRequires:  python3
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
2baed36
%autosetup -n uutf-%{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
7c49ae1
  sed -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
2baed36
mkdir -p %{buildroot}%{ocamldir}/uutf
2baed36
cp -p _build/{opam,pkg/META} %{buildroot}%{ocamldir}/uutf
c002250
%ifarch %{ocaml_native_compiler}
c002250
cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \
2baed36
  %{buildroot}%{ocamldir}/uutf
c002250
%else
2baed36
cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{ocamldir}/uutf
c002250
%endif
c002250
2baed36
%ocaml_files
2baed36
c002250
%check
c002250
ocaml pkg/pkg.ml test
c002250
2baed36
%files -f .ofiles
c002250
%doc CHANGES.md README.md
c002250
%license LICENSE.md
c002250
2baed36
%files devel -f .ofiles-devel
c002250
%doc html/*
c002250
c002250
%changelog
ef416d1
* Tue Jan 24 2023 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-6
ef416d1
- Rebuild OCaml packages for F38
ef416d1
b25f0fa
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
b25f0fa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
b25f0fa
ffc5bbe
* Tue Sep 20 2022 Jerry James <loganjerry@gmail.com> - 1.0.3-4
ffc5bbe
- Add upstream patch for ocaml-cmdliner 1.1.x support
ffc5bbe
75dcf29
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-3
75dcf29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
75dcf29
2baed36
* Wed Jul 20 2022 Jerry James <loganjerry@gmail.com> - 1.0.3-2
2baed36
- Use new OCaml macros
2baed36
35ab126
* Sat Jun 18 2022 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-2
35ab126
- OCaml 4.14.0 rebuild
35ab126
7c49ae1
* Mon Feb 28 2022 Jerry James <loganjerry@gmail.com> - 1.0.3-1
7c49ae1
- Version 1.0.3
7c49ae1
- Drop upstreamed -uchar patch
7c49ae1
0269ccb
* Fri Feb 04 2022 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-18
0269ccb
- OCaml 4.13.1 rebuild to remove package notes
0269ccb
1a95a35
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-17
1a95a35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
1a95a35
c619f78
* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-16
c619f78
- OCaml 4.13.1 build
c619f78
c32a3d2
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-15
c32a3d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
c32a3d2
4c459bc
* Mon Mar  1 13:17:47 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-14
4c459bc
- OCaml 4.12.0 build
4c459bc
54aae30
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-13
54aae30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
54aae30
95d4071
* Tue Sep 01 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-12
95d4071
- OCaml 4.11.1 rebuild
95d4071
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