diff --git a/README.md b/README.md index 7e0adac..2e5323d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # ocaml-augeas +Ocaml Bindings to the Augeas configuration library. + diff --git a/ocaml-augeas-0.6-ocaml-4.patch b/ocaml-augeas-0.6-ocaml-4.patch new file mode 100644 index 0000000..5870529 --- /dev/null +++ b/ocaml-augeas-0.6-ocaml-4.patch @@ -0,0 +1,34 @@ +From 1cf5aef99b26a46529ca797547c0b49627fffe78 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 7 Dec 2019 11:08:54 +0000 +Subject: [PATCH] caml_named_value returns const value pointer in OCaml 4.09+ + +--- + augeas-c.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/augeas-c.c b/augeas-c.c +index 9217017..679bcb5 100644 +--- a/augeas-c.c ++++ b/augeas-c.c +@@ -86,7 +86,7 @@ static const int error_map_len = sizeof error_map / sizeof error_map[0]; + static void + raise_error_and_maybe_close (augeas_t t, const char *msg, bool close_handle) + { +- value *exn = caml_named_value ("Augeas.Error"); ++ const value *exn = caml_named_value ("Augeas.Error"); + value args[5]; + const int code = aug_error (t); + const char *aug_err_msg; +@@ -132,7 +132,7 @@ raise_error_and_maybe_close (augeas_t t, const char *msg, bool close_handle) + static void + raise_init_error (const char *msg) + { +- value *exn = caml_named_value ("Augeas.Error"); ++ const value *exn = caml_named_value ("Augeas.Error"); + value args[5]; + + args[0] = caml_alloc (1, 0); +-- +1.8.3.1 + diff --git a/ocaml-augeas-0.6-options.patch b/ocaml-augeas-0.6-options.patch new file mode 100644 index 0000000..24bb723 --- /dev/null +++ b/ocaml-augeas-0.6-options.patch @@ -0,0 +1,28 @@ +From 56c0602e972f1fae336198eb9587d71f1e36daff Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 20 Aug 2019 15:06:57 +0100 +Subject: [PATCH] Use ocamlopt -g option. + +Originally from Fedora. +--- + Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index e01385f..4ae5ef5 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -34,8 +34,8 @@ LIBS = @AUGEAS_LIBS@ @LIBXML2_LIBS@ @LIBS@ + + OCAMLCFLAGS = -g + OCAMLCPACKAGES = +-OCAMLOPTFLAGS = +-OCAMLOPTPACKAGES = ++OCAMLOPTFLAGS = $(OCAMLCFLAGS) ++OCAMLOPTPACKAGES = $(OCAMLCPACKAGES) + + OCAMLDOCFLAGS = -html -sort + +-- +1.8.3.1 + diff --git a/ocaml-augeas.spec b/ocaml-augeas.spec new file mode 100644 index 0000000..2ed48b7 --- /dev/null +++ b/ocaml-augeas.spec @@ -0,0 +1,82 @@ +%define ocamlpck augeas + +Name: ocaml-augeas +Version: 0.6 +Release: 1mamba +Summary: Ocaml Bindings to the Augeas configuration library +Group: System/Libraries/OCaml +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://people.redhat.com/~rjones/augeas/ +Source: https://people.redhat.com/~rjones/augeas/files/ocaml-augeas-%{version}.tar.gz +Patch0: ocaml-augeas-0.6-options.patch +Patch1: ocaml-augeas-0.6-ocaml-4.patch +License: LGPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libaugeas-devel +BuildRequires: libxml2-devel +BuildRequires: ocaml-runtime +## AUTOBUILDREQ-END +BuildRequires: dune +BuildRequires: ocaml +BuildRequires: ocaml-findlib + +%description +%{summary}. + +%package devel +Group: Development/Libraries/OCaml +Summary: Development files for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +This package contains libraries and signature files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q +%patch 0 -p1 -b .options +%patch 1 -p1 -b .ocaml-4 + +%build +./configure + +make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +install -d -dm0755 %{buildroot}%{_libdir}/ocaml/stublibs +OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml \ +make install + +rm -rf %{buildroot}/usr/doc + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%dir %{_libdir}/ocaml/%{ocamlpck} +%{_libdir}/ocaml/%{ocamlpck}/* +%exclude %{_libdir}/ocaml/%{ocamlpck}/*.a +%exclude %{_libdir}/ocaml/%{ocamlpck}/*.cmx +%exclude %{_libdir}/ocaml/%{ocamlpck}/*.cmxa +%exclude %{_libdir}/ocaml/%{ocamlpck}/*.mli +%{_libdir}/ocaml/stublibs/*.so* +%doc COPYING.LIB + +%files devel +%defattr(-,root,root) +%{_libdir}/ocaml/%{ocamlpck}/*.a +%{_libdir}/ocaml/%{ocamlpck}/*.cmx +%{_libdir}/ocaml/%{ocamlpck}/*.cmxa +%{_libdir}/ocaml/%{ocamlpck}/*.mli +#%doc CHANGES* README.md + +%changelog +* Mon Feb 05 2024 Silvan Calarco 0.6-1mamba +- package created using the webbuild interface