summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Alexandre Salim <salimma@fedoraproject.org>2021-04-08 14:41:28 -0700
committerMichel Alexandre Salim <salimma@fedoraproject.org>2021-04-08 14:41:28 -0700
commit0d50a975cab6e0265d2f3eda91abb394df9aa5cf (patch)
tree2a7a233b9c5719bb38c0914f7b310260baefb532
parent6c8570c7a007f4346e75d569136bec079503aaa4 (diff)
downloadspecs-0d50a975cab6e0265d2f3eda91abb394df9aa5cf.tar.gz
specs-0d50a975cab6e0265d2f3eda91abb394df9aa5cf.tar.xz
specs-0d50a975cab6e0265d2f3eda91abb394df9aa5cf.zip
+ ocaml-atd
Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
-rw-r--r--ocaml/ocaml-atd.spec101
1 files changed, 101 insertions, 0 deletions
diff --git a/ocaml/ocaml-atd.spec b/ocaml/ocaml-atd.spec
new file mode 100644
index 0000000..e47ad56
--- /dev/null
+++ b/ocaml/ocaml-atd.spec
@@ -0,0 +1,101 @@
+%global project_name atd
+%global forgeurl https://github.com/ahrefs/%{project_name}
+
+%bcond_without tests
+
+Name: ocaml-%{project_name}
+Version: 2.2.1
+Release: 1%{?dist}
+Summary: Static Types for Json APIs
+
+License: BSD
+URL: %{forgeurl}
+Source0: %{url}/archive/%{version}/%{project_name}-%{version}.tar.gz
+# No Scala compiler in Fedora
+Patch0: %{project_name}-2.2.1-no-atds.patch
+
+BuildRequires: ocaml
+BuildRequires: ocaml-dune
+BuildRequires: ocaml-menhir
+BuildRequires: ocaml-biniou-devel
+BuildRequires: ocaml-easy-format-devel
+BuildRequires: ocaml-re-devel
+BuildRequires: ocaml-yojson-devel
+%if %{with tests}
+BuildRequires: java-11-openjdk-devel
+%endif
+
+%description
+ATD stands for Adaptable Type Definitions. It is a syntax for defining
+cross-language data types. It is used as input to generate efficient and
+type-safe serializers, deserializers and validators. The current target
+languages are OCaml and Java.
+
+The following opam packages are provided by the atd project:
+
+* atdgen: executable that generates OCaml code dealing with json and
+ biniou data formats
+* atdj: executable that generates Java code dealing with json
+* atd: library for parsing atd files used by code generators
+
+
+%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}.
+
+
+%prep
+%autosetup -p1 -n %{project_name}-%{version}
+rm atds.opam
+rm -rf atds
+
+
+%build
+dune build %{?_smp_mflags} --verbose
+
+
+%install
+dune install --destdir=%{buildroot} --verbose
+
+# we are already packaging these properly
+rm -rf %{buildroot}%{_usr}/doc
+
+
+%if %{with tests}
+%check
+dune runtest
+%endif
+
+
+%files
+%license LICENSE.md
+%doc CHANGES.md README.md
+%{_bindir}/*
+%{_libdir}/ocaml/*
+%ifarch %{ocaml_native_compiler}
+%exclude %{_libdir}/ocaml/*/*.a
+%exclude %{_libdir}/ocaml/*/*.cmxa
+%exclude %{_libdir}/ocaml/*/*.cmx
+%endif
+%exclude %{_libdir}/ocaml/*/*.ml
+%exclude %{_libdir}/ocaml/*/*.mli
+
+
+%files devel
+%doc CODEOWNERS
+%ifarch %{ocaml_native_compiler}
+%{_libdir}/ocaml/*/*.a
+%{_libdir}/ocaml/*/*.cmxa
+%{_libdir}/ocaml/*/*.cmx
+%endif
+%{_libdir}/ocaml/*/*.ml
+%{_libdir}/ocaml/*/*.mli
+
+
+%changelog
+* Wed Apr 07 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 2.2.1-1
+- Initial package