Initial import.

This commit is contained in:
Jerry James 2020-01-14 08:09:30 -07:00
parent 2c817fe780
commit ef17e8712b
4 changed files with 185 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/markup-*.tar.gz

8
ocaml-markup.rpmlintrc Normal file
View File

@ -0,0 +1,8 @@
# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
# The dictionary is missing some technical terms
addFilter(r'W: spelling-error .* (lookahead|parsers)')
# Documentation is in the devel subpackage
addFilter(r'ocaml-markup-lwt\.[^:]+: W: no-documentation')

175
ocaml-markup.spec Normal file
View File

@ -0,0 +1,175 @@
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname markup
Name: ocaml-%{srcname}
Version: 0.8.2
Release: 1%{?dist}
Summary: Error-recovering streaming HTML5 and XML parsers for OCaml
License: MIT
URL: http://aantron.github.io/markup.ml/
Source0: https://github.com/aantron/markup.ml/archive/%{version}/%{srcname}-%{version}.tar.gz
BuildRequires: ocaml >= 4.02.0
BuildRequires: ocaml-bisect-ppx-devel
BuildRequires: ocaml-dune
BuildRequires: ocaml-findlib
BuildRequires: ocaml-lwt-devel
BuildRequires: ocaml-mmap-devel
BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-ocplib-endian-devel
BuildRequires: ocaml-ounit-devel
BuildRequires: ocaml-result-devel
BuildRequires: ocaml-uutf-devel >= 1.0.0
%description
Markup.ml is a pair of parsers implementing the HTML5 and XML
specifications, including error recovery. Usage is simple, because each
parser is a function from byte streams to parsing signal streams.
In addition to being error-correcting, the parsers are:
- **streaming**: parsing partial input and emitting signals while more
input is still being received;
- **lazy**: not parsing input unless you have requested the next parsing
signal, so you can easily stop parsing part-way through a document;
- **non-blocking**: they can be used with Lwt, but still provide a
straightforward synchronous interface for simple usage; and
- **one-pass**: memory consumption is limited since the parsers don't
build up a document representation, nor buffer input beyond a small
amount of lookahead.
The parsers detect character encodings automatically, and emit everything
in UTF-8. The HTML parser understands SVG and MathML, in addition to
HTML5.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%package lwt
Summary: Adapter between ocaml-markup and ocaml-lwt
Requires: %{name}%{?_isa} = %{version}-%{release}
%description lwt
This package contains an adapter between Markup.ml and Lwt.
%package lwt-devel
Summary: Development files for %{name}-lwt
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-lwt%{?_isa} = %{version}-%{release}
Requires: ocaml-lwt-devel%{?_isa}
%description lwt-devel
The %{name}-lwt-devel package contains libraries and signature files for
developing applications that use %{name}-lwt.
%prep
%autosetup -n %{srcname}.ml-%{version}
# The uchar package is a forward compatibility package for OCaml versions prior
# to 4.03. We have a later OCaml in Fedora; uchar is in the standard library.
# Nothing in this package directly refers to uchar (only indirectly via uutf),
# so just remove the reference to it.
sed -i '/uchar/d' markup.opam
%build
dune build
# Build the documentation. Unfortunately, ocamldoc is not smart enough to
# figure out that Kstream is Markup.Kstream. I have not been able to figure
# out how to convince it, so the temporary hacked-up copy of markup.mli is
# my way of working around the problem. Please fix if you know how.
mkdir tmp
sed '/Kstream/d' _build/default/src/markup.mli > tmp/markup.mli
mkdir html
ocamldoc -html -d html -css-style doc/style.css -I +lwt -I +lwt/unix \
-I _build/install/default/lib/markup \
-I _build/install/default/lib/markup-lwt \
-I _build/install/default/lib/markup-lwt/unix \
tmp/markup.mli \
_build/default/src/lwt/markup_lwt.mli \
_build/default/src/lwt_unix/markup_lwt_unix.mli
%install
dune install --destdir=%{buildroot}
# We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc
%ifarch %{ocaml_native_compiler}
# Add missing executable bits
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+
%endif
%check
make test
%files
%doc README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/%{srcname}/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cma
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxs
%endif
%files devel
%doc html/*
%{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.a
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmx
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmt
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmti
%{_libdir}/ocaml/%{srcname}/*.ml
%{_libdir}/ocaml/%{srcname}/*.mli
%files lwt
%dir %{_libdir}/ocaml/%{srcname}-lwt/
%dir %{_libdir}/ocaml/%{srcname}-lwt/unix/
%{_libdir}/ocaml/%{srcname}-lwt/META
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cma
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmi
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cma
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmxs
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmxs
%endif
%files lwt-devel
%{_libdir}/ocaml/%{srcname}-lwt/dune-package
%{_libdir}/ocaml/%{srcname}-lwt/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.a
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmx
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmxa
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.a
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmx
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmxa
%endif
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmt
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.cmti
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.ml
%{_libdir}/ocaml/%{srcname}-lwt/%{srcname}_lwt.mli
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmt
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.cmti
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.ml
%{_libdir}/ocaml/%{srcname}-lwt/unix/%{srcname}_lwt_unix.mli
%changelog
* Fri Jan 10 2020 Jerry James <loganjerry@gmail.com> - 0.8.2-1
- Initial RPM

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (markup-0.8.2.tar.gz) = d529e5bf8ef154244603474a5e017d0a62baf64e3550346e8440adcc1166576813a22b17d0419b0399d35673f463bea5e2ae46ab5abef3f3b9befc4821fd7e1b