diff --git a/.gitignore b/.gitignore index b1d57a3..54c1268 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ ocamlnet-2.2.9.tar.gz /ocamlnet-4.0.4.tar.gz /ocamlnet-4.1.2.tar.gz /ocamlnet-4.1.3.tar.gz +/ocamlnet-4.1.4.tar.gz diff --git a/ocaml-ocamlnet.spec b/ocaml-ocamlnet.spec index 09e6405..d9e4a8e 100644 --- a/ocaml-ocamlnet.spec +++ b/ocaml-ocamlnet.spec @@ -1,5 +1,3 @@ -%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) - # Prevent RPM from stripping the binaries & debuginfo. # # NB: Only required because this package uses the obsolete -custom @@ -10,14 +8,16 @@ %global __strip /bin/true Name: ocaml-ocamlnet -Version: 4.1.3 -Release: 4%{?dist} +Version: 4.1.4 +Release: 1%{?dist} Summary: Network protocols for OCaml License: BSD URL: http://projects.camlcity.org/projects/ocamlnet.html Source0: http://download.camlcity.org/download/ocamlnet-%{version}.tar.gz +# Non-upstream patch to fix string immutability problems with OCaml 4.06. +Patch1: ocamlnet-4.1.4-bytes-fixes.patch BuildRequires: ocaml >= 3.12.1-3 BuildRequires: ocaml-ocamldoc @@ -111,6 +111,7 @@ files for developing applications that use %{name}-nethttpd. %prep %setup -q -n ocamlnet-%{version} +%autopatch -p1 %build @@ -131,7 +132,7 @@ unset MAKEFLAGS make all -%if %opt +%ifarch %{ocaml_native_compiler} make opt %endif @@ -175,7 +176,7 @@ echo -e '-b /usr/bin/netplex-admin\n-b /usr/bin/ocamlrpcgen' \ %{_libdir}/ocaml/rpc-auth-local %{_libdir}/ocaml/rpc-generator %{_libdir}/ocaml/shell -%if %opt +%ifarch %{ocaml_native_compiler} %exclude %{_libdir}/ocaml/*/*.a %exclude %{_libdir}/ocaml/*/*.cmxa %exclude %{_libdir}/ocaml/*/*.cmx @@ -192,7 +193,7 @@ echo -e '-b /usr/bin/netplex-admin\n-b /usr/bin/ocamlrpcgen' \ %files devel %doc ChangeLog RELNOTES -%if %opt +%ifarch %{ocaml_native_compiler} %{_libdir}/ocaml/*/*.a %{_libdir}/ocaml/*/*.cmxa %{_libdir}/ocaml/*/*.cmx @@ -204,7 +205,7 @@ echo -e '-b /usr/bin/netplex-admin\n-b /usr/bin/ocamlrpcgen' \ %files nethttpd %doc ChangeLog RELNOTES %{_libdir}/ocaml/nethttpd -%if %opt +%ifarch %{ocaml_native_compiler} %exclude %{_libdir}/ocaml/*/*.a %exclude %{_libdir}/ocaml/*/*.cmxa %endif @@ -213,7 +214,7 @@ echo -e '-b /usr/bin/netplex-admin\n-b /usr/bin/ocamlrpcgen' \ %files nethttpd-devel %doc ChangeLog RELNOTES -%if %opt +%ifarch %{ocaml_native_compiler} %{_libdir}/ocaml/*/*.a %{_libdir}/ocaml/*/*.cmxa %endif @@ -221,11 +222,8 @@ echo -e '-b /usr/bin/netplex-admin\n-b /usr/bin/ocamlrpcgen' \ %changelog -* Wed Nov 08 2017 Richard W.M. Jones - 4.1.3-4 -- Bump release and rebuild. - -* Wed Nov 08 2017 Richard W.M. Jones - 4.1.3-3 -- Bump release and rebuild. +* Wed Nov 08 2017 Richard W.M. Jones - 4.1.4-1 +- New upstream version 4.1.4. * Tue Nov 07 2017 Richard W.M. Jones - 4.1.3-2 - OCaml 4.06.0 rebuild. diff --git a/ocamlnet-4.1.4-bytes-fixes.patch b/ocamlnet-4.1.4-bytes-fixes.patch new file mode 100644 index 0000000..4c832a0 --- /dev/null +++ b/ocamlnet-4.1.4-bytes-fixes.patch @@ -0,0 +1,54 @@ +--- ocamlnet-4.1.4.old/src/netzip/netgzip.ml 2017-08-14 14:16:50.000000000 +0100 ++++ ocamlnet-4.1.4/src/netzip/netgzip.ml 2017-11-08 16:24:22.162165338 +0000 +@@ -7,7 +7,6 @@ + val mutable closed = false + + method input s p l = +- let s = Bytes.unsafe_to_string s in + let n = Gzip.input gzip_ch s p l in + if n = 0 then raise End_of_file; + n +@@ -27,7 +26,6 @@ + class output_gzip_rec gzip_ch : Netchannels.rec_out_channel = + object(self) + method output s p l = +- let s = Bytes.unsafe_to_string s in + Gzip.output gzip_ch s p l; + l + method close_out() = +@@ -156,8 +154,6 @@ + (fun out_buf out_pos out_len -> + let (finished, used_in, used_out) = + try +- let in_buf = Bytes.unsafe_to_string in_buf in +- let out_buf = Bytes.unsafe_to_string out_buf in + Zlib.inflate + stream + in_buf in_pos in_len out_buf out_pos out_len +@@ -170,8 +166,7 @@ + st.in_size <- + Int32.add st.in_size (Int32.of_int used_out); + st.in_crc <- +- ( let out_buf = Bytes.unsafe_to_string out_buf in +- Zlib.update_crc st.in_crc out_buf out_pos used_out ++ ( Zlib.update_crc st.in_crc out_buf out_pos used_out + ); + + k := !k + used_in; +@@ -292,8 +287,6 @@ + (fun out_buf out_pos out_len -> + let (finished, used_in, used_out) = + try +- let in_buf = Bytes.unsafe_to_string in_buf in +- let out_buf = Bytes.unsafe_to_string out_buf in + Zlib.deflate + stream in_buf 0 in_len out_buf out_pos out_len + (if at_eof then Zlib.Z_FINISH else Zlib.Z_NO_FLUSH) +@@ -305,7 +298,6 @@ + + st.out_size <- Int32.add st.out_size (Int32.of_int used_in); + st.out_crc <- ( +- let in_buf = Bytes.unsafe_to_string in_buf in + Zlib.update_crc st.out_crc in_buf 0 used_in + ); + diff --git a/sources b/sources index 2e29d3d..06dc763 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocamlnet-4.1.3.tar.gz) = 683ab6f529639c9da01478ba8ba7a1bf89a418ad3872331bb3e29067c0a75ddc0db996630ce5a5dd116967d6e3e756ade02d9a78b865bbc226f95d01af9e3956 +SHA512 (ocamlnet-4.1.4.tar.gz) = ca502444f81898ccda27d61760a357aad59624cf3c4c025d49dd1c2e7bc3ef497c199634247ba7731e016c234e5cd92d2599d1ef9ecd55c3b6e7a64fc4773ee0